+ 3

How to use value of input tag to mysql string for variable

12th Nov 2016, 2:40 AM
saeid piryaee
saeid piryaee - avatar
3 Respuestas
+ 4
look at this <input type="text" name="vh"/> <?php $c=$_GET['vh']; echo $c; ?> when run this code, i get error: "undifine index c"
13th Nov 2016, 8:06 PM
saeid piryaee
saeid piryaee - avatar
+ 2
<input type="text" name="id" /> you can use $_GET['id']; you can also use $_POST. create a variable, $id=$_GET['id']; select * from table_name where id='$id';
12th Nov 2016, 2:48 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 2
use isset function like this if(isset($_GET['vh'])) echo $_GET['vh']; but it does not work on that page. Use $_POST method. Like <form action="" method="post" > <input type="text" name="vh"> <input type="password" name="vh1" /> <input type="submit" value="submit" name="submit" /> </form> <?php if(isset($_POST['vh'])){ $users1 = $_POST["vh"]; $id = $_POST["vh1"]; echo $users1; } ?> And do not use playground for this. Try to do this on localhost
14th Nov 2016, 3:07 AM
Aditya kumar pandey
Aditya kumar pandey - avatar