Jump to content

Recommended Posts

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);

}

?>

Link to comment
https://forums.phpfreaks.com/topic/136742-displays-the-code-in-the-browser/
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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