Jump to content

[SOLVED] Weird problem


dezkit

Recommended Posts

I have a index.php with a login form, when somebody enters information it goes into check_login.php and checks if the username and password is correct, if it is correct, a session registers. So everytime a session registers the index.php shows a link called "Administrator Panel" to /administrator/ folder. So when i press on it, it doesn't show the "Administrator Panel" link anymore, instead, it shows a the form.

 

Link to comment
Share on other sites

<?
$myusername = $_SESSION["myusername"];

if(session_is_registered(myusername)){
echo "
<tr>
<td align=\"center\">Hello $myusername</td>
<td align=\"right\"><a href=\"http://www.xxx.com/administrator/\"  class=\"oran\">Administrator Panel</a></td>
<td align=\"right\"><a href=\"logout.php\"  class=\"oran\">Log Out</a></td>
</tr>";
} else {

?>
<tr align="left" valign="middle">
<td width="100">
<?php
$type = $_GET["type"];


if($type == "841927408208"){
echo "<font color='red'>Wrong Password. </font>";
}elseif($type == "412942414209"){
echo "<font color='red'>You Logged Out. </font>";
}elseif($type == "609421098494"){
echo "<font color='red'>Not Logged In. </font>";
}elseif($type == ""){
echo "";
}else{
echo "<font color='red'>Unkown Error! </font>";
}
?>
</td>
<td width="100"><input name="text2532" type="text" class="intext" style="width:90px; height:17px" onClick="this.value=''" value="Username"></td>
<td width="100"><input name="text25322" type="password" class="intext" style="width:90px; height:17px" onClick="this.value=''" value="Password"></td>
<td width="100"><input name="submit2222" type="submit" style="width:56px; height:18px; background-image:url(images/LogIn.jpg); border:0px none; cursor:hand; cursor:pointer; " value=""></td>
</tr>
<?php
}
?>

 

This is the login.php that i have include()'ed into the administrator panel.

Link to comment
Share on other sites

Oh, session_start() is on the page that include()s login.php

 

BTW: I Just Dragged the Login.php into the /administrator/ folder, and it started working, but i don't like the fact that if i want to change Login.php, i have to change it in 2 places, any suggestions?

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.