Solved

bypassing lines

Posted on 1997-05-06
1
161 Views
Last Modified: 2013-12-25
:I am a beginner in cgi, and my question is that I created
the form, and I post it to a cgi script. For example I have
for address, three lines that they can fill out. I named
them "add1", "add2", and "add3". What happens is when the person filling out the form only fills out the first add1, and not the second and third, and I post it to the cgi, It places the extra lines on the next page. How do I get the cgi to skip thoselines and move up my next field.


               My cgi looks like:

               <h3>$input{'add1'}<br>
               <h3>$input{'add2'}<br>
               <h3>$input{'add3'}<br>
               $input{'city1'}, $input{'state1'}
               $input{'zip1'}</h3></center></b>

I want it to skip the "add2", and "add3", and bring up
the "city1" to just below the "add1". Right now it prints
the blank lines between "add1" and "city1". Thank you
in advance for your help.
0
Comment
Question by:richl
1 Comment
 
LVL 4

Accepted Solution

by:
mikem earned 0 total points
Comment Utility
The following should work..

print "<h3>$input{'add1'}<br>\n";
if($input{'add2'}) {print "$input{'add2'}\n";}
if($input{'add3'}) {print "$input{'add3'}\n";}

Mike
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

728 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

9 Experts available now in Live!

Get 1:1 Help Now