Solved

Mod: Classified Ad Script

Posted on 1997-03-25
2
196 Views
Last Modified: 2013-12-25
Good day,

I'm currently modifying a Classified Ads script and have run into a
couple of stumbling blocks.

First off, I want to add a text box allowing the entry of a web site
URL.  I did this by adding this line in the html file:

   Web Site: <input type="text" name="WWW" size=40 value="http://">

Than, in the script it's self I added:

print ADFILE "<b>Web Site:</b> $in{'WWW'}\n

However, it doesn't seem to be writing the web site to file.  It doesn't
even acknowledge that something was entered into the field.

What am I doing wrong?  I      

And,

> if (($in{'Name'} eq "") || ($in{'E-Mail'} eq "") || ($in{'City'} eq "") > ||($in{'State'} eq "") ||  ($in{'Department'} eq "") || > ($in{'Description'} eq "")) {  ...

This bit of code checks to make sure that all fields are not left
blank.  However, I have removed the address field so that people do not
feel obligated in entering in that piece of info.

Again, the script does not ignore the empty address field and returns an
error saying that a field was left empty.

Is there something I am missing out on?

Thanks in advance for the help.

Gabriel Nijmeh
GCN Consultants
http://www.interlog.com/~gcn
0
Comment
Question by:gcn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1827833
Maybe you just made a mistake initializing and/or filling up your $in. Check for this (some print statement should be enough).
-julio
0
 
LVL 4

Accepted Solution

by:
furu earned 50 total points
ID: 1827834
A common mistake identified with data not being written to file is the lack of a > at the beginning of the filename when opening a file. Your open statement should look like this:

open (ADFILE, ">yourpath/your.file");
               ^

Note the > before the path and filename.

Also, since this probably is a file you want to append data to, you need (or at least should ) use two > like this:

open (ADFILE, ">>yourpath/your.file");
               ^^

This opens the file for append, while the first version open for writing (at the start, thus overwriting/deleting the contents of the file.)

HTH

0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question