html - Passing variables in PHP pages -


i have read value form input form user. form post.

<form action="form_handler.php" method="post"> 

then, in form_handler.php page saved value in variable. $productid=$_post['product']; then, want pass variable via link page as:

 echo "<a href='products.php?prodid=".$productid."' title='products   page' class='whatever'>click here product details</a>"; 

when click link, see value in link. but, inside page products.php want make mysql query product details as:

$sql = "select * products prodid = '$productid'";  

i 0 results. tried echo $productid value , seems empty , not value saw in url.

what mistake please? how can make database query fetch product details based on productid variable passed in link?

note: trying make demo mysql injection vulnerability. please, ignore security issues here.

you can not productid .. have put `$productid = $_get['prodid']; ' can use variable sql query .


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -