3raser Posted March 4, 2010 Share Posted March 4, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/ Share on other sites More sharing options...
inspireddesign Posted March 4, 2010 Share Posted March 4, 2010 Try completing your session_start. You left out the (); <?php session_start(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021661 Share on other sites More sharing options...
3raser Posted March 4, 2010 Author Share Posted March 4, 2010 Fixed the session thing, but I still get the error. Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021688 Share on other sites More sharing options...
teamatomic Posted March 4, 2010 Share Posted March 4, 2010 The error about an unexpected < is a php error yet from what you show that block of the page is not within php. Is login.php stand alone or do you include it in some other controller page? HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021713 Share on other sites More sharing options...
3raser Posted March 4, 2010 Author Share Posted March 4, 2010 It's just login.php....nothing else. Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021721 Share on other sites More sharing options...
teamatomic Posted March 5, 2010 Share Posted March 5, 2010 Paste the complete login.php file HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021722 Share on other sites More sharing options...
Andy-H Posted March 5, 2010 Share Posted March 5, 2010 Parse error: syntax error, unexpected '<' in /home/a9558420/public_html/login.php on line 3 <?php session_start(); /*no whitespace before opening php tag...*/ ?> See if that works mate... Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021724 Share on other sites More sharing options...
3raser Posted March 5, 2010 Author Share Posted March 5, 2010 Edit: Got it working Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021728 Share on other sites More sharing options...
Andy-H Posted March 5, 2010 Share Posted March 5, 2010 Any chance you could post the solution m8, will benefit people with the same problem in the future as they can just use the search function Quote Link to comment https://forums.phpfreaks.com/topic/194181-unexpected/#findComment-1021731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.