My Problem is:
I want to get the value of textbox1 then transfer it to another page where the value of textbox1 will be appeared in the textbox2.
Below is my codes for PHP:
<html>
<body>
<form name='form' method='post' action="testing2.php">
Name: <input type="text" name="name" id="name" ><br/>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
I also add the code below and the error is "Notice: Undefined index: name"
<?php
$name = $_GET['name'];
echo $name;
?>
or
<?php
$name = $_POST['name'];
echo $name;
?>
if (isset($_POST['name']))post, so in your php code you should look for the value in the$_POSTarray, so$_POST['name']issetas Dave Chen recommended, useif( ! empty($_POST['name'])instead.Andrew Gibsonhas a point about the naming convention."name"will only cause confusion, and I suggest that when you write a form, it will help to use a naming convention such asfirst_nameandlast_namerespectively. You could also use a shorter form such asfname or f_name-lname or l_name. It's only good practice ;-)