Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-29-2007, 09:39 PM   PM User | #1
oziris
New to the CF scene

 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
oziris is an unknown quantity at this point
Form field values passed through custom hyperlink

This is probably total beginner question. Please bear with me.

I have a form on the page in this format:

Code:
<form><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="2%">&nbsp;</td>
            <td width="31%"><img src="images/spacer.gif" width="1" height="20" alt="" /></td>
            <td width="67%">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><span class="top_nav_link">Arrival Date:</span>
              <input type="text" value="<?php echo date("m/d/Y") ?>" onfocus="this.select();lcs(this)" onclick="event.cancelBubble=true;this.select();lcs(this)" name="arr" class="calendarEntry" size="10" /></td>
            <td><span class="top_nav_link">Rooms:</span>
              <select class="nightsEntry" name="rms">
                <option value="1" selected="selected">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
              </select>              </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><img src="images/spacer.gif" width="1" height="17" alt="" /><span class="top_nav_link">Departure Date:</span><input type="text" value="<?php echo date("m/d/Y",strtotime("+24 hours")) ?>" onfocus="this.select();lcs(this)" onclick="event.cancelBubble=true;this.select();lcs(this)" name="dep" class="calendarEntry" size="10" /></td>
            <td><img src="images/spacer.gif" width="1" height="15" alt="" /><br /><input type="image" src="images/rates.gif" alt="Check rates" width="97" height="20" value="Submit" name="submitform" /></td>
          </tr>
        </table></form>
When form is submited I need three values (arr,dep and rms) to be send in the link like this (example):

http://domainname.com/search.availab.../15/2007&rms=3

Form on the destination page accepts variables in this format. Typing link in the browser like that works.

How would I do this? I tried many different paths and I had to scrap all of them. I tried setting the link as action for the form, tried posting form to itself and then pulling variables, I hit a wall each time.

Please if anyone can point me in the right direction I would appreciate it.

Thanks,
Oz
oziris is offline   Reply With Quote
Old 08-29-2007, 11:43 PM   PM User | #2
Pennimus
Senior Coder

 
Join Date: Jul 2005
Location: UK
Posts: 1,051
Thanks: 6
Thanked 13 Times in 13 Posts
Pennimus is on a distinguished road
I'm not quite sure what you're asking, but the only way you can pass form values is via a submit input on a form with the action and method values set appropriately (in your case, the name of your PHP processing script and "get" respectively).
Pennimus is offline   Reply With Quote
Old 08-29-2007, 11:47 PM   PM User | #3
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
In case you still don't get it:

Code:
<form name="form1" action="nextpage.php" method="get">
Substitute nextpage.php with the actual file you want to send the form data to.
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:21 AM.


Advertisement
Log in to turn off these ads.