<?php
if(isset($GET['user_name'])&&!empty($_GET['user_name'])) {
echo $user_name=$_GET['user_name'];
}
echo $user_name=$_GET['user_name'];
?>
Name:
[php]<?php
if( isset($_POST[‘submit’]) && $_POST[‘submit’] == ‘Submit’ ) {
echo $user_name=$_POST[‘user_name’];
}
?>
Name:[/php]
First, I would suggest using $_POST instead of $_GET, it’s more rebust. Second you had a quotation mark missing, which would cause it to fail. Third get ride of the second check in the if statement, for that is simply overkill. Plus I change it to be what is more likely going to be code as. An lastly get rid of the second echo statement outside the if statement for that will cause an error.