473,324 Members | 2,248 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,324 software developers and data experts.

Simple php form Help

Hello All. I'm a newbie in programming and I was wondering if I could get
some help from you.

I have a form with the following fields:
-------------------------------------------------
Name
Email
Age (option field) -> over 45 or under 45
Sex (option field) -> male or female
Comments:
-------------------------------------------------
I currently submit this form to Formmail.cgi (Im sure you're familiar with
it) and I get it in an email.

What I need to do is that IF:
- Age is Over 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Over 45 and sex is female then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is female then send "this" via email to the
<email> field and i want to receive an email with the results of the form.

Could you give me a hint on how to acomplish this using PHP?

Thank you very much!

Juan
Mar 22 '06 #1
4 1319
Please, read the documentation on forms

http://us2.php.net/manual/en/tutorial.forms.php

As a hint you will need to access elements of the $_POST array. Such as
$_POST['age'] and $_POST['sex'].

When I'm stuck, I use the following to show all the post data that has
been submitted
if( isset( $_POST ) && !empty( $_POST ) )
{
exit( "<pre>" . print_r( $_POST, true ) . "</pre>" );
}
else
{
exit( "POST is empty, submit a form" );
}

Mar 22 '06 #2
JDS
On Wed, 22 Mar 2006 13:53:52 -0500, Juan Antonio Villa wrote:
I currently submit this form to Formmail.cgi (Im sure you're familiar with
it) and I get it in an email.


Why are you so sure?

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Mar 22 '06 #3
JDS
On Wed, 22 Mar 2006 13:53:52 -0500, Juan Antonio Villa wrote:
Could you give me a hint on how to acomplish this using PHP?

Thank you very much!

Juan


Sorry, but this is too broad a question to answer here.

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Mar 22 '06 #4
Can't you just manage the if-then-else by yourself in php and then use
the mail() function???so easy so simple!

Mar 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steve | last post by:
Hi All! I wonder if anyone could help me with the underlying logic of a problem I have. At the moment my working pages run like so ---------------------------------------------------------...
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
2
by: not | last post by:
Hello All, I am trying to develop a relatively simple self-quiz form in javascript, but I'm having no luck getting it to work. What I am looking for is a script that allow the user to select...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
0
by: Tal Sharfi | last post by:
Hi everyone I recently had the need for StringGrid object same as the one that Delphi has. An object that helps show lists of other objects in a simple grid. I searched the news groups and...
4
by: bob lambert | last post by:
Help I am trying to deploy to another pc a vb.net std 2002 windows form application. I am confused. I created a project - windows form I built form, compiled and debugged. I created a...
4
by: Duncan | last post by:
Hi I'm learning c# 2.0 as I feel I need to be able to switch between vb & c#, I'm just starting with a few simple examples and I've come across a problem. I've got two forms ones an MDI parent &...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
8
by: flit | last post by:
Hello All, I am trying to get information from a form and send it to a python script without success.. Here is my objective: User enters data in form --form send variables to python script...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.