Errant_Shadow Posted November 21, 2009 Share Posted November 21, 2009 Okay, what I'm trying to do is to use a form to append an already existing GET data string. It goes something like this: REQUEST_URI="/page.php?var1=foo&var2=bar" Now, what I want to do is just add a new variable to the end there without replacing the whole thing. I try using the URI as the form action, but it just replaces the string entirely, returning "/page.php?var3=wtf" rather than "/page.php?&var1=foo&var2=bar&var3=wtf" Any ideas how to make this work? Link to comment https://forums.phpfreaks.com/topic/182394-appending-get-data-with-form-submition/ Share on other sites More sharing options...
JAY6390 Posted November 21, 2009 Share Posted November 21, 2009 Use the $_GET variables (var1 and var2) and put them as hidden values in the form Link to comment https://forums.phpfreaks.com/topic/182394-appending-get-data-with-form-submition/#findComment-962469 Share on other sites More sharing options...
delickate Posted November 21, 2009 Share Posted November 21, 2009 Use hidden fields, parameter instead. Link to comment https://forums.phpfreaks.com/topic/182394-appending-get-data-with-form-submition/#findComment-962485 Share on other sites More sharing options...
cags Posted November 21, 2009 Share Posted November 21, 2009 Something like... <form action="pagename.php<?php echo $_SERVER['QUERY_STRING'] . "new_var=new_val"; ?>" method="get"> Link to comment https://forums.phpfreaks.com/topic/182394-appending-get-data-with-form-submition/#findComment-962489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.