Solved

bypassing lines

Posted on 1997-05-06
1
164 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
[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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Batch File search for Drive Letter 8 55
IDE for Python 5 108
killall tor  && service tor start  in Python 3 38
Psexec with Powershell to install critical patches 5 75
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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

751 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