Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 684353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:48:27+00:00 2026-05-14T01:48:27+00:00

I have this form. Basically what I want is to send a auto-response with

  • 0

I have this form. Basically what I want is to send a auto-response with a different URL based on what the user picks in the “attn” picklist. I’ve been thinking I could have a different variable for each drop down value. It will then pass this variable on to the mail script that will choose which URL to insert inside the auto response that is sent. It gives me a headache thinking about it sometimes. What’s the easiest way to accomplish this?

Am I making more work for myself? I really don’t know because I’m no programmer. Thanks in advance!

Here is the form:

<form name="contact_form" method="post" action="sendemail_reports.php" onsubmit="return validate_form ( );">
      <div id='zohoWebToLead' align=center>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="txt_body">
      <table border=0 cellspacing=0 cellpadding=5 width=480 style='border-bottom-color: #999999; border-top-color: #999999; border-bottom-style: none; border-top-style: none; border-bottom-width: 1px; border-top-width: 2px; background-color:transparent;'>
        <tr>
          <td width='75%'><table width=480 border=0 cellpadding=5 cellspacing=0 style='border-bottom-color: #999999; border-top-color: #999999; border-bottom-style: none; border-top-style: none; border-bottom-width: 1px; border-top-width: 2px; background-color:transparent;'>
            <input type="hidden" name="ip" value="'.$ipi.'" />
            <input type="hidden" name="httpref" value="'.$httprefi.'" />
            <input type="hidden" name="httpagent" value="'.$httpagenti.'" />
            <tr></tr>
            <tr>
              <td colspan='2' align='left' style='border-bottom-color: #dadada; border-bottom-style: none; border-bottom-width: 2px; color:#000000; font-family:sans-serif; font-size:14px;'><strong>Send us an Email</strong></td>
            </tr>
            <tr>
              <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> First Name   : </td>
              <td width='75%'><input name='visitorf' type='text' size="48" maxlength='40' /></td>
            </tr>
            <tr>
              <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Last Name   :</td>
              <td width='75%'><input name='visitorfl' type='text' size="48" maxlength='80' /></td>
            </tr>
            <tr>
              <td nowrap style=
        'font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Email Adress  : </td>
              <td width='75%'><input name='visitormail' type='text' size="48" maxlength='100' /></td>
            </tr>
            <tr>
              <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Phone   : </td>
              <td width='75%'><input name='visitorphone' type='text' size="48" maxlength='30' /></td>
            </tr>
            <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Subject   : </td>
              <td width='75%'><select name="attn" size="1">
                <option value=" Investment Opportunities ">Investment Opportunities </option>
                <option value=" Vacation Rentals ">Vacation Rentals </option>
                <option value=" Real Estate Offerings ">Real Estate Offerings </option>
                <option value=" Gatherings ">Gatherings </option>
                <option value=" General ">General </option>
              </select></td>
            <tr>
              <td nowrap style=
        'font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Message   :<br />
                <em>(max 5000 char)</em></td>
              <td width='75%'><textarea name='notes' maxlength='5000' cols="48" rows="3"></textarea></td>
            </tr>
            <tr>
              <td colspan=2 align=center style=''><input name='save' type='submit' class="boton" value=Send mail />
                &nbsp; &nbsp;
                <input type='reset' name='reset' value=Reset class="boton" /></td>
            </tr>
          </table></td>
        </tr>
      </table>
      </div>
    </form>

Here is the mail script:

    <?php
//the 3 variables below were changed to use the SERVER variable  
$ip = $_SERVER['REMOTE_ADDR'];  
$httpref = $_SERVER['HTTP_REFERER'];   
$httpagent = $_SERVER['HTTP_USER_AGENT'];   

$visitorf = $_POST['visitorf'];   
$visitorl = $_POST['visitorl'];   
$visitormail = $_POST['visitormail'];   
$visitorphone = $_POST['visitorphone'];   
$notes = $_POST['notes'];  
$attn = $_POST['attn'];   

//additional headers   
$headers = 'From: Me <myemail@domain.com>' . "\n" ;  
$headers = 'Bcc: myemail@domain.com' . "\n";  


if (eregi('http:', $notes)) {
    die ("Do NOT try that! ! ");
}

if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))  
{  
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";  
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";  
    echo $badinput;  
    die ("Go back! ! ");  
}  

if(empty($visitorf) || empty($visitormail) || empty($notes )) {  
    echo "<h2>Use Back - fill in all fields</h2>\n";  
    die ("Use back! ! ");  
}  

$todayis = date("l, F j, Y, g:i a") ;  
$subject = "I want to download the report about $attn";  
$notes = stripcslashes($notes);  
$message = "$todayis [EST] \nAttention: $attn \nMessage: $notes \nFrom: $visitorf   $visitorl ($visitormail) \nTelephone Number: $visitorphone \nAdditional Info : IP = $ip   \nBrowser Info: $httpagent \nReferral : $httpref\n";  

//check if the function even exists  
if(function_exists("mail"))  
{  
    //send the email  
    mail($_SESSION['email'], $subject, $message, $headers) or die("could not send   email");  
} else {  
    die("mail function not enabled");  
}  

header( "Location: http://www.domain.com/thanks.php" );  
?>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:48:27+00:00Added an answer on May 14, 2026 at 1:48 am

    I’m not entirely sure I understood your request correctly.
    Let me get this straight: You want to write a certain url in the mail based on what the user picked from the dropdown menu?
    If so, I would use something like this:

    $lookup = array(
        'Investment Opportunities' => 'http://someurl.com/',
        'Vacation Rentals' => 'http://someotherurl.com/',
        // et cetera for your other values
    );
    
    $attn = trim($_POST['attn']);
    $url = $lookup[$attn];
    

    After this, you can use $url in your mail and it will be different, based on the dropdown value provided by the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: form = $('#<%= params[:board_id] %>'); var $parent = form.closest(.biscuit).eq(0); I want
I basically want to autodetect a user's timezone using Rails. I can use this
What I want to do is basically send some form of id with my
I have this form, in which i need to populate a combo box with
I have this form: <%= form_tag posts_path, :method => :get, :class => search_nav do
i have this form to serialize once i click the submit button, <form class=cashier_forms
I have this form: <tbody> <tr> <th>ID</th> <th>Name</th> <th>Birthdate</th> <th><input type=text autofocus=autofocus name=textinput1/></th> <th><input
I have this Form I am trying to upload my image but every time
I have this form with a date input. echo $this->Form->create('Nodata'); echo $this->Form->input('date1', array('type' =>
I have this form: <form> <div class=box> <h1>Contact form :</h1> <label> <span>Typ: </span> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.