+ 3
How to use value of input tag to mysql string for variable
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"
+ 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';
+ 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