Jump to content

hello! don't know PHP but need help :D


teanza

Recommended Posts

:P

 

hey guys-

 

i just finished a site, and need the submit button to send the information to different email addresses per the drop-down selection.  does anyone know where i can find this script?  i tried sites like hotscripts.com, but i am unsure i am even searching for the right thing!

 

thanks SO MUCH,

 

~tina~

Link to comment
Share on other sites

This question is very general

It will be better if you explain a little more

Anyway, this can be done in HTML

Just use a normal submit form

 

<form name="Form" method="POST" action="/handle/" id="main_form">
</form>

 

and then put a drop down list inside

 

<select name="combobox" size="1">
<option>Words</option>
<option>Words</option>
<option>Words</option>
<option>Words</option>
<option>Words</option>
<option>Words</option>
</select>

 

Then you use the email function

 

<?php


if(mail($Send_to, $Subject, $Message, "From: $Sender")){
print"<br><br><FONT style=\"font-size:26px\" color=\"#009300\" face=\"Arial\"><B>Sent to: $SendTo  ... Sender: $Sender</B></FONT>";
}else{
print"<br><br><FONT style=\"font-size:26px\" color=\"#FF0000\" face=\"Arial\"><B>Did not send to: $SendTo  ... Sender: $Sender</B></FONT>";
}

?>

Link to comment
Share on other sites

hey thanks guys.  what i need is per a dropbox selection (which is named "complexes"), the submission will go to an email based on the user's selection. here is the code i have that does not work.  it doesn't send the email or redirect the page, let alone send to multiple email addresses.

 

<?php

 

 

 

$EmailFrom = Trim(stripslashes($_POST['email']));

$EmailTo = "xxx@yahoo.com";

$Subject = "Message from contact form at xxx.com";

$FirstName = Trim(stripslashes($_POST['firstname']));

$LastName = Trim(stripslashes($_POST['lastname']));

$Email = Trim(stripslashes($_POST['email']));

 

$Phone = Trim(stripslashes($_POST['telephone']));

$Complexes = Trim(stripslashes($_POST['complexes']));

$Comment = Trim(stripslashes($_POST['additionalwords']));

 

 

$Body = "Hello. Someone has sent you a message from your website xxx.com";

$Body .= "\n";

$Body .= "firstname: ";

$Body .= $FirstName;

$Body .= "\n";

$Body .= "lastname: ";

$Body .= $LastName;

$Body .= "\n";

$Body .= "email: ";

$Body .= $Email;

$Body .= "\n";

$Body .= "telephone: ";

$Body .= $Phone;

$Body .= "\n";

$Body .= "complexes: ";

$Body .= $Complexes;

$Body .= "\n";

$Body .= "additionalwords: ";

$Body .= $Comment;

$Body .= "\n";

 

 

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

 

if ($success){

  print "<meta http-equiv=\"refresh\" content=\"0;URL=http://xxx/thankyou.html\">";

}

else{

  print "<meta http-equiv=\"refresh\" content=\"0;URL=http://xxx/error.html\">";

}

?>

 

any help is awesome!

 

~tina~

 

Link to comment
Share on other sites

hey guys some nice person made this for me and i modified it.  still doesn't work :( !

 

<?php

 

 

if(isset($_POST['email']))

 

 

switch ($_POST['to']) {

    case 0:

        $to = "xxx@xxx.com";

        $subject = "Website Inquiry: xxx";

        break;

    case 1:

        $to = "xxx@xxx";

        $subject = "Website Inquiry: xxx";

        break;

    case 2:

        $to = "xxx@xxx.com";

        $subject = "Website Inquiry: xxx";

        break;

case 3:

        $to = "xxx@xxx.com";

        $subject = "Website Inquiry: xxx";

        break;

}

$body = "*** " . $subject . " *** \n \n";

$body .= "Name: ";

$body .= $_REQUEST["firstname"] . " " . $_REQUEST["lastname"];

$body .= "\n \n";

$body .= "Phone Number: ";

$body .= $_REQUEST["telephone"];

$body .= "\n \n";

$body .= "Email Address: ";

$body .= $_REQUEST["email"];

$body .= "\n \n";

$body .= "Comments: \n \n";

$body .= $_REQUEST["additionalwords"];

$body .= "\n \n";

$body .= "Complexes: \n \n";

$body .= $_REQUEST["complexes"];

 

 

$msgError = "error.html";

 

$msgSuccess = "thankyou.html";

 

 

 

$header = "From: ". $_REQUEST["firstname"] . " " . $_REQUEST["lastname"] . " <" . $_REQUEST["email"] . ">\r\n";

 

if (mail($to, $subject, $body, $header)) {

 

  echo $msgSuccess;

} else {

   

  echo $msgError;

}

}

{

   

?>

 

thanx if anyone helps :D

 

~tina~

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.