| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | small php question Hello, I am not exactly a php expert, and this is probably a very simple thing to do. I am using http://formtoemail.com for a simple php form script on my website. I am using it to submit an order form. (not secure; no payment transaction) The question is, how can I prevent items with a value of "val0" from being sent in the form? Basically, that just means the customer doesn't want it, so, there's no need to have that sent in the email. Since there's a pretty long list of products (about 25), it can be tiresome to look for the items with values of "val2" "val3" etc. (I need to use the "val" prefix, rather than a number). ????: NamePros.com http://www.namepros.com/programming/402479-small-php-question.html You can view it online over here: http://www.rukiscookies.com/order.php Thanks!
__________________ www.headlinercreative.com |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | Sure! Here: PHP Code:
__________________ www.headlinercreative.com |
| |
| | #4 (permalink) |
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,615
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I have not read your script, but i think the solution is PHP Code:
__________________ |
| |
| | THREAD STARTER #5 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | I'm not sure Iknow what you mean, but it sounds like you would have me write out a special snippet of code for each form field... I would rather have a universal line of code that basically says, "if any form field has a value of "val0" do not bother writing out that information. We really don't care." ![]() Any other ideas?
__________________ www.headlinercreative.com |
| |
| | #6 (permalink) |
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,615
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | First, name your first checkbox with cb01, 2nd checkbox with cb02, ... (your checkboxes do not have name) now modify the build_message() section PHP Code:
__________________ |
| |
| | THREAD STARTER #7 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | the checkboxes are not being sent as part of the data, and are really only used to make the form easier to use, from the user's perspective. Checking a checkbox just sets the quantity to "1" in the select box, but the information that is emailed is only from the select box; not the checkbox. I don't know if any of this is making sense, so I will try to explain what I need, again: I would like to make some sort of declaration in the php that for any field with a value of "val0" do not email any information about that field. Not the name, and not the value. Thanks!
__________________ www.headlinercreative.com |
| |
| | THREAD STARTER #8 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Florida
Posts: 233
![]() | solved! simple solution (isn't it always?): instead of having the "0" value be "val0", I just left it blank... (thought I needed it there)
__________________ www.headlinercreative.com |
| |
| | #9 (permalink) | ||||
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,615
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ | ||||
| |