error after publishing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dourvas
Forum Commoner
Posts: 26
Joined: Fri Dec 05, 2008 7:21 am

error after publishing

Post 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????
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: error after publishing

Post by mattpointblank »

Try: if(session_is_registered('authenticated'))

Quote marks are important in variable names!
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: error after publishing

Post 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
dourvas
Forum Commoner
Posts: 26
Joined: Fri Dec 05, 2008 7:21 am

Re: error after publishing

Post 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..
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: error after publishing

Post 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:
dourvas
Forum Commoner
Posts: 26
Joined: Fri Dec 05, 2008 7:21 am

Re: error after publishing

Post by dourvas »

it works!!!!!!

thank man. thanks very much
Post Reply