|
Written by DanielRo
|
In our contact us script tutorial you learned the basics of creating contact forms using a PHP file and a HTML form. In this tutorial we are using only one master php file, containing both the form and the php code.
In our first tutorial we used the basic approach, a HTML FORM witch sends data using POST to a PHP file. Nonetheless this is not a bad approach in creating forms and parsing data to PHP files but as you are developing a better, stronger, faster application you will need more and more forms thus creating two files for every form can get real ugly real fast.
In this technique a single PHP file is being used, containing both the HTML FORM and the PHP script.
Here is the actual script:
<?
/*Check to see if the FORM was submitted (if the "SEND" value was sent)*/
if(isset($_POST['send']))
{
/* Get the "username" and "password" values from the form */
$user = $_POST['username'];
$pass = $_POST['password'];
/* This is the place where you connect to your database
or whatever function you are using after the form is submited */
}
/* If the "send" value was not sent, then the form is displayed */
else {
?>
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>">
Username:
<input name="username" type="text"><br>
Password:
<input name="password" type="password"><br>
<input name="send" type="submit" value="Login">
</form>
<? } ?>
- Install Photoshop on Ubuntu Linux
Believe it or not Photoshop CS2 is now fully supported on Ubuntu Linux using Wine. For a long period of time I was eager in switching to Ubuntu but the incompatibility of my most used Windows based applications always made me switch back to Linux. No more Windows based Photoshop skills, now you can powerup Photoshop on Ubuntu.
- Google AdSense with Allowed Sites
Every AdSense Publisher had nightmares when hearing of all the horror stories where people get banned from AdSense because someone else used their AdSense code on malicious sites, breaking the Google AdSense TOS.
This all ended when Google decided to listen to the community and build the Allowed Sites feature.
- Adding a bump to a photo in Photoshop
In this Photoshop tutorial you are going to learn how to add a bump to a photo increasing its artistic effect and making it more realistic.
- How to create a Basic Windows bootable CD

Here is a simple method of getting the core part of Windows and important applications on one bootable Live CD.
- The quantum processor
The next generation of processors
Subscribe now via RSS feed and get all the new tutorials
|
|
Last Updated ( Sunday, 14 October 2007 )
|