Skip to content Skip to sidebar Skip to footer

How To Send Hidden PHP Variable With HTML Form

I just thinking how to set and send PHP variable with HTML form, from first.php to second.php. Actually my first code looks that:
/*SOME

Solution 1:

Just add a new input with type hidden within your <form> </form>

<?php $your_php_var=5;?>
</form>

    <form action='add.php' method='post'>
     <input type="hidden" name="email" value="<?php echo $your_php_var; ?>">
     <input type='text' name='account'>
     <input type='submit' value='Add'>
</form>

See more here http://www.html-form-guide.com/php-form/php-form-variables.html


Post a Comment for "How To Send Hidden PHP Variable With HTML Form"