When you submit forms with PHP, the URL may or may not contain query strings. URLS with query strings look like http://example.com/page.php?id=22&name=Betty. URLS with query strings can pose problems when you submit a form to itself. Below, shows typical code that is used to submit a form to itself and code which can be used with query strings in the url.
Here is typical code to submit a form to itself:
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’];?>”>
Here are 2 code samples which can be used to submit a form to itself where the url the query string shown above:
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’].”?”.$_SERVER[‘QUERY_STRING’];?>”>
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’].”?id=”.$id ;?>”>
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton