I was wondering how to POST a form to a string query url. I know how to post a form, however, my urls are using string queries, and i cannot seem to post to the page i require.
My page url is along the lines of: ... Main_Franchise_Details.php?Franchise=NYC
Using:
... Main_Franchise_Details.php?Franchise=<?php echo $admin_Franchise?>
I have tried:
<form id="myform " class="Form" method="post"
action="Main_Franchise_Details.php?Franchise=
<?php echo $admin_Franchise?>" accept-charset="utf-8">
The page posts to Main_Franchise_Details.php, instead of
Main_Franchise_Details.php?Franchise=NYC
, for instance I have looked online but cannot find anything, any sugguestions.
Form:
action="receiver.php?variable_B=Im_a_get_variable" accept-charset="utf-8"> (etc ...)
put in receiver.php:
echo '<pre> POST VARS: ';
print_r($_POST);
echo 'GET VARS: ';
print_r($_GET);
You'll see variable_B under $_GET and variable_A under $_POST. Note that you should url_encode() all $_GET vars before sending and url_decode() when you read them:
action="receiver.php?variable_B=<?= urlencode('Im a GET var")
and in receiver.php:
$variable_B = urldecode($_GET['variable_B']);