Jump to content

Help with IF Statement


jester626

Recommended Posts

Could someone have a look at this "IF" statement and give me some pointers on how I can go about making it work.

if ($POST_[username] = $row_checkregistration['username'] OR ($POST_[emailaddress] = $row_checkregistration['EmailAddress']))

If I remove everything after the "OR" clause, the code works fine so I know the problem is from the "OR" to the end somewhere.

Thanks

Jester
Link to comment
https://forums.phpfreaks.com/topic/28335-help-with-if-statement/
Share on other sites

You have many errors:
[list]
[*]The comparison operator is "==" not "=".
[*]The POST array is named $_POST, not $POST_
[*]All associative array indices should be quoted if they are strings
[*]You should be using the logical operator "||" instead of the word "OR"
[/list]

Try something like this:
[code]<?php
if ($_POST['username'] == $row_checkregistration['username'] || $_POST['emailaddress'] = $row_checkregistration['EmailAddress'])
?>[/code]

Ken

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.