im learning PHP but wont execute :(
Posted 21 June 2006 - 02:48 PM
[a href=\"http://www.persian-princes.com/learnphp/phpinfo.php\" target=\"_blank\"]http://www.persian-princes.com/learnphp/phpinfo.php[/a]
i know there is nothing wrong with the code as it works on my cousins server:
[a href=\"http://lucylayton.com/phpinfo.php\" target=\"_blank\"]http://lucylayton.com/phpinfo.php[/a]
i contacted my host (im running a dedicated server so i have root access) and they said:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Thank you for contacting customer support. There may be a custom configuration that you have to set on the server such as with the php.ini file. Unfortunately, we do not provide assistance with third party coding issues.[/quote]
does anyone know why i am having this proble?
ok it wouldnt let me copy the code here, but what it does is basically display the users browser, ip address and name of the file thats all
Posted 21 June 2006 - 03:03 PM
Also could you paste you code here, you should be able to. If you code has functions add a space before the parenthesis like so:
Posted 21 June 2006 - 03:17 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Information</title> </head> <body> <?php # This page lists some cool information for the user echo "You are running the file <b>$PHP_SELF</b>.<br />\n"; echo 'You are viewing this page using: <b>', $HTTP_USER_AGENT, '</b>.<br />from IP address ', $REMOTE_ADDR; ?> </body> </html>
Posted 21 June 2006 - 03:23 PM
<?php # This page lists some cool information for the user echo "You are running the file <b>$_SERVER['PHP_SELF']</b>.<br />\n"; echo 'You are viewing this page using: <b>', $_SERVER['HTTP_USER_AGENT'], '</b>.<br />from IP address ', $_SERVER['REMOTE_ADDR']; ?>The problem is to do with a PHP setting called [a href=\"http://uk.php.net/register_globals\" target=\"_blank\"]register_globals[/a]
Posted 21 June 2006 - 03:41 PM
so do i now have to add this to every variable when writing php regardless og wot the book says?
i dont quite understand why u have done this?
i read the register_globals link u sent me but couldnt make much sense of it
should i just change the register global setting on my server? im running a mambo site on my server also, would doing this harm my site?!!
thank u for ur help i appreciate it
Posted 21 June 2006 - 04:06 PM
Posted 21 June 2006 - 04:09 PM
The variable I used is part of a group of variables called [a href=\"http://uk2.php.net/manual/en/language.variables.predefined.php#language.variables.superglobals\" target=\"_blank\"]super globals[/a]
You only use these variables when you need to access server information, cookie, session, post'd and get data etc.
I would suggest you get a book that is uptodate and doesnt use register_globals for its examples.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users