Hello,
I'm making a login system in php.
In my registration form, after i press submit button, i do some checks for valid email adres, password safety, etc..
Now if for example the users email adres is not valid, i execute this:
die('Invalid e-mail address.');
This php code is located in a html. The problem is that all the html code after the DIE function does not display... So the table looks completely messed up.
Is there a way to jump out of php code, but still render the remaining html below the code?
Thank you.
Hopefully a simple php problem ( exit() function)
Moderator: General Moderators
Instead of die, use some conditionals:
Code: Select all
if (everything in forum is valid) {
// do registration
} else {
echo 'Invalid xxx';
}There are many ways. Post your code and we'll help.
Code: Select all
if($xyz == 'abc')
echo '<b>MY HTML</b>';
else
echo '<I>Nope</I>';- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US