Could I please ask somebody to look through my code.
I am experiencing problems when trying to access my page, login.php.
Here is the error:
Parse error: syntax error, unexpected T_STRING in /home3/nrclan/public_html/Shout/login.php on line 30
Here is my code:
<?php
if(isset($_POST['submit'])){
$host="10.16.96.70";
$username="nrclan";
$password="79566ar9c7a5c";
$db_name="nrclan_shoutlogin";
$tbl_name="members";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
$row = mysql_fetch_assoc($result);
if($row['banned']==0){
session_register("myusername");
session_register("mypassword");
header("location:myprofile.php");
} else {
$banned = "You have been banned!";
}
} else {
$iuop="Incorrect username or password!";
}
}
?>
<html>
<head>
<title>Shout</title>
<style type="text/css">
body {
background-image:url('background.png');
color:white;
font-family:Arial;
padding:20px;
}
</style>
<style>
input, textarea{
border:#F0F0F0 1px solid;
background-color:transparent;
color:#FFF;
}
input form_button{
color:#FFF;
background:#000;
}
</style>
</head>
<body link="white" alink="white" vlink="white">
<font size="4.5">
<a href="index.php" style="text-decoration:none">Home</a> <a href="contact_us.php" style="text-decoration:none">Contact Us</a> <a href="register.php" style="text-decoration:none">Register</a> <a href="login.php" style="text-decoration:none">Login</a>
</font>
<br><br>
<hr>
<p><br><p>
<font size="4.5">
Login
<p><br><p>
By logging in, you can share questions and <br> answers with everyone around the world!<br><p><br>
<form action="<?=$PHP_SELF?>" method="post">
<table width="30%" border="0" id="table">
<tr>
<td width="40%"><font size="4.5">Username: </font></td>
<td width="70%"><input name="myusername" maxlength="20" type="text" id="myusername" /></td>
</tr>
<tr>
<td><font size="4.5">Password:</font></td>
<td><input name="mypassword" maxlength="20" type="password" id="mypassword" /></td>
</tr>
</table>
<br>
<input type="submit" name="submit" value="Login">
</font>
<p><br>
<font size="4.5">
<?
echo $banned;
echo $iuop;
?>
</font>
</body>
</html>
Thank you for your time.
Please help! Thank you!
Kind regards,
James Kent.

New Topic/Question
Reply
MultiQuote










|