Jump to content

Urghh... Why does my script run on PHP Version 5.0.4 but not PHP Version 5.2.15


surefire12345

Recommended Posts

Hi all,

 

But of a PHP newbie so treat me nice but this one is driving me nuts  :confused:

 

I have the exact same login.php file running on two different servers and they have slightly different versions of PHP installed as follows:

 

1. PHP Version 5.0.4 - version http://www.trafficpaymaster.com/tpm/phpversion.php

2. PHP Version 5.2.15 - version http://www.dentistsinflorida.org/tpm/phpversion.php

 

The login works fine on the first server from here:

http://www.trafficpaymaster.com/tpm/login.php

 

Email: test@test.com

Pwd: test

 

But try it on the second server here:

http://www.dentistsinflorida.org/tpm/login.php

 

Using the same email and password (which is correct) it just loops round not letting the user into the main script at index.php

 

Question:  Why?

What have I got wrong for that later version of PHP?

 

 

Many thanks guys.

 

Link to comment
Share on other sites

Ah yes, of course...

 


<?php
include "utils.php";

if (file_exists("password.php")) {
   include("password.php");
} else {
   header("Location: install.php");
   exit();
}

if ($_GET['step']=='remind') {
   $mes = "Hi there,
Thanks for requesting a password reminder.

----------------------------
Login: {$conf['script_url']}
Email: $username
Your password: $password
----------------------------

";
      $res = mail($username, "TPM Password Reminder ", $mes, "From: admin@{$conf['server_domain']}");
   if (! $res) {
      $res = mail($username, "TPM Password Reminder ", $mes, "admin@{$conf['server_domain']}");
   }
   AddMessage("Password emailed  to $username.");
}
if ($_REQUEST['login']) {
   if (! (
         $_POST['username']
         &&
         $_POST['password']
   )) {
      AddError("Please enter email and password.");
   } else {
      if (
            isset($_POST['username'])
            &&
            isset($_POST['password'])
            &&
            ($_POST['username']==$username)
            &&
            ($_POST['password']==$password)
         )
      {
         setcookie ("admin", 1);
         header('Location: index.php');
      } else {
         AddError("Login Incorrect.");
      }
   }
   sleep(2);
}


$title='Admin Login';
include('header.php');

echo "
<table border='0' width='100%' height='100%'>
<tr><td width='100%' align='center' valign='middle'>
<p align='center'>


      <font color=red>{$strs['errmes']}</font>{$strs['infomes']}

   <form method='post' action=\"login.php\"
    onSubmit=\"return CheckFieldsForm(this, new Array('username', 'password'));\"
   >
      Email<br>
      <input name='username' size='35'><br>
      Password<br>
      <input type='password' name='password' size='35'><br><br>
      <input class='button' name='login' type='Submit' value='Login'>
</form>

   <br/>
   <a href=\"login.php?step=remind\">Remind Password</a>

   </p>


</td></tr>
</table>";



?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.