Jump to content
Kev

Index Log-in protect

Recommended Posts

Bun, deci am urmatorul cod Login.php:

 

Spoiler

<?
// db connection string
$conn=mysql_pconnect($dbhost,$dbuser,$dbpass);
    if(!@$conn) {
        echo "<h1>Unable to Establish Connection to the Server</h1><hr noshade size=2 color=#000000>";
        exit();
    }
    $db_sel=mysql_select_db($dbname,$conn);
    if(!@$db_sel) {
        echo "<h1>Unable to Connect to the Database</h1><hr noshade size=2 color=#000000>";
        exit();
    }

// Submit button click 

$uname = $_POST['uname'];
$pass = $_POST['pass'];
if(isset($_REQUEST['submit']))
 {
   $sign=mysql_query("select * from ".ADMINLOGIN." where  username='$uname' and password='$pass'");
   $no=mysql_num_rows($sign); 
//if username and password matches
   if($no==1)
    { 
       $_SESSION['logkey']=signedup;
        $_SESSION['adminname']=$uname;
        
        $logintimes=mktime();
        
        $ipaddress=$_SERVER['REMOTE_ADDR'];
        
        // redirect to the password protected page
           
         echo "<meta http-equiv='refresh' content='0;url=index.html'>";        
         exit();
         
     } 
     
     Else{ // if username password entered is wrong
Echo invalid password”;

 }

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="100" height="43" align="left" valign="top" style="padding-left:20px"><span class="style3">&nbsp;User Name :</span></td>

                  <td width="118" align="left" valign="top"><input type="text" name="uname" value="<?=$uname;?>" class="style3" size="18"/></td>
                </tr>
                <tr>
                  <td align="left" valign="top" class="style3" style="padding-left:20px">&nbsp;Password :</td>
                  <td align="left" valign="top"><input type="password" name="pass"  class="style3" size="18"/></td>
                </tr>
                <tr>

                  <td height="37" colspan="2" align="center" valign="top"><table border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="100">&nbsp;</td>
                        <td width="118" height="37" align="center" valign="middle">
                        <input type="submit" name="submit" value="Login" class="button"  />                          </td>
                      </tr>
                    </table></td>
                </tr>
              </table>

 

 

 

Incerc sa protejez index.html. Unde gresesesc?

Linia 40

 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/hosting/Login.php on line 40

 

Edit:/ am modificat " 

 

Linia 65:

 

 Parse error: syntax error, unexpected $end in /home/hosting/Login.php on line 65

 

Thanks

Link to comment
Share on other sites

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.   Paste as plain text instead

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