0

Hello i am creating a small forum and having trouble with the user sign up form.

i have the start of a sign up form on the index page then that jumps to the sign up page with more info, e.g...

index.php

<form action="signup.php" method="post">
name:
<input type="text" name="name" >
email:
<input type="text" name="email" >
<input type="submit">
</form>

signup.php

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
?>
<form action="signup.php" method="post">
name:
<input type="text" name="name" value="<?php echo $name ?>" >
email:
<input type="text" name="email" value="<?php echo $email ?>" >
confirm email:
<input type="text" name="email2" >
password:
<input type="password" name="pass" >
<input type="hidden" name="flag" value=1>
<input type="submit">
</form>
<?php 
if (isset($_POST['flag']))
{
$name = $_POST['name'];
if ($name == '')
{
  echo "<script>javascript: NoName();</script>"
}
}
?>

and so on.

how would i get past this error as name does hold some info it holds the <?php echo $name ?>

but when i try to do

if ($name == '<?php echo $name ?>')
{
    //do error
}
if ($name != '<?php echo $name ?>')
{
    //carry on as normal and check rest
}

nothing happens i get no errors... what can i use??

Edited by nats01282: not the actual code but a example of whats happening.... and made a spelling mistake

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by nats01282
0

fixed it all i used was

if ($name == '' || $name == '<?php echo $firstname ?>')
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.