| Site Map | WizTools.org | jCraze Blog |
![]() |
Passing Variables to PHP ScriptsWe will be discussing how to pass a variable from a HTML file to a PHP script. Basically this can be done in two ways:
ExampleFiles:
What it does? The bgchooser.html has three links:
When a particular link is clicked, the file bgprocess.php is opened with the chosen background and text color. The Code File I:bgchooser.html <html> Note: All the links call the file bgprocess.php. But as you notice, after the filename bgprocess.php there is a question mark(?). The part after the question mark in the URL indicates the script variable values. The variables are bg and text. Both are separated by an ampersand(&) sign. File II:bgprocess.php <html> Note: In the <body> bgcolor attribute, we print the value contained in the variable $_GET['bg']. Similarly, for the text attribute of the <body> tag, we print the value contained in the variable $_GET['text']. Demo of this example. |
[Quick Stats: Number of main threads: 4, Number of sub-threads: 3]
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.