4 email address's with one to send mail, How?

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
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

4 email address's with one to send mail, How?

Post by ashebrian »

Hi, i have something already done but its not going any further.

Firstly i want to click on a drop down menu to choose an option like my code: This code is assigned in processBookingMail.php:

Code: Select all

<?php
if(isset($_POST['frmRequest'])) {
 
    if ($_POST['mailbooking'] == '1') {
    header("Location: booking1Mail.php"); 
    }
    elseif ($_POST['mailbooking'] == '2') {
    header("Location: booking2Mail.php"); 
    }
    elseif ($_POST['mailbooking'] == '3') {
    header("Location: booking3Mail.php"); 
    }
    elseif ($_POST['mailbooking'] == '4') {
    header("Location: booking4Mail.php"); 
    }
    else { 
        die("Error"); 
    }
    exit;
}
?>
And booking.html:

Code: Select all

<form action="processBookingMail.php" method="post" enctype="multipart/form-data" onsubmit="return check(frmRequest)" name="frmRequest" id="frmRequest">
 
****with this inside the code******
<select name="mailbooking">
                  <option value="Choose job">Choose Salon &nbsp;&nbsp;</option>
                          <option value="1">job1</option>
                          <option value="2">job2</option>
                          <option value="3">job3</option>
                          <option value="4">job4</option>
                </select>
How ever i seem to be stuck, as i'm directed to processBookingMail.php it stays on that page and doesn't direct me to the other php pages as i want. the other php pages r mail pages and will direct me again to the success or error page after that.

Any hints?
User avatar
hawkenterprises
Forum Commoner
Posts: 54
Joined: Thu Feb 28, 2008 9:56 pm
Location: gresham,oregon
Contact:

Re: 4 email address's with one to send mail, How?

Post by hawkenterprises »

You didn't send us one of the more important parts what is this doing

onsubmit="return check(frmRequest)"


I bet your javascript does something goofy
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: 4 email address's with one to send mail, How?

Post by Jonah Bron »

Is there the text "Error" on the page? Also, this looks like a wonderful opportunity to use the switch statement... :D
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Re: 4 email address's with one to send mail, How?

Post by ashebrian »

The javascript is not that nb for this: it just validates the form by giving an alert window box for each each section needed to be edited.

The text error doesn't even come up. i persume this code just gives u a blank page if theres an error. but it doesn't bring me to the page i wanted after i clicked the correct option.
User avatar
hawkenterprises
Forum Commoner
Posts: 54
Joined: Thu Feb 28, 2008 9:56 pm
Location: gresham,oregon
Contact:

Re: 4 email address's with one to send mail, How?

Post by hawkenterprises »

from what I can tell, the code you posted is fine, without seeing more I really couldn't tell you. I haven't ran everything through a parse but I'm assuming you would of caught any parse errors.
ashebrian
Forum Contributor
Posts: 103
Joined: Sat Feb 02, 2008 8:01 pm

Re: 4 email address's with one to send mail, How?

Post by ashebrian »

No worries, i tried something different. Got rid of the process file and just used one mail.php file. from my first page i gave an option to choose a destination. From there the info goes straight to he choosen email address. easy option
Post Reply