I need urgent help for my order form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
boituron
Forum Newbie
Posts: 1
Joined: Sat Jul 02, 2011 12:07 am

I need urgent help for my order form

Post by boituron »

Hi i'm new here and with php and I want to ask for some help regarding my order form.

Here is my existing code.
Image

Basically what it does in the form is filled the item(text field) with the number of orders (1,2,3 etc.)
What I wanted to do is to have the "filled up" orders sent to me and not everything. So for example
the customer only filled the text field for food1, then its the only order that will be sent in my email.

Any help or suggestions will be highly appreciated. I'm also open if you know a better code than mine. Thanks!
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: I need urgent help for my order form

Post by califdon »

Does your form have these text fields in it? I don't see them where you are assigning the $_POST values to variables. If you have fields like "text1" and "text2" in your form, the only way you will know what the user filled in is to look for $_POST values like $_POST['text1'], etc.
Noodleyman
Forum Newbie
Posts: 23
Joined: Thu Jun 23, 2011 4:49 pm

Re: I need urgent help for my order form

Post by Noodleyman »

you just need to do some extra checking on the fields.

Something like this:

Code: Select all

IF (!empty($_POST['name'])){
    echo "This has some data, so will do something with it";
}ELSE{
    echo "this field had no data so exclude it";
}
rascle
Forum Newbie
Posts: 4
Joined: Tue Jul 05, 2011 1:42 pm

Re: I need urgent help for my order form

Post by rascle »

And in your case, rather than echoing something, you can just put the mail code there :)
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: I need urgent help for my order form

Post by califdon »

rascle wrote:And in your case, rather than echoing something, you can just put the mail code there :)
I believe he was echoing an acknowledgment to the browser screen.
Post Reply