if(empty($_POST['txtEmail']))
{
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$page='SignUp.php';
header('Location:'.$page);
}
else
{
$page='SignUp.php?emptyusr=1';
header('Location:'.$page);
}
ElaineTeo 0 Newbie Poster
Recommended Answers
Jump to Postif(empty($_POST['txtEmail']))
I think you should make the first line to check as NOT EMPTY like this:-
if ($_POST['txtEmail'] != "")
Try and see... Please let me know if it didn't help. Thanks
Jump to PostAnd this Block of code should be in another PHP file called "Signup.php". Not over here...
if (isset($_REQUEST['emptyusr'])) { echo "<font color=red>Please fill in email</font>"; }
Please try and see if it helps....
Thanks
Jump to PostI do not understand why you run the query if the field is blank. What is the $sql query? Maybe you should negate the condition (if $_POST['txtEmail'] is not empty then...):
if(!empty($_POST['txtEmail']))
You actually have to tell what to achieve or maybe post the whole script.
All 11 Replies
broj1 356 Humble servant Featured Poster
jstfsklh211 79 Light Poster
ElaineTeo 0 Newbie Poster
ericnmk80 0 Newbie Poster
ericnmk80 0 Newbie Poster
ElaineTeo 0 Newbie Poster
broj1 356 Humble servant Featured Poster
ElaineTeo 0 Newbie Poster
broj1 356 Humble servant Featured Poster
broj1 356 Humble servant Featured Poster
ElaineTeo 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.