Re: global variable does not exist anymore?
| From: | Richard Davey | Date: | Wed, 25 Jul 2007 22:54:37 +0000 |
| Subject: | Re: global variable does not exist anymore? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259541@lists.php.net to get a copy of this message | ||
Hi Patrik,
Wednesday, July 25, 2007, 11:30:56 PM, you wrote:
> Dear my friends...
> I create a very simple script in html and php as a first step. I use suse, apache2, mysql and
> php.
> I wonder why this script does not work:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content="text/html; charset=ISO-8859-1"
> http-equiv="content-type">
> <title>Guru - Virtual bookstore who understands you for those want to be a
> GURU</title>
> </head>
> <body>
> Help us for statistic data collection for increasing our service by 'filling our
> guestbook'.<br>
> <form action="cgi/cgibukutamu.php" method="post">
> <table>
> <tr><td align="right">Name: </td><td
> align="left"><input
> type="text" name="tfnama"></td></tr>
> <tr><td align="right">Location: </td><td
> align="left"><input
> type="text" name="tflokasi"></td></tr>
> <tr><td align="right">E-Mail: </td><td
> align="left"><input
> type="text" name="tfemail"></td></tr>
> <tr><td align="right">URL: </td><td
> align="left"><input type="text"
> name="tfurl"></td></tr>
> <tr><td align="right">Comments: </td><td
> align="left"><input
> type="text" name="tfkomentar"></td></tr>
> <tr><td align="right"><input
> type="submit"></td><td
> align="left"><input type="reset"></td></tr>
> </table>
> </form>
> </body>
> </html>
> The value of "tfnama" is empty.
> cgi/cgibukutamu.php
> <html>
> <table>
> <tr><td></td><td></td></tr>
> <tr><td align="right">Name</td><td
> align="left"><?php echo "$tfnama" ?></td></tr>
> </table>
> </html>
> I had a look the into the "/etc/apache2" but I didn't find any
> "global_variable" switch as I used to find in httpd.conf
> "
> suseonthelap:/etc/apache2 # grep -n -r "global_variable" ./*
> suseonthelap:/etc/apache2 #
> "
> I got used to find "global_variable=on" line in the httpd.conf.
Try looking in php.ini
Then leave it disabled, and code your script properly so it checks the
user input and validates it before using it.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"