Jump to content

User authentication script to connect a script onto a third party online server


devang23

Recommended Posts

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>

 

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

Archived

This topic is now archived and is closed to further replies.

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