Skip to content Skip to sidebar Skip to footer

Html Form String Error

When I click the 'Send 'Request' button, the query string ?req_flag=0 disappears from the URL. Where am I making a mistake here? I need following URL: localhost/flavourr/send_req.p

Solution 1:

Just add a hidden value as shown below and remove the '?req_flag=0' from the action attribute.

<form method="get" action="send_req.php">
    <inputtype="text" name="f_e_mail_add" value="Enter email of your friend" size="35" />
    <inputtype="hidden" id="req_flag" name="req_flag" value="0" />
    <inputtype="submit" value="Send Request" />
</form>

Solution 2:

If your page gets that parameter from another source you can't simply transfer a GET parameter from one page to another. You have to find a way for your new form to include that parameter again before submitting the form.

The easiest way is to store it inside a hidden input element like this.

<inputtype="hidden"name="req_flag"value="<?phpecho htmlentities($_GET['req_flag'], ENT_QUOTES, 'utf-8'); ?>" />

Post a Comment for "Html Form String Error"