SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    May 2002
    Posts
    1,370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing 2 variables w/button

    This passes the first "MZp" in the url. How can I get a second variable which is found on the page as " $MCtID " to pass too? It wants to pickup from the submit value "Search" (and not "action") so can it be written into "Search"?

    <form name="form1" method="get" action="loc/result.php"> <p align="center"><font size="2" face="Arial, Helvetica, sans-serif"><br>
    Your
    zip: </font>
    <input name="MZp" type="text" size="12" maxlength="12" >
    <input type="submit" name="MCtID" value="Search">

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    ble
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really dont get you.. however you can have as many input's in your form as you like.. you just need to remember to turn them into variables..

    $MCtID == $_POST[mctid] like that.. then us this

    Code:
    <input name="mctid" type="text" size="12" maxlength="12">
    Which added into it would be

    Code:
    <form name="form1" method="get" action="loc/result.php">
    <p align="center"><font size="2" face="Arial, Helvetica, sans-serif"><br>
    Your zip:
    <input name="MZp" type="text" size="12" maxlength="12" >
    Your MctId:
    <input name="mctid" type="text" size="12" maxlength="12">
    <input type="submit" name="MCtID" value="Search">
    But if your using php, remember to call it using:

    PHP Code:
    $MCtID == $_POST[mctid
    I hope this helped,
    BA
    If someone was helpful, give them some 'rep'.

  3. #3
    SitePoint Wizard
    Join Date
    May 2002
    Posts
    1,370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks BA

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    ble
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, I helped someone!

    No problem man.. any time - well only if I can answer your problem!
    If someone was helpful, give them some 'rep'.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •