NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Form help.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
4 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 04-06-2006, 06:30 PM THREAD STARTER               #1 (permalink)
Senior Member
 
def1's Avatar
Join Date: May 2005
Posts: 1,538
def1 has a spectacular aura aboutdef1 has a spectacular aura about
 



Form help.


I've got this form, www.bumrecords.net/templates/advertise1.php

but I dont know how to send it to my email. Can someone please help me. I just need that form to send to my email.
__________________
Did you try my toolbar? Works in Firefox and IE!
http://www.bumrecords.net - Fun Games, Music, Discussion, And Much More!
upload²
•Pick the Web Hosting Company most NamePros Members Use Pick Chronichosting!•
def1 is offline  
Old 04-06-2006, 06:53 PM   #2 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



well for one thing, ur gonna have to rename those "checkboxes"... they all are named "checkbox".

after that, simply use the $_POST variables from php to format ur message into one variable, make the $_POST['email'] (or w/e) into the sending email address and use the mail() function of php. http://www.php.net/mail
nasaboy007 is offline  
Old 04-06-2006, 07:17 PM   #3 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
This should work:
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bum Records - Advertise</title>
<style type="text/css">
img{filter:none;}
a:hover img{-moz-opacity: 0.85;
filter:gray;}
</style>
<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: 000000;
}
body {
    background-color: #333333;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
a:link {
    color: #CCCCCC;
    text-decoration: underline;
}
a:visited {
    text-decoration: underline;
    color: #CCCCCC;
}
a:hover {
    text-decoration: none;
    color: 993300;
}
a:active {
    text-decoration: underline;
    color: #CCCCCC;
}
.style2 {font-size: 18px}
.style3 {font-size: 12px; }
.style5 {color: #FFFFFF}
.style6 {font-size: 12px; font-weight: bold; }
.style7 {color: #000000}
.style8 {font-size: 12px; font-weight: bold; color: #000000; }
-->
</style></head>

<body><center>
<table width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a href="index.html"><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_01.gif" width="250" height="121" border="0" /></a><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_02.gif" width="520" height="121" /></td>

  </tr>
  <tr>
    <td bgcolor="#EEEEEE"><a href="index.html"><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_03.gif" width="63" height="33" border="0" /></a><a href="artists.html"><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_04.gif" width="82" height="33" border="0" /></a><a href="signup.html"><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_05.gif" width="96" height="33" border="0" /></a><a href="messageboard/"><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_06.gif" width="127" height="33" border="0" /></a><img src="http://wac.658e.edgecastcdn.net/80658E/namepros/images/newst_07.gif" width="402" height="33" /></td>
  </tr>
</table>
<table bgcolor="#EEEEEE" width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top"><div class="style2" style="padding-left:5px;">
      <p><u>Advertise </u></p>

      <p class="style3">If you would like to advertise with us please fill out the form below.</p>
      <div style="border-width:3px; border-style:solid; color:#666666; background-color:#999999; width:500px; padding-left:5px; padding-top:3px;"><form name="form1" id="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <p class="style3 style7"><strong>What type of advertisement are you interested in?</strong></p>
        
        <!-- Ad Types -->
        <p class="style7">
          <input type="checkbox" name="ad_type" value="Frontpage" />
          <span class="style3">Frontpage</span></p>
        <p class="style7">
          <input name="ad_type" type="checkbox" class="style3" value="Banner" />
          <span class="style3">Banner</span></p>

        <p class="style7">
          <input type="checkbox" name="ad_type" value="Custom" />
          <span class="style3">Custom</span> </p>
        <!-- / Ad Types -->
        
        <!-- Company -->
        <p class="style8">What type of company are you? </p>
          <p class="style7">
              <input name="company_type" type="radio" class="style3" value="Musician" />
              <span class="style3">Musician</span> </p>

          <p class="style7">
            <input name="company_type" type="radio" class="style3" value="Label" />
            <span class="style3">Label </span></p>
          <p class="style7">
            <input name="company_type" type="radio" value="Ad agency" />
            <span class="style3">Advertising Agency </span></p>
          <p class="style7">
            <input name="company_type" type="radio" value="Not listed" />
            <span class="style3">Company type not listed</span></p>
        <!-- / Company -->
        
        <!-- Online Advertising Before? -->
          <p class="style8"> Have you ever advertised online before?</p>
            <p class="style7">
              <input name="advertised_before" type="radio" value="Yes" />
              <span class="style3">Yes</span>              <input name="advertised_before" type="radio" value="No" />
              <span class="style3">No</span></p>
        <!-- / Online Advertising Before? -->
        
        <!-- Name, Email, Description -->
            <p class="style8"> First Name</p>

            <p class="style8">
              <input name="first_name" type="text" value="" />
</p>
            <p class="style8">Last Name</p>
            <p class="style8">
              <input type="text" name="last_name" />
            </p>
            <p class="style8">Email</p>
            <p class="style8">

              <input type="text" name="email" />
</p>
            <p class="style8">Brief Company Description</p>
            <p class="style6">
????: NamePros.com http://www.namepros.com/programming/184559-form-help.html
              <textarea name="company_descr" cols="50"></textarea>
</p>

        <!-- / Name, Email, Description -->
            <p class="style6">
              <input type="submit" name="Submit" value="Send" />
              <input type="reset" name="Reset" value="Reset" />

            </p>
      </form>
      <?php

      
if(isset($_POST['Submit']) && $_POST['Submit'] != '')
      {
        
$ad_type trim(strip_tags($_POST['ad_type']));
        
$company_type trim(strip_tags($_POST['company_type']));
        
$advertised_before trim(strip_tags($_POST['advertised_before']));
        
$first_name trim(strip_tags($_POST['first_name']));
        
$last_name trim(strip_tags($_POST['last_name']));
        
$email trim(strip_tags($_POST['sender_email']));
        
$message wordwrap(trim(strip_tags($_POST['company_descr'])), 70"<br>\n");
        
$ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

        if(!
preg_match("/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/"$email))
        {
          echo 
'<br>E-mail is either invalid or left blank. Please check it and try again.';
        }
        else
        {
          
$e $email;

          if(empty(
$ad_type) || empty($company_type) || empty($advertised_before) || empty($first_name) || empty($last_name) || empty($message))
          {
            echo 
'<br>One or more required fields left blank.';
          }
          else
          {
            
$headers  'MIME-Version: 1.0'."\r\n";
            
$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
            
$headers .= 'From: '.$first_name.' <'.$e.'>';

            
$send mail("you@domain.com""Advertising on Bum Records""
            <html>
            <head>
            <title>Email from 
$first_name - About Advertising</title>
            </head>

            <body>

            <table>
            <tr>
              <td colspan=\"2\">Someone is interested in advertising on Bum Records!</td>
            </tr>
            <tr>
              <td><b>First Name:</b></td>
              <td>
$first_name</td>
            </tr>
            <tr>
              <td><b>Last Name:</b></td>
              <td>
$last_name</td>
            </tr>
            <tr>
              <td><b>Email:</b></td>
              <td>
$e</td>
            </tr>
            <tr>
              <td><b>IP:</b></td>
              <td>
$ip</td>
            </tr>
            <tr>
              <td><b>Ad Type:</b></td>
              <td>
$ad_type</td>
            </tr>
            <tr>
              <td><b>Company Type:</b></td>
              <td>
$company_type</td>
            </tr>
            <tr>
              <td><b>Advertised online before?</b></td>
              <td>
$advertised_before</td>
            </tr>
            <tr>
              <td valign=\"top\"><b>Company Description:</b></td>
              <td>
$company_descr</td>
            </tr>
            </table>

            </body>
            </html>"
$headers);
          }
          if(
$send)
          {
            echo 
'<br>Thank you, '.$name.', for enquiring about advertising on Bum Records.';
          }
          else
          {
            echo 
'<br>Seems to have been a problem sending the email. Please try again.';
          }
        }
      }
      
?>
      </div>
      <p class="style3">&nbsp;</p>
      <p class="style3"></p>
    </div></td>
    <td width="180px" align="left" valign="top"><p><script type="text/javascript"><!--
google_ad_client = "pub-2704045946477637";
google_alternate_color = "eeeeee";
google_ad_width = 180;
google_ad_height = 90;
google_ad_format = "180x90_0ads_al";
google_ad_channel ="";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--></script>
????: NamePros.com http://www.namepros.com/showthread.php?t=184559
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
  </tr>

</table>
<div class="style5" style="background-color:333333; text-align:left">Bum Records &copy; 2005 -<span class="style5"> <a href="index.html">Home</a> - <a href="artists.html">Artists</a> - <a href="signup.html">Sign Up</a> - <a href="messageboard.html">Message Board</a> - <a href="advertise.html">Advertise</a> </span></div>

</center></body>
</html>
Just replace "you@domain.com" with your email.
Eric is offline  
Old 04-07-2006, 04:20 PM THREAD STARTER               #4 (permalink)
Senior Member
 
def1's Avatar
Join Date: May 2005
Posts: 1,538
def1 has a spectacular aura aboutdef1 has a spectacular aura about
 



thanks guys!
__________________
Did you try my toolbar? Works in Firefox and IE!
http://www.bumrecords.net - Fun Games, Music, Discussion, And Much More!
upload²
•Pick the Web Hosting Company most NamePros Members Use Pick Chronichosting!•
def1 is offline  
Old 04-07-2006, 06:33 PM   #5 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
No problem.
Eric is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:11 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger