problem with if condition
Posted: Sun Jan 18, 2004 11:54 am
Hi !
This is an extract of my php code :
if ($changecheck != "1")
{
if (!$login || !$passe)
{
echo 'You must enter your login and password.<br />'
.'Please go back and try again.';
exit;
} }
else
{
if (!$login || !$passe || !$npasse || !$npasse2)
{
echo 'You must enter all the fields.<br />'
.'Please go back and try again.';
exit;
}
if ($npasse !== $npasse2)
{
echo 'You have made a mistake while entering the passwords.<br />'
.'Please go back and try again.';
exit;
}
}
which is in the middle of an HTML code. The problem is that each time that the condition choosen by the web user arrives on an "exit", the rest of the HTML code isn't executed. Which command could I use instead of "exit" ? I've tried "break / continue", it doesn't work...
Who can help ?
This is an extract of my php code :
if ($changecheck != "1")
{
if (!$login || !$passe)
{
echo 'You must enter your login and password.<br />'
.'Please go back and try again.';
exit;
} }
else
{
if (!$login || !$passe || !$npasse || !$npasse2)
{
echo 'You must enter all the fields.<br />'
.'Please go back and try again.';
exit;
}
if ($npasse !== $npasse2)
{
echo 'You have made a mistake while entering the passwords.<br />'
.'Please go back and try again.';
exit;
}
}
which is in the middle of an HTML code. The problem is that each time that the condition choosen by the web user arrives on an "exit", the rest of the HTML code isn't executed. Which command could I use instead of "exit" ? I've tried "break / continue", it doesn't work...
Who can help ?