Jump to content

CMS built with PHP and MySQL, log in help


peeji

Recommended Posts

Hi there, I downloaded the CMS from this website http://www.cms-center.com/ and I've tried to run the login.php file but it won't work for some reason. When I try to log in, it just reloads the page without taking me to the admin page (which is what it is supposed to do upon successful login). Here's the code:

 

<?

session_start();

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html>

<head>

<title>Login</title>

<link href="/style.css" rel="stylesheet" type="text/css">

</head>

 

<body style="font-family: tahoma;">

<?

require ("config.php");

 

if ($e ==  "1") {

echo "<p>Please Login</p>";

}

?>

<h3>Simple CMS Login</h3>

<p><img src='img/security.gif' title='please login'></p>

<form action="login.php" method="post" name="frm">

<table cellspacing="4" cellpadding="4" style="border-bottom-width: thin; border-left-width: thin; border-right-width: thin; border-top-width: thin; border-style: dotted; border-color: red;">

<tr>

<td>username</td>

<td><input type="text" name="formlogin" class="cssborder"></td>

</tr>

<tr>

<td>password</td>

<td><input type="password" name="formpass" class="cssborder"></td>

</tr>

</table>

<br> <input type="submit" value="login" class="cssborder">

</form>

 

<?

//echo "formlogin=$formlogin";

//echo "<br>formpass=$formpass";

//echo "<br>login=$login";

//echo "<br>pass=$pass";

 

if ($formpass == $pass && $formlogin == $login) {

session_register("loggedin");

$loggedin = "1";

//logged in so run a javascript redirect to admin page.

?>

<script language="javascript">

<!--

location.replace("admin");

-->

</script>

 

<h4><a href='admin'>you are now logged in, continue to the admin section</a></h4>

<?

}

?>

 

<p><a href="login.php"><small>reload</small></a></p>

</body>

</html>

 

 

Could anyone enlighten me on this? Thanks!

if ($formpass == $pass && $formlogin == $login) {
   session_register("loggedin");
   $loggedin = "1";
//logged in so run a javascript redirect to admin page.
?>
<script language="javascript">
<!-- 
location.replace("admin");
-->
</script>

 

This is awful code (using javascript to redirect). session_register() is depreciated. Get yourself a new CMS (an upto date one at least)

I'll second that, the script is way out of date. It is using register_globals and session_register() (both were turned off by default 7 years ago) and it is using short open tags (they should never be used in a script that is distributed for others to use on a server different form the one the code was developed to run on.)

This is awful code (using javascript to redirect). session_register() is depreciated. Get yourself a new CMS (an upto date one at least)

 

The best part is this is up-to-date code (atleast for SimpleCMS it is) ;) And just say you are referring to Drupal :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.