Jump to content

PHP Form HELP


wiredweb

Recommended Posts

I am making a prescription refill form for a local vet clinic and there is a drop down menu to choose where the from will be sent but I never recieve the emails of the completed forms. I have tried several different things but nothing works. The form will work with a single email address though.

Here is the code. The form is at [a href=\"http://twinforksclinic.com/prescription.php\" target=\"_blank\"]http://twinforksclinic.com/prescription.php[/a].

<?php

$subject = "Prescription Refill for Twin Forks";
$clinic = $_REQUEST['clinic'];
$owner = $_REQUEST['owner'] ;
$owneremail = $_REQUEST['owneremail'];
$pet = $_REQUEST['pet'] ;
$weight = $_REQUEST['weight'] ;
$phone = $_REQUEST['phone'] ;
$qty1 = $_REQUEST["qty1"];
$heartworm = $_REQUEST['heartworm'];
$qty2 = $_REQUEST["qty2"];
$fleatick = $_REQUEST['fleatick'];
$qty3 = $_REQUEST["qty3"];
$revolution = $_REQUEST['revolution'];
$message = $_REQUEST['message'];

if($clinic == "Benkelman")
$email = "[email protected]";

if($clinic == "Wray")
$email = "[email protected]";

$message = "Sent From: $owner
Owner Email: $owneremail
Clinic: $clinic
Pet's Name: $pet
Pet's Weight: $weight
Owner's Phone: $phone
Heatworm Qty: $qty1
Heartworm: $heartworm
Flea/Ticky Qty: $qty2
K9: $fleatick
Revolution Qty: $qty3
Revolution: $revolution
Speacial Instructions: $message";
mail( $clinic, $subject, $message, "From: $email" );
header( "Location: [a href=\"http://www.twinforksclinic.com/thankyou.php"\" target=\"_blank\"]http://www.twinforksclinic.com/thankyou.php"[/a] );
?>

Thanks for your help in advance!
Link to comment
https://forums.phpfreaks.com/topic/12958-php-form-help/
Share on other sites

or you could do it the right way so you dont have to update your both php code and html everytime you add an email address.

add a value to your option

<select name="clinic" id="clinic">
<option value="[email protected]">Benkelman</option>
<option value="[email protected]">Wray</option>
</select>
Link to comment
https://forums.phpfreaks.com/topic/12958-php-form-help/#findComment-49865
Share on other sites

[!--quoteo(post=388274:date=Jun 26 2006, 07:46 PM:name=timmah22)--][div class=\'quotetop\']QUOTE(timmah22 @ Jun 26 2006, 07:46 PM) [snapback]388274[/snapback][/div][div class=\'quotemain\'][!--quotec--]
or you could do it the right way...
[/quote]
The obvious disadvantage to that is it exposes all the email addresses to email address searching bots. Helloooo SPAM.
Link to comment
https://forums.phpfreaks.com/topic/12958-php-form-help/#findComment-49870
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.