form.php
CODE
<FORM action="vali.php" method="post">
<P>
<LABEL for="user">User name: </LABEL>
<INPUT type="text" id="user"><BR>
<INPUT type="submit" value="Send">
</P>
</FORM>
<P>
<LABEL for="user">User name: </LABEL>
<INPUT type="text" id="user"><BR>
<INPUT type="submit" value="Send">
</P>
</FORM>
vali.php
CODE
<?php
$user =$_POST['user'];
$cuser=0;
for($i=0; $i<strlen($user); $i++)
{
if ($user[$i]==" ")
{
$cuser=1;
}
}
if($cuser==1)
{
echo "The user name have spaces";
}
else
{
echo "The user name is correct";
}
?>
$user =$_POST['user'];
$cuser=0;
for($i=0; $i<strlen($user); $i++)
{
if ($user[$i]==" ")
{
$cuser=1;
}
}
if($cuser==1)
{
echo "The user name have spaces";
}
else
{
echo "The user name is correct";
}
?>

