6 Replies - 493 Views - Last Post: 06 August 2012 - 03:18 PM Rate Topic: -----

#1 rjclancy  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 56
  • Joined: 18-March 11

Live server login not working:(

Posted 06 August 2012 - 07:27 AM

Hi All;

I have a small admin section for my website...www.webheadz.ie/admin, and when i go to that url on my localhost it shows me the login page, i enter the login details and it brings me to the admin area..all works great on my localhost but on the live server it wont work, i get to the login but the login wont work..the admin folder has only three file...index.php(which is the login page) check.php(file that checks the login details) and admin.php(the admin page)....

THE FORM ON THE INDEX PAGE
<form class="login" action="check.php" method="POST">	
		Name: <input type="text" name="name" />
		Pass: <input type="password" name="pass"><br />
		<input id="submitButton" type="submit" value="proceed" style="margin-left:42px;"/>
	</form>



THE CHECK FILE
<?php
	$name=$_POST['name'];
	$pass=$_POST['pass'];
	
	if($name==('xxx') & $pass==('xxx')){
		SESSION_REGISTER('name');
		SESSION_REGISTER('pass');
		header('Location:admin.php');
	}
	else echo 'The best way to predict the future is to invent it';
?>



THE ADMIN PAGE
<?php session_start();
	if (!isset( $_SESSION['name'])){
		header('Location:index.php');
?>
<?php include 'config.php'?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" itemscope itemtype="http://schema.org/">
<head>
		<title>webheadz - web design sligo - Admin</title>
</head>

<body>
		
<div id="wrapper"></div>
</div>
</div><!---end wrapper-->
</body>
</html>



Any help would be great...i have emailed my host provider and they said it must be my code:(

Is This A Good Question/Topic? 0
  • +

Replies To: Live server login not working:(

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,217
  • Joined: 23-August 08

Re: Live server login not working:(

Posted 06 August 2012 - 07:29 AM

if($name==('xxx') & $pass==('xxx')){
That's a bitwise-AND, not a boolean one.
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Live server login not working:(

Posted 06 August 2012 - 07:32 AM

session_register() is deprecated and check.php doesn’t open a session.
Was This Post Helpful? 0
  • +
  • -

#4 rjclancy  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 56
  • Joined: 18-March 11

Re: Live server login not working:(

Posted 06 August 2012 - 07:41 AM

View PostDormilich, on 06 August 2012 - 07:32 AM, said:

session_register() is deprecated and check.php doesn’t open a session.


How ti fix???
Was This Post Helpful? 0
  • +
  • -

#5 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1001
  • View blog
  • Posts: 3,555
  • Joined: 05-June 09

Re: Live server login not working:(

Posted 06 August 2012 - 07:56 AM

View Postrjclancy, on 06 August 2012 - 03:41 PM, said:

View PostDormilich, on 06 August 2012 - 07:32 AM, said:

session_register() is deprecated and check.php doesn’t open a session.


How ti fix???

Remove your use of session_register and learn how sessions work.
Was This Post Helpful? 1
  • +
  • -

#6 rjclancy  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 56
  • Joined: 18-March 11

Re: Live server login not working:(

Posted 06 August 2012 - 02:58 PM

View PostRudiVisser, on 06 August 2012 - 07:56 AM, said:

View Postrjclancy, on 06 August 2012 - 03:41 PM, said:

View PostDormilich, on 06 August 2012 - 07:32 AM, said:

session_register() is deprecated and check.php doesn’t open a session.


How ti fix???

Remove your use of session_register and learn how sessions work.



Thanks for the link...got it working and learned a bit:)

Kind regards ronan
Was This Post Helpful? 0
  • +
  • -

#7 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1001
  • View blog
  • Posts: 3,555
  • Joined: 05-June 09

Re: Live server login not working:(

Posted 06 August 2012 - 03:18 PM

View Postrjclancy, on 06 August 2012 - 10:58 PM, said:

Thanks for the link...got it working and learned a bit:)

Kind regards ronan

Very glad to hear it! :)

(Really, really, really glad actually :D)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1