drob2689 Posted May 21, 2009 Share Posted May 21, 2009 Im just starting out learning PHP. Im trying to build a form and submit it. I am adding 5 files: login.html login.php registration.html register.php memberspage.php ok, so the registration works and sends the data to mysql. however when i try to login, i get the message: Parse error: syntax error, unexpected T_STRING in /home/jeupcom/public_html/login.php on line 19 firstly, can someone interperet this error message for us here is the code with line 19 in bold. <?php //Database Information $dbhost = "localhost"; $dbname = "jeupcom_tip"; $dbuser = "jeupcom_david"; $dbpass = ""; //Connect to database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); session_start(); $username = $_POST[‘username’]; $password = md5($_POST[‘password’]); $query = “select * from users where username=’$username’ and password=’$password’”; $result = mysql_query($query); if (mysql_num_rows($result) != 1) { $error = “Bad Login”; include “login.html”; } else { $_SESSION[‘username’] = “$username”; include “memberspage.php”; } ?> thanks very much Link to comment https://forums.phpfreaks.com/topic/159045-solved-very-easy-form-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 You are apparently using a word processor or a Mac to attempt to write code with. You have "smart/curly" quotes on that line and some of the other later lines of code. You need to use a programming editor and use only " and ' for quotes. Link to comment https://forums.phpfreaks.com/topic/159045-solved-very-easy-form-question/#findComment-838725 Share on other sites More sharing options...
drob2689 Posted May 21, 2009 Author Share Posted May 21, 2009 thanks very much Link to comment https://forums.phpfreaks.com/topic/159045-solved-very-easy-form-question/#findComment-838728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.