?
Solved

Mod: Classified Ad Script

Posted on 1997-03-25
2
Medium Priority
?
205 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 150 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

765 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