473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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?
Jul 17 '05 #1
2 1742
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: GazK | last post by:
I have an image viewing page which resizes an image to a sensible sizebefore displaying. The user should then be able to choose "25% larger" or smaller and the resized image display. The problem I...
11
by: Adrian Parker | last post by:
Is it possible to click on a button, and not have it's value and name stored in _POST? I have this script with a button on it. When you click the button, the page posts to itself. The first...
15
by: zorro | last post by:
greetings... I'm wondering what more advanced coders would think ot this: $_POST = clean($_POST); and now I can use POST directly: $sql= "select * from T1 where myvar='$_POST' " ;
12
by: Jerim79 | last post by:
I have created a verification script to verify information and redirect the customer to the appropriate error page. For example: if ($FName=""){ header('Location:/verify_fname.htm'); } else{...
5
by: comp.lang.php | last post by:
// NEW 11/27/2006: FINALLY, IF YOU ADDED OR DELETED OR DID ANY KIND OF FORM ACTION SUCCESSFULLY, DON'T RE-DISPLAY THE NEW EXPENSE ITEMS VIA $_POST if ($_POST && (!is_array($leaseObj->errorArray)...
17
by: john | last post by:
All: I'm a long-time developer, new to PHP.... Is there an idiom used in PHP to construct SQL statments from $_POST data? I would guess that in many applications, the data read from $_POST...
12
by: Todd Michels | last post by:
Hi all, I am trying to send data from a form and insert it into a MSSQL DB. When I submit the data I get: Warning: mssql_query() : message: The name "Todd" is not permitted in this context....
7
by: amygdala | last post by:
Hi all, I'm starting this new project in which I'ld like to implement sort of a design pattern I have seen being used in the CodeIgniter framework. Basically, the site will examine the URI and...
5
Tarantulus
by: Tarantulus | last post by:
Hi, ok, quick description of the problem, I'm trying to reference the postdata from some checkboxes. Unfortunately the checkboxes are dynamically generated therefore I don't know how many there...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.