combining textfields to form a variable data and thend sending through URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • learnPHP
    New Member
    • Mar 2008
    • 20

    #1

    combining textfields to form a variable data and thend sending through URL

    Hi,

    I am trying to get a couple of text field entered in the text boxes and am then wanting to concatenate the data into one PHP variable. Finally i want to send the php variable in the action command through the URL of the next page. please let me know how to do this.

    Code:
    <p align="center">
                                                         <input name="textfield" type="text" size="5" maxlength="3"> 
                                                         &nbsp; . &nbsp; 
                                                         <input name="textfield2" type="text" size="5" maxlength="3"> 
                                                         &nbsp; . &nbsp;
                                                         <input name="textfield3" type="text" size="5" maxlength="3"> 
                                                         &nbsp; . &nbsp;
                                                         <input name="textfield4" type="text" size="5" maxlength="3">
                                                         &nbsp;&nbsp;</p>
    													 
    									<?PHP 
    									$IP = echo  "'textfield'.'textfield2'.'textfield3'.'textfield4'";
    									?>
    the above code is how i am trying to concatenate the different textboxes data into one PHP variable. Please let me know if i am doing it incorrectly.


    Now I want to pass that variable as a paramter in action command as location.php?IP =$IP... something like this. Please help.
    Code:
    <form name="contact_form" method="get" action= "location.php" onsubmit="return validate_form ( );">
    Last edited by Markus; Oct 3 '08, 06:57 PM. Reason: fixed code tags
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    You managed to get one set of code tags right. Remember it's [code] that format.

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      I think a tutorial or two about HTML forms would help.
      This is pretty basic stuff and there is no shortage on information on this topic online. (Google never fails)

      Maybe this article could get you started.

      Comment

      Working...