<body>
<?php
if(trim($_GET["submit"])){
if($_GET["uname"]){
echo "your name is".$_GET['uname'];
}
else {
echo"please enter your name";
}
}
?>
<form>
<label for="uname">Name</label>
<input type="text" name="uname" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
hello, i'm new to php watching some tuts and trying to learn...my proble is when i load this code in browser then first time i get an error of undefined index but when i press submit button all goes well the error removes and if condition works properly..my problem is why i'm getting error of undefined index on page load?? any option to resolve this?