Connecting Tech Pros Worldwide Help | Site Map

If statements and $_POST[] function

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:15 PM
Fire Juggler
Guest
 
Posts: n/a
Default If statements and $_POST[] function

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?



  #2  
Old July 17th, 2005, 12:15 PM
Erwin Moller
Guest
 
Posts: n/a
Default Re: If statements and $_POST[] function

Fire Juggler wrote:
[color=blue]
> 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?[/color]

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
  #3  
Old July 17th, 2005, 12:16 PM
Tex John
Guest
 
Posts: n/a
Default Re: If statements and $_POST[] function


"Fire Juggler" <firejuggler@firejugglers.34sp.com> wrote in message
news:d1ug7g$i8o$1@newsg1.svr.pol.co.uk...[color=blue]
> 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[/color]
one[color=blue]
> 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[/color]
one[color=blue]
> 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?
>
>[/color]

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.