Solved

Mod: Classified Ad Script

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now