dtyson2000 Posted November 24, 2006 Share Posted November 24, 2006 Back for more here...I've searched all over and REQUEST_URI doesn't seem to work for me, unless the syntax was wrong when I tried it. I guess I really don't know what I'm searching for.I've got a page that is the result of a query that calls up the ID of a record. That's no problem. What I am doing is is asking the user to input a variable into a form so that the result will update the same window to reflect the addition. We'll use a Zip Code as the example:[code]<form name='form' action='file.php' method='get'>[/code]What that does is add the new variable to the url but the initial query appended to the url is gone, so the result is the record returns nothing.How can I retain the query in the url (file.php?id=$id) and append say a zip code to that (file.php?id=$id&zipcode=$zipcode)?I appreciate any help anyone can offer. Link to comment https://forums.phpfreaks.com/topic/28341-url-doesnt-reflect-query-string/ Share on other sites More sharing options...
kenrbnsn Posted November 24, 2006 Share Posted November 24, 2006 In your form, put a hidden field named "id" with the value of the variable $id. When the form is submitted, this will do what you want.[code]<input type="hidden" name="id" value="<?php echo $id ?>>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/28341-url-doesnt-reflect-query-string/#findComment-129625 Share on other sites More sharing options...
dtyson2000 Posted November 24, 2006 Author Share Posted November 24, 2006 Man that was simple!Thanks so much. It all does what you stated (with just a small adjustment: value='$id'). Simple enough.Thanks again! Link to comment https://forums.phpfreaks.com/topic/28341-url-doesnt-reflect-query-string/#findComment-129629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.