Solved

Mod: Classified Ad Script

Posted on 1997-03-25
2
184 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 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