View Single Post
Old 09-30-2012, 03:36 PM   PM User | #1
Sweden
New to the CF scene

 
Join Date: Aug 2012
Posts: 5
Thanks: 5
Thanked 0 Times in 0 Posts
Sweden is an unknown quantity at this point
MySQL database Log in script. Page keeps on loading

Hey there,

I've come across this problem when trying to create a log in script. I've installed easyPHP and everything has been working fine up until I place "localhost:8080" as the value to my variable $mysql_server. I changed the localhost to port 8080 priviosly and I've set up a database called user with the table userdata. As I said everything has been working fine and I've created scripts earlier like counters and stuff that has had no errors. Now when I type in the path (http://localhost:8080/web/delprov_inloggning/index.php) to my script the page just keeps on loading for ever.

Here is the script:

Quote:
<?php
$mysql_server = "localhost:8080";
$mysql_user = "Testperson";
$mysql_password = "soy2urf336";
$mysql_database = "user";

$conn = mysql_connect($mysql_server, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $conn);

function db_escape ($post)
{
if (is_string($post)) {
if (get_magic_quotes_gpc()) {
$post = stripslashes($post);
}
return mysql_real_escape_string($post);
}

foreach ($post as $key => $val) {
$post[$key] = db_escape($val);
}

return $post;
}
?>
Even if I try just localhost:8080/home it will just keep on loading now. When I remove the script and restart my computer everything works fine again..
Anyone out there that can help?
Sweden is offline   Reply With Quote