PHP doesn't work
I wanted to play around with PHP, so I set up Apache and got PHP to work with it.
Printing little hard-coded messages works, but when I try anything having to do with parameters, cookies, etc. I just gat a blank page. For example, this just gets me a blank page. If I comment out the for loops, it at least prints the hardcoded messages: Code:
<html> |
Quote:
|
And what do Apache logs say ?
|
Now the main "standard" question: what did you exactly read on PHP $_GET ? I.e. based on what exactly documentation/tutorial/example you think your code should work ?
|
Quote:
Code:
echo "<h1>Parameters</h1>"; Quote:
Quote:
|
Quote:
|
Quote:
Quote:
Crash course means no serious insights. Now, the course, of course, contains $_GET - on several pages. So based on which pages and what text did you write your code ? |
The crash course you've chosen very poorly describes "the infrastructure" around $_GET.
I used Yahoo and PHP $_GET tutorial - this yields a number of matches, and they describe the mechanism much better. |
What is it between you two?
|
General PHP troubleshooting tips
Hi:
1. When in doubt, run phpinfo (): Code:
<?php Code:
<html> Code:
<html> 5. Try more complex syntax 6. Rinse and repeat ;) |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quickly looking at this the problem appears to be twofold:
First your looping syntax is wrong: I believe that it should be foreach ($ARRAY as $KEY => $VALUE) Second you need to understand how to view the error messages that PHP generates. By default PHP doesn't display the error message on the screen but in a log file. You can change this characteristic by looking at the php configuration file php.ini, or you can look at the php log file where php specific errors are logged the path to the error log file is given in the apache configuration file The default location for the ini file is /etc/php.ini but it could be different for your system. The parts of the ini file that you need to locate is: display_errors log_errors error_reporting The default location for the apache configuration file is /etc/httpd/conf/hpptd.conf search for the term logfile, the default location will be /etc/httpd/logs/ |
All times are GMT -5. The time now is 03:07 PM. |