Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

bypassing lines

Posted on 1997-05-06
1
Medium Priority
?
168 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
ID: 1827996
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

971 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