If statements and $_POST[] function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fire Juggler

    If statements and $_POST[] function

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

    how would i do this using the $_POST function?


  • Erwin Moller

    #2
    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== "")))&&($enquir y==""))
    > {$error3="<font face=\"Arial\" color=\"#FF0000 \"><strong>Name , at least
    > {one
    > set of contact details, and enquiries are required:</strong></font><br>";
    > include("enquir ies.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("enquir ies.php");}
    > else
    > {
    > if ((($name!="")&& (($userEmail!=" ")||($address!= "")))&&($enquir y==""))
    > {$error3="<font face=\"Arial\" color=\"#FF0000 \"><strong>N o enquiries were
    > entered. Please enter an enquiry before continuing.</strong></font><br>";
    > include("enquir ies.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="Ireciev e.php" in the formtag) will receive the
    information entered in the form that was posted.

    So what is your question excactly?

    Regards,
    Erwin Moller

    Comment

    • Tex John

      #3
      Re: If statements and $_POST[] function


      "Fire Juggler" <firejuggler@fi rejugglers.34sp .com> wrote in message
      news:d1ug7g$i8o $1@newsg1.svr.p ol.co.uk...[color=blue]
      > I have a form in one file, then in another file i have
      > if ((($name=="")|| (($userEmail==" ")&&($address== "")))&&($enquir y==""))
      > {$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("enquir ies.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("enquir ies.php");}
      > else
      > {
      > if ((($name!="")&& (($userEmail!=" ")||($address!= "")))&&($enquir y==""))
      > {$error3="<font face=\"Arial\" color=\"#FF0000 \"><strong>N o enquiries were
      > entered. Please enter an enquiry before continuing.</strong></font><br>";
      > include("enquir ies.php");
      > }
      >
      > how would i do this using the $_POST function?
      >
      >[/color]

      if
      ((($_POST["name"]=="")||(($_PO ST["userEmail"]=="")&&($_POS T["address"]==""))
      )&&($_POST["enquiry"]==""))



      hth,
      John T. Jarrett
      in Houston


      Comment

      Working...