User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 396,965 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,919 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 429 | Replies: 11
Reply
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: i`m lost!!!

  #11  
May 15th, 2008
Hmm.. I don't have a clue..
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: May 2008
Posts: 31
Reputation: rgviza is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
rgviza rgviza is offline Offline
Light Poster

Re: i`m lost!!!

  #12  
May 15th, 2008
You have http://localhost hardcoded in your script, use the host name of the web server.

This would explain why it works on your workstation but not the server. When you have no session data it's because you've been transferred to the web server running on your workstation, and the session data is on the remote server, so php doesn't see it.

To find it all, shut down the server running locally and you'll get 404's wherever you have a hardcoding.

To avoid this use:
header( "refresh:5; url=http://{$_SERVER['SERVER_NAME']}/website/myprofile.php" );

or

header( "refresh:5; url=/website/myprofile.php" );

instead of

header( 'refresh:5; url=http://localhost/website/myprofile.php' );

Either works...

Hardcoding host names in links will always cause broken scripts so never do it unless you are going to a different host and there is no other way 8)

I learned this from working in a disciplined environment where we had:
www.servername.com
qual.servername.com
dev.servername.com

Hardcoding caused the qa guys to get completely broken sites. You learn really fast when it takes a week of red tape to get changes moved, then another week to get the fixes put in to fix your hardcodings ROFL.
Last edited by rgviza : May 15th, 2008 at 1:45 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 8:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC