-5

Possible Duplicate:
What does PHP do with deprecated functions?

My groupmate made the codes on a 1.7.4 Xampp and it runs smoothly on her side but when I run it on my pc, it doesnt run since I use the latest XAMPP. I installed an old version of xampp but its a pain in the neck cause apache and mysql wont even start. Looks like its not stable or something. So my last resort is hoping that there is a way running deprecated codes on my current xampp.

index.php

<?PHP



session_start();



include('inc/config.php');
?>

<html>
<title>Login</title>
<head>



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

<style TYPE="text/css">
      <!--
    a {text-decoration: none;}
      -->
</style>

<script language="Javascript">

function validate()
{
  susername=document.myform.susername.value;
  if (susername == "" || susername == null || susername.charAt(0) == ' ')
  {
    alert("Please enter your username")
    document.myform.susername.focus();
    return false;
  }
  else
    {
    password=document.myform.password.value;

    if (password == "" || password == null || password.charAt(0) == ' ')
    {
        alert("Password cannot be blank")
        document.myform.password.focus();
        return false;
    }

    }
}

</script>



</head>

<body bgcolor="white" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">




<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="760" height="350">
    <tr>
      <td width="1" height="2" class=outline></td>
      <td width="162" height="2" class=blue valign="top"></td>
      <td width="8" height="2"></td>
      <td width="580" height="2" valign="top">


<!---------------------------------Center panel starts here------------------------------->
<!---------------------main table starts------------------->
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="580" height="200">

<!-----------------------main table ends----------------------->
    <tr>
      <td width="580" height="200">

<!------------------------- susername password table starts--------------------->

<form name=myform method="post" action="login.php" onSubmit="return validate()">



<div align="center">
  <table border="0" cellpadding="3" cellspacing="1" width="350" height="11">
  <tr>
  <br>
  <br>
    <br>
      <br>
  </tr>
  <tr>
              <td width="350" colspan="3" height="34"><font class=tablackb>Please Enter Your Username and Password:</font></td>
            </tr>


    <tr>
      <td width="90" height="21" valign="middle" align="left"><font class=tablack>Username</font></td>
      <td width="10" height="21" valign="middle" align="center"><font class=tablack>:</font></td>
      <td width="250" height="21" valign="middle" align="left"><font class=tablack><input id="username" class=ainput type="text" name="name" placeholder="Username" size="30"></font></td>      
    </tr> 

    <tr>
      <td width="90" height="21" valign="middle" align="left"><font class=tablack>Password</font></td>
      <td width="10" height="21" valign="middle" align="center"><font class=tablack>:</font></td>
      <td width="250" height="21" valign="middle" align="left"><font class=tablack><input id="password" class=ainput type="password" name="password" placeholder="Password" size="30"></font></td>      
        </tr> 
    <tr>
    <td width="350" height="21" valign="middle" align="center" colspan="3"><font class=tablack>password must be 6-18 characters</font></td>
    </tr>
    <tr>

      <td width="350" colspan="3" height="21" class=white valign="middle" align="center" colspan="3"><font class=tablack> <input  type="submit" value="Submit" name="Submit">&nbsp; &nbsp; &nbsp; &nbsp; <input type="reset" value="Reset" name="Reset"></font></td>      
    </tr> 

  </table>
</div>
</form>
<center>
</center>
<!-------------------------------susername password table ends------------------------->
</td>
    </tr>





<!----------------------------------copy this for more cells start---------------------------->
    <tr>
      <td width="580" height="1"></td>
    </tr>
<!----------------------------------copy this for more cells ends---------------------------->


<!-------------------------------main table starts-------------------------->

  </table>
  </center>
</div>
<!--------------------------------main table ends------------------------------>

<!---------------------------------Center panel ends here---------------------------------></td>
      <td width="8" height="2"></td>
      <td width="1" height="2" class=outline></td>
    </tr>
  </table>
  </center>
</div>




</body>

</html>

login.php

Community
  • 1
  • 1
user1551672
  • 119
  • 1
  • 3
  • 12
  • 4
    I doubt it would be possible to provide less useful information. – gview Dec 19 '12 at 02:36
  • What do you mean by doesn't run? – Jim Dec 19 '12 at 02:38
  • @Jim This line: `$result = mysql_db_query($database, $query, $connection);` says it has an error and it is deprecated. so i cant see the working program. Im using the latest XAMPP and im asking if its possible to enable deprecated codes to run/ – user1551672 Dec 19 '12 at 02:43
  • This should just be a warning and shouldn't actually prevent you from accessing the site. – Jim Dec 19 '12 at 02:48
  • @Jim why does it show loads of error then? And in the login page, php codes are being printed out on the top of the page. http://i.imgur.com/wXayO.png – user1551672 Dec 19 '12 at 02:50
  • @user1551672 The image above states that the database settings haven't been given. You'll need to make sure username, password, host, e.t.c. are specified. – Jim Dec 19 '12 at 02:55
  • @Jim they're all specified. the codes werent modified since i copied them directly from my classmate's laptop. and it works perfectly fine on her laptop. Also, theres an error on the login: http://i.imgur.com/RCDkv.png its showing the code. – user1551672 Dec 19 '12 at 02:59
  • @user1551672 Can you show us the PHP for that page? Make sure to hide any passwords or other details. – Jim Dec 19 '12 at 03:01
  • is not your code, when you copied program did you set up matching database is mysql. – ROY Finley Dec 19 '12 at 03:01
  • @ROYFinley of course. i exported database from her laptop and then imported it to mine. with the same names of course. – user1551672 Dec 19 '12 at 03:02
  • @Jim i added it on my original post – user1551672 Dec 19 '12 at 03:07
  • are you connecting to the invoice table with no password? – ROY Finley Dec 19 '12 at 03:07
  • Well now i cant login in to the main page. just in the login page. – user1551672 Dec 19 '12 at 03:08

1 Answers1

1

You can change the error reporting to stop reporting on deprecation warnings. See here.

However you should very seriously considering updating the code to use a non-deprecated extension such as MySQLi or PDO_MySQL.

Edit: Also the image you supplied suggests that you have not supplied the parameters for connecting to the database.

Jim
  • 22,354
  • 6
  • 52
  • 80
  • I did supply it. Well at least my classmate did. I just copied all her codes which were fine on her laptop. But its not on mine. So i thought maybe its the version of the xampp. – user1551672 Dec 19 '12 at 03:01