dean012 Posted December 1, 2013 Share Posted December 1, 2013 Deprecated: Function session_register() is deprecated in F:\xampp\htdocs\login33.php on line 67 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...l1-strict.dtd"> <!-- --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Yakity Yak</title> <link href='http://fonts.googlea...=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googlea...css?family=Abel|Satisfy' rel='stylesheet' type='text/css'> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <p><!-- end #header --></p> <div id="header" class="container"> <div id="logo"> <h1><a href="#">Yakity Yak</a></h1> </div> <div id="menu"> <ul> <li class="current_page_item"><a href="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="registration.php">Login</a></li> <li><a href="adminlogin.php">Leader</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="sd.jpg" width="999" height="300" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Welcome Admin</a></h2> <form action="" method="post"> <table align="center" style="cellpadding: 10px; cellspacing: 10px;"> <tr><td>username:</td> <td><input type="text" name="username"/></td></tr> <tr><td>password:</td> <td><input type="password" name="password"/></td></tr> <tr><td> </td><td><input type="submit" name="submit"/></td></tr> </table> </form> </body> </html> <div class="entry"> </div> </div> </div> <?php session_start() ; if (!session_register('pass')){ ; } $username=$_POST['username']; $password=$_POST['password']; ?> <?php if ($username==('admin') && $password==('123') ) { $SESSION['username']; $SESSION['password']; header('location:login33.php'); } else echo 'something went wrong! Try again. Thanks.' ; ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/ Share on other sites More sharing options...
DrTrans Posted December 1, 2013 Share Posted December 1, 2013 why do you need to use session_register()? for what purpose? also you have a " ; " between your { } Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460823 Share on other sites More sharing options...
dean012 Posted December 1, 2013 Author Share Posted December 1, 2013 ? i dont get it i dont see anything "," Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460827 Share on other sites More sharing options...
Ch0cu3r Posted December 1, 2013 Share Posted December 1, 2013 session_register() and session_is_registered() are old functions. You should not be using them. Instead you use the $_SESSION superglobal variable. ? i dont get it i dont see anything ","DrTrans was referring to this code if (!session_register('pass')){ ; }The ; should not be there. But anyway the above code is invalid Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460841 Share on other sites More sharing options...
MargateSteve Posted December 1, 2013 Share Posted December 1, 2013 The clue is in the first word of the error message. Deprecated means that it should not be used as support has finished or the function has been removed. In this case, if you are using php 5.4 session_register() has been removed. Depending on how you are setting 'pass' you could probably replace what you have with $_SESSION['pass']. Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460854 Share on other sites More sharing options...
objnoob Posted December 1, 2013 Share Posted December 1, 2013 http://lmgtfy.com/?q=php+session_register+deprecated will magically fix your code. Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460863 Share on other sites More sharing options...
maxxd Posted December 1, 2013 Share Posted December 1, 2013 To expound on what MargateSteve said, use isset() with the $_SESSION superglobal in this situation - something along the lines of: if(!isset($_SESSION['pass'])){ //do whatever } Link to comment https://forums.phpfreaks.com/topic/284415-deprecated-function-session_register-is-deprecated-in-fxampphtdocslogin33php-on-line-67/#findComment-1460891 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.