FeedBurner FeedCount

Saturday, October 26, 2013

PHP tutorial for beginners - Simple Verification by Rui Santos

1.) First:

This time, we will do a verification in which when you dont input a word or text, name it will be verified
that you should input name in the field.

And when you input your name, it will say "G'day! 'entered_name' ";

For now copy the code below and save it as index.php

<html>
<head>
<title>My Verification</title>
</head>
<body>
<form action="verify.php" method="post">
Enter your name: <input type="text" name="your_name" placeholder="Input your name please">
<input type="submit" name="enter" value="Enter">
</form>
</body>
</html>

2.) Next:

Then copy this code and save it as verify.php
This verification is not too good for a real verification process
but this is a good start :) "Everything starts from small then go to big, and then go to huge lol." Enjoy. If this blog helps you please comment and if you want some
other tutorials, i'm always here to do it. :)

<?php

if(isset($_POST["enter"]))
{
if(($_POST["your_name"] == null))
{
echo "Please input your name!" . "<a href='index.php'>Click back</a>";
}
else{
echo "<h1>G'day " . $_POST["your_name"] . ". Welcome!</h1>";
}
}

?>

No comments:

Post a Comment