PDA

View Full Version : help :)



jarhead!
29-12-2006, 10:35 AM
hey,


well i am currently tryin to make a dj panel... and I can't get my auth.php to show up before anybody logins on the index.php


this is what I have tryed


<? include("auth.php"); ?>

that didnt work then this


<? require("auth.php");

did not work... then this.


if (!strstr($view,"://")) {
if (!isset($_GET['view'])) {
require("inc/auth.php");
require("inc/config.php")

} else {
require($_GET['view'] . ".php");
}
}
?>



It still doesn't work..

Here is the auth.php

<?
// Login
// auth.php
// start session
session_start();

// convert username and password from _POST or _SESSION
if($_POST){
$_SESSION['username']=$_POST["username"];
$_SESSION['password']=$_POST["password"];
}

// query for a user/pass match
$result=mysql_query("select * from users
where username='" . $_SESSION['username'] . "' and password='" . $_SESSION['password'] . "'");

// retrieve number of rows resulted
$num=mysql_num_rows($result);

// print login form and exit if failed.
if($num < 1){
echo "<br><br>

<style type=\"text/css\">
<!--
body {
background-color: #006699;
}
-->
</style>
<link href=\"styleuser.css\" rel=\"stylesheet\" type=\"text/css\">
<style type=\"text/css\">
<!--
.style1 {color: #FFFFFF}
-->
</style>

<br>
<br>
<br>
<br>
<br>
<br>
<table width=\"541\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
<tr>
<td bgcolor=\"#07485E\"><table width=\"541\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td><img src=\"images/loginlogo.jpg\" width=\"86\" height=\"38\"></td>
</tr>
<tr>
<td><form action=\"index.php\" method=\"post\">
<br>
<table width=\"301\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"111\" class=\"unnamed1 style1\">Username:</td>
<td width=\"277\" height=\"23\"><input name=\"username\" type=\"text\" class=\"unnamed1\" size=\"20\"></td>
</tr>
<tr>
<td class=\"unnamed1 style1\">Password:</td>
<td height=\"23\"><input name=\"password\" type=\"password\" class=\"unnamed1\" size=\"20\"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td height=\"23\"><input name=\"submit\" type=submit class=\"unnamed1\"></td>
</tr>
</table>
<br>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>";

exit;
}
?>


anyhelp?

thanks,
Nick

Want to hide these adverts? Register an account for free!