By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

If statements and $_POST[] function

P: n/a
I have a form in one file, then in another file i have
if ((($name=="")||(($userEmail=="")&&($address==""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least one
set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if (($name=="")||(($userEmail=="")&&($address=="")))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least one
set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if ((($name!="")&&(($userEmail!="")||($address!=""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>No enquiries were
entered. Please enter an enquiry before continuing.</strong></font><br>";
include("enquiries.php");
}

how would i do this using the $_POST function?
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Fire Juggler wrote:
I have a form in one file, then in another file i have
if ((($name=="")||(($userEmail=="")&&($address==""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least
{one
set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if (($name=="")||(($userEmail=="")&&($address=="")))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least
{one
set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if ((($name!="")&&(($userEmail!="")||($address!=""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>No enquiries were
entered. Please enter an enquiry before continuing.</strong></font><br>";
include("enquiries.php");
}

how would i do this using the $_POST function?


Hi,

$_POST is NOT a function!
$_POST is a (super)global array.
This means that you can access its content anytime from anywhere.

$_POST will contain a hashed array, that is name/value pairs.

So if somebody has a file1.html with a form, the receiving script (the one
named in the action="Irecieve.php" in the formtag) will receive the
information entered in the form that was posted.

So what is your question excactly?

Regards,
Erwin Moller
Jul 17 '05 #2

P: n/a

"Fire Juggler" <fi*********@firejugglers.34sp.com> wrote in message
news:d1**********@newsg1.svr.pol.co.uk...
I have a form in one file, then in another file i have
if ((($name=="")||(($userEmail=="")&&($address==""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least one set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if (($name=="")||(($userEmail=="")&&($address=="")))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>Name, at least one set of contact details, and enquiries are required:</strong></font><br>";
include("enquiries.php");}
else
{
if ((($name!="")&&(($userEmail!="")||($address!=""))) &&($enquiry==""))
{$error3="<font face=\"Arial\" color=\"#FF0000\"><strong>No enquiries were
entered. Please enter an enquiry before continuing.</strong></font><br>";
include("enquiries.php");
}

how would i do this using the $_POST function?


if
((($_POST["name"]=="")||(($_POST["userEmail"]=="")&&($_POST["address"]==""))
)&&($_POST["enquiry"]==""))

http://us4.php.net/manual/en/languag...s.external.php

hth,
John T. Jarrett
in Houston
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.