Advertisement
Archive for April, 2008
Step 3: PHP Codes
Now that we have completed making the form page, we now need PHP coding to write the data to text file.
To do this, again open form.php On the top of everything, write this code:
PHP Code:
if (isset($_POST['submit'])) {
// Do something
}
?>
This means if $_POST['submit'] is set, where ’submit’ is the “name” of the submit button, then do something.
We used here $_POST[] because we used form method=”POST”, if we had used method=”GET “, then we would have used $_GET[] here.
Now we need it to do something if the submit button is set.
So, to do this, we will add some code on our current code.
We will add everything we need, after or by replacing “// Do something“.
Before we make the script write to file, we need to make sure of following things:
If on Linux, file must have writing permission , that is, CHMOD 777
Now start writing code !
Tutorials
Category: PHP Mysql Tutorials
Author: Bilal Ghouri Date: Apr 21 2008 | Views: 530
Category: PHP Mysql Tutorials
Author: Bilal Ghouri Date: Apr 21 2008 | Views: 1237
Category: PHP Mysql Tutorials
Author: Bilal Ghouri Date: Apr 18 2008 | Views: 287
Category: Macromedia-Adobe Flash Tutorial
Author: Bilal Ghouri Date: Apr 14 2008 | Views: 139
Category: 3d Studio Max Tutorials
Author: Bilal Ghouri Date: Apr 14 2008 | Views: 112
Category: XHTML and CSS Tutorials
Author: Bilal Ghouri Date: Apr 14 2008 | Views: 103
Category: Windows XP Tricks
Author: Bilal Ghouri Date: Apr 14 2008 | Views: 107
Category: PHP Mysql Tutorials
Author: Bilal Ghouri Date: Apr 14 2008 | Views: 100