devang23 Posted December 4, 2009 Share Posted December 4, 2009 I want this information to go to a table in a online database from webhost.com Can somone help and tell me what im doing wrong??? <html><head><title>Adding a User </title></head> <body> <?php if( (!$firstname) or (!$lastname) or (!$username) or (!$password) ) { $form ="Please enter all new user details"; $form.="<form action=\"$PHP_SELF\""; $form.=" method=\"post\">First Name: "; $form.="<input type=\"text\" name=\firstname\""; $form.=" value=\"$firstname\"><br>Last Name: "; $form.="<input type=\"text\" name=\"lastname\""; $form.=" value=\"$lastname\"><br>UserName: "; $form.="<input type=\"text\" name=\"username\""; $form.=" value=\"$username\"><br>PassWord: "; $form.="<input type=\"text\" name=\"password\""; $form.=" value=\"$password\"><br>"; $form.="<input type=\"submit\" value=\"Submit\">"; $form.="</form>"; echo($form); } else { $conn = @mysql_connect("mysql4.000webhost.com") or die("Try Again Punk"); $db = @mysql_select_db("a3213677_snorre", $conn) or die("NOOPE") $sql = "intsert into users(first_name,last_name,user_name,password) values(\"$firstname\",\"$lastname\",\"$username\",password(\$password\") )"; $result = @mysql_query($sql,$conn) or die ("NOT EVEN") if($result) { echo("New User $username ADDED DUH!") ; } } ?> </body></html> Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/ Share on other sites More sharing options...
taquitosensei Posted December 4, 2009 Share Posted December 4, 2009 Remove the @'s and it should tell you what you're doing wrong. The @'s suppress the errors. I would say webhost.com probably uses a different port than the default MySQL port. Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/#findComment-971643 Share on other sites More sharing options...
devang23 Posted December 5, 2009 Author Share Posted December 5, 2009 Remove the @'s and it should tell you what you're doing wrong. The @'s suppress the errors. I would say webhost.com probably uses a different port than the default MySQL port. i removed the @s, well im sending the information to the mysql on the that database (webhost sever, webhost mysql) im new at this so i just wanted to have simple info setup in the tables i set up in sql Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/#findComment-971654 Share on other sites More sharing options...
Rommeo Posted December 5, 2009 Share Posted December 5, 2009 not "intsert " it's "insert" Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/#findComment-971659 Share on other sites More sharing options...
devang23 Posted December 5, 2009 Author Share Posted December 5, 2009 lol yea i fixed that and still didnt see a difference, im a little lost Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/#findComment-971663 Share on other sites More sharing options...
devang23 Posted December 5, 2009 Author Share Posted December 5, 2009 lol yea i fixed that and still didnt see a difference, im a little lost and for that "insert into" does the thing after it have to be the name of the data table Link to comment https://forums.phpfreaks.com/topic/184034-user-authentication-script-to-connect-a-script-onto-a-third-party-online-server/#findComment-971665 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.