Jump to content

What's wrong with this code?


Molarmite

Recommended Posts

There are no such constants as yes and no. Should be...

 

<?php

  if (action == 'signup') {
    if ($psword == $ConfirmPassword) {
      $passdun = "yes";
    } else {
      echo "Passwords do not match";
      $passdun = "no";
    }
  }

?>

 

Or better still, use booleans.

 

<?php

  if (action == 'signup') {
    if ($psword == $ConfirmPassword) {
      $passdun = true;
    } else {
      echo "Passwords do not match";
      $passdun = false;
    }
  }

?>

There's something wrong and I have a feeling it's bigger than what you suggested.  Here's more of the code.

 

        <input type="submit" value="Register">
      </form>
  <php? if (action == 'signup'){?><? if ($psword == $ConfirmPassword){$passdun = true; }else{ echo"Passwords do not match<br>"; $passdun = false;}
  if ($Email == $conEmail){ 
  $emaildun = yes;}else{
  echo"Email Address's dont match<br>"; 
  $emaildun = no;}
  if (($passdun == 'yes') && ($emaildun == 'yes')){$insert_user = mysql_query("INSERT INTO `World Of Darkness` ( `ID` , `Password` , `Email` , `HP` , `Mana` , `Gold` ) 

 

When upload it to my site and view it, the top of half of the code (which isnt posted here) works just fine, but after my register button, it says this part of the code

 

"; $passdun = false;} if ($Email == $conEmail){ $emaildun = yes;}else{ echo"Email Address's dont match

"; $emaildun = no;} if (($passdun == 'yes') && ($emaildun == 'yes')){$insert_user = mysql_query("INSERT INTO `World Of Darkness` ( `ID` , `Password` , `Email` , `HP` , `Mana` , `Gold` ) VALUES ( '', '$password', '$Email', '', '0, '' ) "); echo"thank you";}else{ echo"im sorry but there were some problems";}}?>

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.