Jump to content

honorhim

Members
  • Posts

    10
  • Joined

  • Last visited

honorhim's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Andy, I'm starting to see the light at the end of the tunnel. That code sort of shows the page but has an error message across the top: Warning: session_start() []: Cannot send session cache limiter - headers already sent (output started at /home/web/admin/index.php:1) in /home/web/admin/index.php on line 2 What does that mean? Thanks so much for your help. I once spent a month living in Copenhagen near Norrebrogade and really appreciated the Danes. You're no exception and make your country proud. And if I ever cross paths with the code writer, I'd be more than pleased to honor your request.
  2. Hi Andy, When I added the curly bracket at the end, I got a long error message. Here is the code as it stands now. Could I ask you for a huge favor? Could you just correct it as it should be corrected? I'm not a programmer (and the coding was done by a programmer years ago) and am in way over my head on this. The error message I am getting on the code below is: Parse error: syntax error, unexpected $end in /home/web/admin/index.php on line 129 Line 129 is the last line. Thanks so much. <script language=php> session_start(); session_register("myauth"); include ("../connection.php"); $user_id=$username; $pass=$pws; $checkadmin = 0; $la_checkadmin = 0; if ($user_id!="" OR $pass!="") { $query = "SELECT * FROM member WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $checkadmin = 1; $username=$row->username; $pws=$row->pws; $query = "SELECT * FROM localadmin WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $la_checkadmin = 1; $lausername=$row->username; $lapws=$row->password; $lavalidcityid=$row->validcityid; $laid = $row->id; if($checkadmin == 1) { if (($username=="admin") and ($pass==$pws)) { $myauth = "admin"; $_SESSION['adminauth'] = "admin"; header("location: home.php?PHPSESSID=".session_id()); exit; } } elseif($la_checkadmin == 1) { if (($lausername==$user_id) and ($pass==$lapws)) { $myauth = "admin"; $_SESSION['adminauth'] = "localadmin"; $_SESSION['localadmin'] = "localadmin"; $_SESSION['localadmin_city'] = $lavalidcityid; $_SESSION['localadmin_id'] = $laid; $query = "INSERT INTO localadmin_monitor (adminid,action) values('$laid','<b>LOGIN</b>')"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); header("location: home.php?PHPSESSID=".session_id()); exit; } } else { $is_false="false"; } if ($is_false == "false") { ?> <body><p align=center><b><font face='arial' size='2' color='#FF0000'>Wrong User ID or Password <a href=<?php echo $_SERVER['PHP_SELF']; ?>> Go Back </a> and login again.</font></b></p> <div align="center"> <center> <table border="0" width="780" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <p align="center"><img border="0" src="../images/EC-30.gif" width="291" height="59"><br> </td> </tr> <tr> <td width="100%" bgcolor="#686868" height="10"></td> </tr> <tr> <td width="100%" bgcolor="#D09850" height="21"> <p align="center"><b><font size="2" face="Verdana" color="#FFFFFF">Coordinator Login</font></b></td> </tr> <tr> <td width="100%"> <br> <br> <br> <br> <br> </td> </tr> <tr> <td width="100%"> <form method="POST" action="index.php"> <center> <table align="center"> <tr> <td align="right"><p><b><font color="#000000" face="Verdana" size="2">Username:</font></b></p></td> <td><input type="text" name="username" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td align="right"><p><b><font color="#000000" size="2" face="Verdana">Password:</font></b></p></td> <td><input type="password" name="pws" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td colspan="2"> <p align="center"><INPUT TYPE="image" SRC="../images/submit.jpg" BORDER=0 ALT=""> </p> </td> </tr> </table> </center> </form> </td> </tr> <tr> <td width="100%"></td> </tr> </table> </center> <!--/div--> </body>" </html> <?php } ?>
  3. Thanks for your reply, but neither the link nor the second part of your quote makes sense to me. If you were a complete non-HTML programming newbie, would it make sense to you? I'm not looking to become a programmer and then solve the problem, which probably is just a keystroke or two. I'm looking for help from someone who has the expertise to indicate those keystrokes or other solution.
  4. Ok, I understand now. Thanks. Now could you please help me solve the issue at hand?
  5. Would it be faster and less time consuming for those knowledgeable here to kindly paste the correct coding that I can just copy, paste and upload? Thanks, and sorry I'm so clueless about PHP.
  6. Hi, thanks for your reply. I read it 3 times but still have no idea what it means. As I mentioned earlier, all I know is HTML. The PHP coding above was done by a programmer many years ago and I only just opened it.
  7. Thanks for your reply. I actually only just learned a bit of HTML and have zero knowledge of PHP. The code was done by someone else and I only just opened it. I inserted your edit into the code as below: <script language=php> session_start(); session_register("myauth"); include ("../connection.php"); $user_id=$username; $pass=$pws; $checkadmin = 0; $la_checkadmin = 0; if ($user_id!="" OR $pass!="") { $query = "SELECT * FROM member WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $checkadmin = 1; $username=$row->username; $pws=$row->pws; $query = "SELECT * FROM localadmin WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $la_checkadmin = 1; $lausername=$row->username; $lapws=$row->password; $lavalidcityid=$row->validcityid; $laid = $row->id; if($checkadmin == 1) { if (($username=="admin") and ($pass==$pws)) { $myauth = "admin"; $_SESSION['adminauth'] = "admin"; header("location: home.php?PHPSESSID=".session_id()); exit; } } elseif($la_checkadmin == 1) { if (($lausername==$user_id) and ($pass==$lapws)) { $myauth = "admin"; $_SESSION['adminauth'] = "localadmin"; $_SESSION['localadmin'] = "localadmin"; $_SESSION['localadmin_city'] = $lavalidcityid; $_SESSION['localadmin_id'] = $laid; $query = "INSERT INTO localadmin_monitor (adminid,action) values('$laid','<b>LOGIN</b>')"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); header("location: home.php?PHPSESSID=".session_id()); exit; } } else { $is_false="false"; } if ($is_false == "false") { ?> <body><p align=center><b><font face='arial' size='2' color='#FF0000'>Wrong User ID or Password <a href=<?php echo $_SERVER['PHP_SELF']; ?>> Go Back </a> and login again.</font></b></p> <div align="center"> <center> <table border="0" width="780" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <p align="center"><img border="0" src="../images/EC-30.gif" width="291" height="59"><br> </td> </tr> <tr> <td width="100%" bgcolor="#686868" height="10"></td> </tr> <tr> <td width="100%" bgcolor="#D09850" height="21"> <p align="center"><b><font size="2" face="Verdana" color="#FFFFFF">Coordinator Login</font></b></td> </tr> <tr> <td width="100%"> <br> <br> <br> <br> <br> </td> </tr> <tr> <td width="100%"> <form method="POST" action="index.php"> <center> <table align="center"> <tr> <td align="right"><p><b><font color="#000000" face="Verdana" size="2">Username:</font></b></p></td> <td><input type="text" name="username" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td align="right"><p><b><font color="#000000" size="2" face="Verdana">Password:</font></b></p></td> <td><input type="password" name="pws" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td colspan="2"> <p align="center"><INPUT TYPE="image" SRC="../images/submit.jpg" BORDER=0 ALT=""> </p> </td> </tr> </table> </center> </form> </td> </tr> <tr> <td width="100%"></td> </tr> </table> </center> <!--/div--> </body>" </html> <script language=php> } </script> And am getting this error now: Parse error: syntax error, unexpected $end in /home/vg008web08/52/58/2915852/web/admin/index.php on line 133 I also played with various positions for the last line of your instructions above but they all returned error messages as well, all to my fault, of course. Any thoughts? Thanks.
  8. Hi, could someone kindly advise how the error message below can be resolved for the code further below? Thank you so much. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/web/admin/index.php on line 69 Line 69 is in red below. <script language=php> session_start(); session_register("myauth"); include ("../connection.php"); $user_id=$username; $pass=$pws; $checkadmin = 0; $la_checkadmin = 0; if ($user_id!="" OR $pass!="") { $query = "SELECT * FROM member WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $checkadmin = 1; $username=$row->username; $pws=$row->pws; $query = "SELECT * FROM localadmin WHERE username='$user_id'"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); $row=mysql_fetch_object($result); if($row->username."a" != "a" ) $la_checkadmin = 1; $lausername=$row->username; $lapws=$row->password; $lavalidcityid=$row->validcityid; $laid = $row->id; if($checkadmin == 1) { if (($username=="admin") and ($pass==$pws)) { $myauth = "admin"; $_SESSION['adminauth'] = "admin"; header("location: home.php?PHPSESSID=".session_id()); exit; } } elseif($la_checkadmin == 1) { if (($lausername==$user_id) and ($pass==$lapws)) { $myauth = "admin"; $_SESSION['adminauth'] = "localadmin"; $_SESSION['localadmin'] = "localadmin"; $_SESSION['localadmin_city'] = $lavalidcityid; $_SESSION['localadmin_id'] = $laid; $query = "INSERT INTO localadmin_monitor (adminid,action) values('$laid','<b>LOGIN</b>')"; if (!($result = mysql_query($query))) echo "$query".mysql_error(); header("location: home.php?PHPSESSID=".session_id()); exit; } } else { $is_false="false"; } if($is_false=="false") echo "<body><p align=center><b><font face='arial' size='2' color='#FF0000'>Wrong User ID or Password <a href='$PHP_SELF'> Go Back </a> and login again.</font></b></p> <div align="center"> <center> <table border="0" width="780" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <p align="center"><img border="0" src="../images/EC-30.gif" width="291" height="59"><br> </td> </tr> <tr> <td width="100%" bgcolor="#686868" height="10"></td> </tr> <tr> <td width="100%" bgcolor="#D09850" height="21"> <p align="center"><b><font size="2" face="Verdana" color="#FFFFFF">Coordinator Login</font></b></td> </tr> <tr> <td width="100%"> <br> <br> <br> <br> <br> </td> </tr> <tr> <td width="100%"> <form method="POST" action="index.php"> <center> <table align="center"> <tr> <td align="right"><p><b><font color="#000000" face="Verdana" size="2">Username:</font></b></p></td> <td><input type="text" name="username" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td align="right"><p><b><font color="#000000" size="2" face="Verdana">Password:</font></b></p></td> <td><input type="password" name="pws" size="15" style="font-family : Verdana;"></td> </tr> <tr> <td colspan="2"> <p align="center"><INPUT TYPE="image" SRC="../images/submit.jpg" BORDER=0 ALT=""> </p> </td> </tr> </table> </center> </form> </td> </tr> <tr> <td width="100%"></td> </tr> </table> </center> <!--/div--> </body>" </html> <script language=php> } </script>
×
×
  • 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.