Solved

Mod: Classified Ad Script

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

830 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