Jump to content

html php post


jermaindefoe

Recommended Posts

I have  a variable called total price tat i need to send to the other page, how can i , on the click of a button and using post send this value and change to the new page? something like this...?

 

<form action = "postage.php" method = "POST">

<center><input type = "submit" value = "procceed to checkout" name= "grandT"></center>

<form>

Link to comment
https://forums.phpfreaks.com/topic/182407-html-php-post/
Share on other sites

Use a hidden field:

 

<form action = "postage.php" method = "POST">
<input name="total_price" type="hidden" value="<?php echo $total_price; ?>" />
    <center>
    	<input type = "submit" value = "procceed to checkout" name= "grandT">
    </center>
<form>

 

But bear in mind that you will have to check to see if $_POST['total_price'] is the correct price (on postage.php) as users could tamper with the form values before submitting it.

Link to comment
https://forums.phpfreaks.com/topic/182407-html-php-post/#findComment-962625
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.