Dear Sir,
I have modified your codes once again as
[php]<?php
if (isset($_POST[‘button1’])){
$name=$_POST[‘text1’];
}else{
$name="";
}
if ($name) {
echo 'My name is ’ . $name;
}else{
echo ‘No name entered’;
}
?>
First form
<form name="aa" method="POST">
Name
<input type="text" name="text1" value="">
<input type="submit" value="display" name="button1">
</form>
[/php]
It has no error, I need little modification again.
When I load page it says:
No name entered
When I press Display button then it must run following codes
[php]if (isset($_POST[‘button1’])){
$name=$_POST[‘text1’];
}else{
$name="";
}
if ($name) {
echo 'My name is ’ . $name;
}else{
echo ‘No name entered’;
}
[/php]
Why it run above codes without pressing Display Button?