Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

php form handling ? + mysql.

Codes here !

Moderators: macek, egami, gesf

php form handling ? + mysql.

Postby _Arno_ » Fri Mar 21, 2003 12:23 pm

can somebody tell me why my own server isnt getting the variable out of form.php : these are my codes .

form.php:
Code: Select all

<html>
<body>
<form method="post" action="userhandle.php" >
username:
<input type="text" name="username" size="10"><br>
password:
<input type="password" name="password" size="10"><br>
<input type="submit">
</form>
</body>
</html>




action handling : userhandle.php
Code: Select all
<?

include("inc/dbuser.inc");
$verbinding = mysql_connect ("$DB_HOST", "$DB_USER", "$DB_PASSWORD") or die ('I cannot connect to the database.');
$opdracht = "INSERT into $tablename VALUES ( '$username' , '$password' )";


mysql_db_Query ("Database", $opdracht, $verbinding);

?>



if somebody knew the answer i would be grateful :)
_Arno_
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Mar 21, 2003 12:19 pm

Postby Xerpher » Fri Mar 21, 2003 12:50 pm

Try this...

Code: Select all
<?
include("inc/dbuser.inc");
$verbinding = mysql_connect ("$DB_HOST", "$DB_USER", "$DB_PASSWORD") or die ('I cannot connect to the database.');
$opdracht = "INSERT into $tablename VALUES ( '".$_POST['username']."' , '".$_POST['password']."' )";
mysql_db_Query ("Database", $opdracht, $verbinding);
?>
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby _Arno_ » Fri Mar 21, 2003 3:16 pm

i love you! :) :) :) :) it works wheeeeeeeee Thank you!
_Arno_
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Mar 21, 2003 12:19 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.