I need help with a form!

liunx

Guest
I am having a problem with a simple form. I was just wondering if anyone could help me out?<br />
<br />
This is the problem, I want to be able to condense the information from multiple form elements. (Several text boxes.) And pass them all through one variable. But I am not sure how to do it. If anyone has a script or some code for me to look at, I would greatly appreciate it.<!--content-->where is the form being sent? what is teh action of the form? becasue unless you use some form of serverside languge then you can't do that.<!--content-->might be best to rethink your approach, I've done often what you are wanting to do but then i found an all-round better way...<br />
<br />
the idea to get information from a form to a script on the server... try using something like:<br />
<br />
<form id="blah" method="post" action="myServerSidePhpFileName.php"><br />
<br />
&nbsp;&nbsp;<input type="text" id="tbName1"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName2"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName3"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName4"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName5"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName6"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName7"><br><br />
&nbsp;&nbsp;<input type="text" id="tbName8"><br><br />
<br />
&nbsp;&nbsp;<input type="submit" value="Submit This Info..."><br><br />
<br />
</form><br />
<br />
<br />
and then on serverside, you could have a php such as myServerSidePhpFileName.php<br />
<br />
<?<br />
//Here, you can do whatever you like with the form data, even e-mail it to some e-mail address...<br />
<br />
/*<br />
// Theres are your variable names... in php, any form fields you submit to a php page will have the name name as the form field name in your webpage but with a dollar sign in front of it so that you know it's a scholar ( err, variable, err string )<br />
$tbName1<br />
$tbName2<br />
$tbName3<br />
$tbName4<br />
$tbName5<br />
$tbName6<br />
$tbName7<br />
$tbName8<br />
<br />
*/<br />
<br />
$AllMyFormDataInOneString = "\n tbName1=$tbName1 \n tbName1=$tbName2 \n tbName1=$tbName3 \n tbName1=$tbName4 \n tbName1=$tbName5 \n tbName1=$tbName6 \n tbName1=$tbName7 \n tbName1=$tbName8 \n";<br />
<br />
<br />
?><br />
<br />
<br />
The BEST thing about this approach is that the information you pass to the server from the visitor will NOT be visible in the addressbar nor the titlebar so things like passwords are secure plus the length of what you can send to the server is much much greater than if you just sent it as a variable at the end of the server-side filename....<!--content-->
 
Back
Top