Hi!
I have ben working on a registration form with PHP. Simply the user registrates and the information will be sent to my (xampp) sql server. I made it work on my school computer but when i emailed them to my home computer suddenly they won’t work… It’s like the PHP and sql server isn’t connected anymore. I have placed my files in the htdocs folder same as I did on my school computer and everything is the same so have you guys had the same problem or something?
Here is my code.
[php]<?php
if(isset($_POST['fname']) &&
isset($_POST['lname']) &&
isset($_POST['uname']) && isset($_POST['password']) && isset($_POST)) {
$f = $_POST['fname'];
$l = $_POST['lname'];
$u = $_POST['uname'];
$pw = $_POST['password'];
$p = mysql_connect("localhost", "root", "");
mysql_select_db("proj", $p);
$r = mysql_query("insert into anvandare values (0,'$u','$pw','$f','$l')", $p);
mysql_close();
echo "Done!<br/>";
}
?>[/php]
And my sql
create database proj;
Create table anvandare (
aid int not null auto_increment primary key,
uname varchar(30) not null,
passwd varchar(30),
fname varchar(50),
lname varchar(50));
Thanks!