Junior Spellweaver
- Joined
- Mar 22, 2008
- Messages
- 145
- Reaction score
- 13
Hi, Im adding a hyperlink to a php code but its showing a error, I wanna see if you guys can help me.
Original Code:
I try to add this:
But i get this error:
Original Code:
<?php
ob_start();
if($in["username"]){
echo '<center><u><a
href="user.php?user='.$in["username"].'">'.$in["username"].'</a></u>
<br>
<a href="editprofile.php">Edit Profile</a> | <a href="editpassword.php">Edit
Password</a><br>
<a href="editemail.php">Edit E-Mail</a><br>
<a href="pm.php">Private Messages (<strong>'.$in["messages"].'</strong>)<br>
'; if($in["rank"] == 'Administrator'){ echo '<a href="admincp.php">Admin
CP</a><br>'; } echo '
<strong><a
href="javascript:logOut(\''.$in["username"].'\');">Logout</a></strong></center>';
}else{
if($_POST[login]){
$error='';
$username = strip_tags($_POST['username']);
$password = md5(strip_tags($_POST['password']));
$ip = $_SERVER['REMOTE_ADDR'];
if(!$username || !$password){
$error.= 'All fields are requred.<br>';
}else{
$check = mysql_query("SELECT * FROM users WHERE `username` =
'$username'");
if(mysql_num_rows($check) == 0){
$error.= 'The user <strong>'.$username.'</strong> does not
exist.<br>';
}else{
$r = mysql_fetch_array($check);
if($r["banned"] == '1'){
$error.= 'You are currently banned, you can not log
in.<br>';
}else{
if($r["password"] !== $password){
$error.= 'The password you entered is
incorrect.<br>';
}else{
setcookie("id", $r["id"],
time()+(60*60*60*24*5));
setcookie("password", $r["password"],
time()+(60*60*60*24*5));
setcookie("sec", md5($ip),
time()+(60*60*60*24*5));
mysql_query("UPDATE `users` SET `ip` = '$ip'
WHERE `username` = '$username'");
header("Location: index.php");
}
}
}
}
}
if($error){
echo $error;
}
echo '<form method="post">
<input type="text" class="custom" name="username" value="username..." />
<input type="password" class="custom" name="password" value="password" />
<a href="register.php">Register</a> | <a href="forgotpass.php">Forgot
Password?</a>
<input type="submit" class="buttom" value="login" name="login" style="float:
right" />
</form>';
}
?>
ob_start();
if($in["username"]){
echo '<center><u><a
href="user.php?user='.$in["username"].'">'.$in["username"].'</a></u>
<br>
<a href="editprofile.php">Edit Profile</a> | <a href="editpassword.php">Edit
Password</a><br>
<a href="editemail.php">Edit E-Mail</a><br>
<a href="pm.php">Private Messages (<strong>'.$in["messages"].'</strong>)<br>
'; if($in["rank"] == 'Administrator'){ echo '<a href="admincp.php">Admin
CP</a><br>'; } echo '
<strong><a
href="javascript:logOut(\''.$in["username"].'\');">Logout</a></strong></center>';
}else{
if($_POST[login]){
$error='';
$username = strip_tags($_POST['username']);
$password = md5(strip_tags($_POST['password']));
$ip = $_SERVER['REMOTE_ADDR'];
if(!$username || !$password){
$error.= 'All fields are requred.<br>';
}else{
$check = mysql_query("SELECT * FROM users WHERE `username` =
'$username'");
if(mysql_num_rows($check) == 0){
$error.= 'The user <strong>'.$username.'</strong> does not
exist.<br>';
}else{
$r = mysql_fetch_array($check);
if($r["banned"] == '1'){
$error.= 'You are currently banned, you can not log
in.<br>';
}else{
if($r["password"] !== $password){
$error.= 'The password you entered is
incorrect.<br>';
}else{
setcookie("id", $r["id"],
time()+(60*60*60*24*5));
setcookie("password", $r["password"],
time()+(60*60*60*24*5));
setcookie("sec", md5($ip),
time()+(60*60*60*24*5));
mysql_query("UPDATE `users` SET `ip` = '$ip'
WHERE `username` = '$username'");
header("Location: index.php");
}
}
}
}
}
if($error){
echo $error;
}
echo '<form method="post">
<input type="text" class="custom" name="username" value="username..." />
<input type="password" class="custom" name="password" value="password" />
<a href="register.php">Register</a> | <a href="forgotpass.php">Forgot
Password?</a>
<input type="submit" class="buttom" value="login" name="login" style="float:
right" />
</form>';
}
?>
I try to add this:
<a href="javascript:ajaxpage('/content/jobs.php', 'contentmid');"> Job Openings </a>
But i get this error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in D:\xampp\htdocs\usersystem.php on line 48