Hey guys i have been trying to hook up my site to use php code to make a members area, small forum, etc....I am getting hung up on accesing and inserting info to my databse. I included the code to tell me if the script worked, and, according to the script, it did. When i browse my databse it shows that there is a record, but there is no information present with it.
Well..here is the code im using
(btw...the info for username password is changed to ***by me, and i use third-party hosting, thats why my hostname is server-myqsl1)
<html>
<head>
<title>New user insert...</title>
</head>
<body>
<?php
$username = $_GET["username"];
$password = $_GET["password"];
$first_name = $_GET["first_name"];
$last_name = $_GET["last_name"];
$email = $_GET["email"];
$location = $_GET["location"];
$homepage = $_GET["homepage"];
$signature = $_GET["signature"];
mysql_connect ("server-mysql1", "*****", "*****");
$result = mysql_query("insert into nashuanitroclub.members (username, password, first_name, last_name, email, signature, location, homepage) values('$username', '$password', '$first_name', '$last_name', '$email', '$signature', '$location', '$homepage')");
if ($result) {
print "WORKED!!!";
}
else {
print "Failed!";
}
mysql_close();
?>
</body>
</html>
If you guys want to see the form that this code is used for..its attached.your form is POSTing and you ae using GET. change all your _GET to _POST and it should work.THANK YOU! it helped out...worked awesome....i appreciate it!
Well..here is the code im using
(btw...the info for username password is changed to ***by me, and i use third-party hosting, thats why my hostname is server-myqsl1)
<html>
<head>
<title>New user insert...</title>
</head>
<body>
<?php
$username = $_GET["username"];
$password = $_GET["password"];
$first_name = $_GET["first_name"];
$last_name = $_GET["last_name"];
$email = $_GET["email"];
$location = $_GET["location"];
$homepage = $_GET["homepage"];
$signature = $_GET["signature"];
mysql_connect ("server-mysql1", "*****", "*****");
$result = mysql_query("insert into nashuanitroclub.members (username, password, first_name, last_name, email, signature, location, homepage) values('$username', '$password', '$first_name', '$last_name', '$email', '$signature', '$location', '$homepage')");
if ($result) {
print "WORKED!!!";
}
else {
print "Failed!";
}
mysql_close();
?>
</body>
</html>
If you guys want to see the form that this code is used for..its attached.your form is POSTing and you ae using GET. change all your _GET to _POST and it should work.THANK YOU! it helped out...worked awesome....i appreciate it!