| Welcome to WebmasterWorld Guest from 188.8.131.52 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Remote server and local server behave differently|
I am having the problem with some PHP script which wont run properly when uploaded in remote web server though they work nicely in local web server...for example
In my php login script remote server gives an error like cannot modify header information
Do both servers have the same PHP version? You may be using some methods not supported by older versions. Also double check your php.ini files to make sure they are similar where needed
you might be sending a header location redirect, move it a couple lines or re-order the logic and see if that works.
also do a phpinfo() on both servers and compare...
and posting your script might help too!
my local server has php 5.0.4 and remote has got 5.2.6....will that affect?
my script is very basic...
if(isset($_POST['username']) && isset($_POST['password']))
if ($username=="xyz" && $password=="xyz")
echo "incorrect username or password";
Some HTML Code
if(isset($_SESSION['login']) && $_SESSION['login']==true)
echo "<a href='../admin/logout.php'>Logout</a>";
echo "<a href='../admin/index.php'>Login</a>";
Don't use session_register();
$_SESSION['login']=true; is enough. Use of session_register() is deprecated.
Other than that it looks fine. GL
many thanks ag_47...
My this problem is now solved...
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved