Form Actions

Status
Not open for further replies.

warddr

New Member
Messages
1
Reaction score
0
Points
0
What's wrong with my code:

PHP:
<html>
<head>
<title>Angel - Maak een account aan</title>
<link rel="stylesheet" href="include/frames.css">
</head>
<body>
<?php
$form = '<H1>Maak een nieuw account aan:</H1><a href="index.php">Klik hier als u al een account hebt</a><br><form name="create" method="post" action"'.$_SERVER[PHP_SELF].'">gebruikersnaam:<br> <input type="text" name="user"> Gelieve dezelfde naam te gebruiken als op TribalWars<br> wachtwoord:<br> <input type="password" name="pass"><br>herhaal wachtwoord:<br> <input type="password" name="pass2"><br>Stam:<br> <input type="text" name="stam"> (Angel / Angel2 / Little Angel)<br><input type="submit" name="Submit" value="create"></form>';
if(!isset($user)) echo("NOT USER");
if(isset($user)){
if($pass != $pass2){
die('Uw controlewachtwoord klopte niet, probeer het opnieuw' . $form);
};
include("include/database.php");
mysql_query("INSERT INTO login SET user='$user',pass='$pass', stam='$stam',datum='$datum'") or die("Gebruikersnaam bestaat al <br>");
die('Account is aangemaakt, <a href="index.php">ga terug</a>');
};
echo $form;
?>
</body>
</html>

It works with every host, except here, I added this: if(!isset($user)) echo("NOT USER"); to check and User is always unset.
 
Last edited:

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Its not just $user, it should be $_POST['user']

Change $pass to $_POST['pass'] and $pass2 to $_POST['pass2']
 
Last edited:

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
I think they are called Super Globals right? They are there to make things safer i think.. i'm not sure... but kajasweb is right, you need to use $_POST, $_GET etc...
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Either that or add a extract($_REQUEST) to the top of your PHP pages. Not the best measure, but one that works for older scripts.
 
Status
Not open for further replies.
Top