Kev0121 Posted December 12, 2008 Share Posted December 12, 2008 Well basically it displays the code in the browser insted of like doing what its ment to do if that makes sense? Im using wamp and VS and php editor <?php $host = 'localhost'; $user = 'root'; $pass = ''; $db = 'website'; $c = @mysql_connect('$host', '$user', '$pass') or die("Error Connecting To Host." . mysql_error()); @mysql_select_db('$db') or die("Error Connecting To Database." . mysql_error()); if(isset($_POST['username'])) { if(!$_POST['username'] || !$_POST['password']) { die (' Please make sure you fill out all of the required fields. '); } $user = mysql_real_escape_string($_POST['username']); $user = stripslashes($user); $pass = mysql_real_escape_string($_POST['password']); $pass = sha1($pass); if(strlen($user) < 4) { die (ucwords(' Please make sure that the username is 4 or more characters. ')); } if(strlen($pass) < 4) { die (ucwords(' Please make sure that the password is 4 or more characters. ')); } $check = "SELECT * FROM `users` WHERE `username` = '$user'"; $sql = mysql_query($check); $row = mysql_num_rows($sql); if($row >= 4) { die (' Sorry but the username '.$user.' is already in use. '); } $ins = "INSERT INTO `users` (username, password) VALUES ('$user', '$pass')"; $q = mysql_query($ins); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/136742-displays-the-code-in-the-browser/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 12, 2008 Share Posted December 12, 2008 Does any php code work on your server? What is the file name the code is in? What is the URL you are entering in your browser? Quote Link to comment https://forums.phpfreaks.com/topic/136742-displays-the-code-in-the-browser/#findComment-714147 Share on other sites More sharing options...
Kev0121 Posted December 12, 2008 Author Share Posted December 12, 2008 Does any php code work on your server? What is the file name the code is in? What is the URL you are entering in your browser? Does it does work on my server, it works when i use phpDes and im entering the location of it, its called index.php also im using VS.PHP 2.5 Quote Link to comment https://forums.phpfreaks.com/topic/136742-displays-the-code-in-the-browser/#findComment-714193 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.