smansakra
07-20-2011, 01:15 PM
<?php
if($_POST['myname'])
echo "My name is ".$_POST['myname'];
else echo $ret;
$ret = '<html>
<head>
<title>Try it</title>
</head>
<body>
<form action="'.$_SERVER['PHP_SELF'].'">
My Name: <input type="text" name="myname"/>
<input type="submit" name="submit" value="Show it"/>
</body>
</html>';
?>
I have code above, yesterday is fine, but today when i open it in my browser always say:
Notice: Undefined index: myname in C:\xampp\htdocs\try_it.php on line 2
Notice: Undefined variable: ret in C:\xampp\htdocs\try_it.php on line 4
CAN SOMEBODY TELL ME? thannks so much :confused:
if($_POST['myname'])
echo "My name is ".$_POST['myname'];
else echo $ret;
$ret = '<html>
<head>
<title>Try it</title>
</head>
<body>
<form action="'.$_SERVER['PHP_SELF'].'">
My Name: <input type="text" name="myname"/>
<input type="submit" name="submit" value="Show it"/>
</body>
</html>';
?>
I have code above, yesterday is fine, but today when i open it in my browser always say:
Notice: Undefined index: myname in C:\xampp\htdocs\try_it.php on line 2
Notice: Undefined variable: ret in C:\xampp\htdocs\try_it.php on line 4
CAN SOMEBODY TELL ME? thannks so much :confused: