Jump to content

Unexpected '<' not even in a PHP code?


3raser

Recommended Posts

Parse error: syntax error, unexpected '<' in /home/a9558420/public_html/login.php on line 3

 

<?php session_start ?>
<link rel="stylesheet" type="text/css" href="style.css" /> 
<div align="center"><div class="box"><div align="left"><img src="Banner.png" border="0"><div class="line">Home | Start<div class="line"></div></div><br><br>

<?php

require ("settings.php");
$username = $_POST['username'];
$password = $_POST['password'];
$anti = $_POST['anti'];
$secret_password = md5($password);
$anti1 = "djksdfjiu44";
  
if (!$username || !$password)
   die (" <p align='left'><form action='register.php' method='POST'>
<b>Please note that special characters will be removed upon registering.</b><br /><br />
* Username: <input type='text' name='username' maxlength='13'><br /><br />
* Anti-spam verification: <input type='text' name='anti'><br>//The code is $anti1//<br /><br />
* Password: <input type='password' name='password' maxlength='25'></div><br /><br />
<input type='submit' value='Register'>
</form></p>");

if (!$anti)
   die ("You didn't enter in the anti-spam verification code!");

if ($anti==$anti1) {

if (strlen($password)<=3) {
        echo "Password must be more then 3 characters long! <a href='register.php'> << Back </a>";
}
else
{

if (strlen($username)<=3) {
        echo "Username must be more then 3 characters long! <a href='register.php'> << Back </a>";
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];

//protection
$before = array('(', ')', '^', '<', '>', '`', '*', '<script>', '</script>', ';DROP TABLE users;', 'users', 'DROP', 'TABLE');
$after   = array('', '', '', '', '', '', '', '', '', '', '', '', '');
$output  = str_replace($before, $after, $username);

//protection
$display_name_output = str_replace($before, $after, $dname);

//protection
$output4  = str_replace($before, $after, $email);

//protection
$output2  = str_replace($before, $after, $signature);

$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");

$query = mysql_query("SELECT * FROM users WHERE username='$output'");

$numrows = mysql_num_rows($query);

if ($numrows!=0) {
   echo "This username already exists!";
}
else
{

//write
$write = mysql_query("INSERT INTO users (id, username, password, frpcash, premium, ip) VALUES ('', '$output', '$secret_password', '10', '0', '$ip')") or die(mysql_error());

echo "<div class='box'>Thank you for registering ". $output ."! Login <a href='login.php'>here</a>!</div>";
}
}
}
} else {
echo "You entered the incorrect anti-spam verification code!";
}
?></div><br><br><Br><br><img src="1.png" border="0"></img></div></div>

Link to comment
https://forums.phpfreaks.com/topic/194181-unexpected/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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