Page 1 of 1

error after publishing

Posted: Fri Jan 09, 2009 4:07 am
by dourvas
hallo,

The past few days i finished my first site. the result was exacly what i hoped for. I tested my site on my localhost and on dyndns. everything were working perfect. Then i uploaded the site to my host....
My site right now is full of errors. errors i can not understand...

the first one i see...

Notice: Use of undefined constant authenticated - assumed 'authenticated' in /users/koz/lyk-neapol/idourvas/public_html/index.php on line 293

line 293
if(session_is_registered(authenticated)) // 293
//if (isset($_SESSION['SESS_LAST_NAME']))
{
echo "welcome ". $_SESSION['SESS_LAST_NAME'];

this code checks if someone is logged in. As soon as the username and psw found inside database the command
session_register("authenticated");
was executed..

i do not know what to assume. i see this error for the first time. why? and it is not the only one. My site is full of errors like that (undefined variables). what happened????

Re: error after publishing

Posted: Fri Jan 09, 2009 4:57 am
by mattpointblank
Try: if(session_is_registered('authenticated'))

Quote marks are important in variable names!

Re: error after publishing

Posted: Fri Jan 09, 2009 4:58 am
by jaoudestudios
Notices are not errors they are notices :) - sorry I know that does not help. You do not have to worry too much about notices. Your live server is setup incorrectly if you are seeing them. Your development/testing machine should have notices turned on (all errors) but on production/live server they should all be off. If you turn errors off on your live server, it will all work fine

Re: error after publishing

Posted: Fri Jan 09, 2009 5:23 am
by dourvas
thank u for the quick answear.

If you turn errors off on your live server, it will all work fine

it is something i can do? the server is not mine..i was ginen the space by an educational organitation i work for..

Re: error after publishing

Posted: Fri Jan 09, 2009 5:35 am
by jaoudestudios
If it is not your server then you can not change the php.ini to turn this off from the source. Still shocked that someone would want all error reporting (including notices) on a production server. Anyway back to the matter at hand. You might be able to over-ride it with this bit of php...(put at the top of every page)

Code: Select all

 
<?php
error_reporting(0);
?>
 
This should work, if it does not work we will try something a bit powerful...htaccess :wink:

Re: error after publishing

Posted: Fri Jan 09, 2009 7:09 am
by dourvas
it works!!!!!!

thank man. thanks very much