Get ID from HTML form - PHP

html, mysql, php

Solution

As you have used form method "post", id variable will be available in the global $_POST array so use:

<?php
$id = ((int)$_POST["id"]);
....

Problem

I've a html form for get Id from visitor ``` <form action="show.php" method="post"> <p>Your id: <input type="text" name="id" /></p> <p><input type="submit" /></p> </form> ``` and the php file for act this . ``` <?php $id = ((int)$_GET["id"]); $con=mysql_connect('localhost','user','pass'); mysql_select_db('dbname',$con); $query="SELECT * FROM `users` WHERE id = '$id'"; $select=mysql_query($query); while($row=mysql_fetch_array($select)){ echo $row['name']; } mysql_close($con); ?> ``` but it's not working , can't read id , pelase help me for resolve this issue Thank you

Original source