Page 1 of 1

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

Posted: Fri Feb 29, 2008 8:46 pm
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?

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

Posted: Sat Mar 01, 2008 10:03 am
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

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

Posted: Sat Mar 01, 2008 1:50 pm
by Jonah Bron
Is there the text "Error" on the page? Also, this looks like a wonderful opportunity to use the switch statement... :D

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

Posted: Sat Mar 01, 2008 5:33 pm
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.

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

Posted: Sun Mar 02, 2008 6:42 pm
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.

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

Posted: Sun Mar 02, 2008 7:08 pm
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