473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

PHP Form function not working on SSL/TLS yahoo server

PHP form function works on my home server. When uploaded to clients' SSL/TLS yahoo server the form function react appropriately but does not send out the emails. The contact page is:

http://suninteg.com/contact.php

I can only think the mail is being held up by a security protocol on the server? I dunno.

the PHP code is as follows:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. /*
  3. *    Sun Integration - Consultation Request Page with Form
  4. *
  5. *    Author:        Dennis Klein
  6. *
  7. *    Date:        6/19/2012
  8. */
  9.  
  10.     //Include functions
  11.     require_once 'functionset.php';
  12.  
  13.     $msg = '<span class="a13nr">* Required field</span>';
  14.     $field = 'irname';
  15.  
  16.     if(isset($_POST['sendButton_x'])) {
  17.         //Sanitize the POST values, if necessary.
  18.         if(isset($_POST['rname'])) {$rname = strip_tags($_POST['rname']);}
  19.         if(isset($_POST['remail'])) {$remail = strip_tags($_POST['remail']);}
  20.         if(isset($_POST['raddr'])) {$raddr = strip_tags($_POST['raddr']);}
  21.         if(isset($_POST['rcity'])) {$rcity = strip_tags($_POST['rcity']);}
  22.         if(isset($_POST['rstate'])) {$rstate = strip_tags($_POST['rstate']);}
  23.         if(isset($_POST['rzip'])) {$rzip = strip_tags($_POST['rzip']);}
  24.         if(isset($_POST['rph1'])) {$rph1 = strip_tags($_POST['rph1']);}
  25.         if(isset($_POST['rph2'])) {$rph2 = strip_tags($_POST['rph2']);}
  26.         if(isset($_POST['rph3'])) {$rph3 = strip_tags($_POST['rph3']);}
  27.         if(isset($_POST['rnews'])) {$rnews = $_POST['rnews'];}
  28.  
  29.         //Input Validations
  30.         if(!preg_match("/^['A-Za-z\-\x20\.]{2,}$/", stripslashes($rname))) {
  31.             $msg = 'Name not valid';
  32.             $field = 'irname';
  33.         }
  34.         elseif(!validEmail($remail)) {
  35.             $msg = 'Email address not valid';
  36.             $field = 'iremail';
  37.         }
  38.         elseif(($rcity != '') && (!preg_match("/^['A-Za-z\-\x20\.]{2,}$/", stripslashes($rcity)))) {
  39.             $msg = 'City not valid';
  40.             $field = 'ircity';
  41.         }
  42.         elseif(($rstate != '') && (!ctype_alpha($rstate))) {
  43.             $msg = 'State not valid';
  44.             $field = 'irstate';
  45.         }
  46.         elseif(($rzip != '') && (!is_numeric($rzip) || strlen($rzip) < 5)) {
  47.             $msg = 'ZIP code not valid';
  48.             $field = 'irzip';
  49.         }
  50.         elseif((!is_numeric($rph1) || strlen($rph1) < 3) || (!is_numeric($rph2) || strlen($rph2) < 3) || (!is_numeric($rph3) || strlen($rph3) < 4)) {
  51.             $msg = 'Phone number not valid';
  52.             $field = 'irph1';
  53.         }
  54.         else {$msg = '';}
  55.  
  56.         if($msg == '') {
  57.  
  58.             // Send "Contact" data to User and to Administrator
  59.  
  60.             $rphone = $rph1.'-'.$rph2.'-'.$rph3;
  61.  
  62.             $subject  = 'Consultation Request sent from Sun Integration website';
  63.             $headers  = 'MIME-Version: 1.0' . "\r\n";
  64.             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  65.             $headers .= 'From: ' . 'larry@805webdesigns.com' . "\r\n";
  66.  
  67.             $sendmsg = '
  68.             <html>
  69.             <body>
  70.                 <basefont face="Times New Roman" size="3" color="midnightblue">
  71.                 <p>Thanks for requesting a Free Consultation. For your records, here is a copy of your request:</p>
  72.                 <p>Name: <font face="arial" color="#404040" size="2">'.$rname.'</font><br />
  73.                 Email address: <font face="arial" color="#404040" size="2">'.$remail.'</font><br />
  74.                 Address: <font face="arial" color="#404040" size="2">'.$raddr.'</font><br />
  75.                 City: <font face="arial" color="#404040" size="2">'.$rcity.'</font><br />
  76.                 State: <font face="arial" color="#404040" size="2">'.$rstate.'</font><br />
  77.                 Zip: <font face="arial" color="#404040" size="2">'.$rzip.'</font><br />
  78.                 Phone: <font face="arial" color="#404040" size="2">'.$rphone.'</font><br />
  79.                 Newsletter opt-in: <font face="arial" color="#404040" size="2">'.$rnews.'</font></p>
  80.                 <p>We will call or email you within 3 business days, and look forward to the opportunity of serving you.</p>
  81.                 <p>Customer Service<br />Sun Integration</p>
  82.             </body>
  83.             </html>
  84.             ';
  85.  
  86.             mail('larry@805webdesigns.com, '.$remail, $subject, $sendmsg, $headers);
  87.  
  88.             $rname = '';
  89.             $remail = '';
  90.             $raddr = '';
  91.             $rcity = '';
  92.             $rstate = '';
  93.             $rzip = '';
  94.             $rph1 = '';
  95.             $rph2 = '';
  96.             $rph3 = '';
  97.             $rnews = '';
  98.             $msg = 'Thank you. A confirmation email has been sent to you.';
  99.             $field = 'irname';
  100.         }
  101.     }
  102.  
  103.     else {
  104.         //Initialize variables
  105.         $rname = '';
  106.         $remail = '';
  107.         $raddr = '';
  108.         $rcity = '';
  109.         $rstate = '';
  110.         $rzip = '';
  111.         $rph1 = '';
  112.         $rph2 = '';
  113.         $rph3 = '';
  114.         $rnews = '';
  115.     }
  116.  
  117. ?>
  118.  
  119. <!DOCTYPE HTML>
  120. <html lang="en">
  121.  
  122. <head>
  123. <title>Sun Integration | Contact Us</title>
  124.  
  125. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  126. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  127.  
  128. <meta name="description" content="Sun Integration - Solar Advocate" /> 
  129. <meta name="keywords" content="solar, awnings" />
  130. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  131.  
  132. <link rel="stylesheet" type="text/css" href="css/style.css" />
  133. <link rel="stylesheet" type="text/css" media="screen" href="css/superfish.css" />
  134.  
  135. <style type="text/css">
  136.     h1 {
  137.         font-size:24px;
  138.     }
  139.  
  140.     h2 {
  141.         font-size:15px;
  142.         margin:10px 0 10px 0;
  143.     }
  144.  
  145.     p {
  146.         line-height:1.2em;
  147.         text-align:justify;
  148.     }
  149.  
  150.     .a13ng {
  151.         font-family:arial;
  152.         font-size:13px;
  153.         font-weight:normal;
  154.         color:#808080;
  155.     }
  156.  
  157.     .a13nr {
  158.         font-family:arial;
  159.         font-size:13px;
  160.         font-weight:normal;
  161.         color:red;
  162.     }
  163.  
  164.     .a14bg {
  165.         font-family:arial;
  166.         font-size:14px;
  167.         font-weight:bold;
  168.         color:#808080;
  169.     }
  170.  
  171.     .a14br {
  172.         font-family:arial;
  173.         font-size:14px;
  174.         font-weight:bold;
  175.         color:red;
  176.     }
  177.  
  178.     #col {
  179.         position:relative;
  180.         margin-top:20px;
  181.         width:600px;
  182.     }
  183.  
  184.     .left {
  185.          margin-left:10px;
  186.         margin-top:16px;
  187.         text-align:left;
  188.     }
  189.  
  190.     .inne {
  191.         position:absolute;
  192.         left:70px;
  193.         display:inline;
  194.         margin:-3px 0 0 0;
  195.     }
  196.  
  197.     .inb {
  198.         position:absolute;
  199.         top:154px;
  200.         left:390px;
  201.     }
  202.  
  203. </style>
  204.  
  205. <script type="text/javascript" src="js/jquery.min.js"></script>
  206. <script type="text/javascript" src="js/functionset.js"></script>
  207. <script type="text/javascript" src="js/hoverIntent.js"></script>
  208. <script type="text/javascript" src="js/superfish.js"></script>
  209.  
  210. <script type="text/javascript">
  211.     //Initial check for empty form fields
  212.     function validateForm()
  213.     {
  214.     var rn = document.getElementById('irname').value;
  215.     var re = document.getElementById('iremail').value;
  216.     var r1 = document.getElementById('irph1').value;
  217.     var r2 = document.getElementById('irph2').value;
  218.     var r3 = document.getElementById('irph3').value;
  219.  
  220.     if (rn==null || rn=="")
  221.         {
  222.         alert("Name required");
  223.         document.getElementById('irname').focus();
  224.         return false;
  225.         }
  226.     else if (re==null || re=="")
  227.         {
  228.         alert("Email address required");
  229.         document.getElementById('iremail').focus();
  230.         return false;
  231.         }
  232.     else if (r1==null || r1=="" || r2==null || r2=="" || r3==null || r3=="")
  233.         {
  234.         alert("Phone number required");
  235.         document.getElementById('irph1').focus();
  236.         return false;
  237.         }
  238.     else
  239.         {
  240.         return true;
  241.         }
  242.     }
  243.  
  244.     jQuery.noConflict()
  245.  
  246.     if (document.images)    {
  247.         preload_image_object = new Image();
  248.         // set image url
  249.         image_url = new Array();
  250.         image_url[0] = "http://bytes.com/images/header.jpg";
  251.         image_url[1] = "http://bytes.com/images/why-sub1pic1.jpg";
  252.         image_url[2] = "http://bytes.com/images/why-sub1pic2.jpg";
  253.         image_url[3] = "http://bytes.com/images/rb_hist.jpg";
  254.         image_url[4] = "http://bytes.com/images/rbmo_hist.jpg";
  255.         image_url[5] = "http://bytes.com/images/rb_news.jpg";
  256.         image_url[6] = "http://bytes.com/images/rbmo_news.jpg";
  257.         image_url[7] = "http://bytes.com/images/rb_test.jpg";
  258.         image_url[8] = "http://bytes.com/images/rbmo_test.jpg";
  259.         image_url[9] = "http://bytes.com/images/rb_gall.jpg";
  260.         image_url[10] = "http://bytes.com/images/rbmo_gall.jpg";
  261.         image_url[11] = "http://bytes.com/images/tpanel.png";
  262.  
  263.         var i = 0;
  264.         for (i=0; i<=11; i++) {
  265.             preload_image_object.src = image_url[i];
  266.         }
  267.     }
  268.  
  269.  
  270. </script>
  271.  
  272. </head>
  273.  
  274. <body onload="document.body.style.visibility='visible'">
  275.  
  276.     <div id="wrapper">
  277.  
  278.         <?php require 'header.html'; ?>
  279.  
  280.         <div id="main" style="height:930px;">
  281.  
  282.             <div id="topleft">
  283.                 <img src="http://bytes.com/images/why-sub1pic1.jpg" alt="">
  284.                 <div id="tpanel">
  285.                     <img src="http://bytes.com/images/tpanel.png" alt="">
  286.                      <h3 style="position:absolute; top:-10px; left:46px;">Pushing the<br />green revolution</h3>
  287.                 </div>
  288.             </div>
  289.  
  290.             <div id="topright"><img src="http://bytes.com/images/why-sub1pic2.jpg" alt=""></div>
  291.  
  292.             <div id="botleft" style="width:600px;">
  293.                 <h1>Contact Us</h1>
  294.                 <h2>For a Free Consultation</h2>
  295.                 <p class="a13ng">...and to start saving money, please fill out this form, or call us at:</p>
  296.  
  297.                 <p class="left a13ng">Sun Integration<br />
  298.                 18425  Burbank Blvd, Suite 520 <br>
  299.                 Tarzana, Ca 91356</p>
  300.  
  301.                 <p class="left a13ng">(818) 344 0440<br />
  302.                 Fax (818) 996 7181<br />
  303.                 contact@suninteg.com</p>
  304.                 <p style="margin-top:-10px;">&nbsp;</p>
  305.  
  306.                 <form name="conForm" method="post" action="<?php echo $_SERVER['PHP_SELF'].'#amsg'; ?>">
  307.                     <div id="col" class="a13ng">
  308.                         <div class="left">Name:<span class="a14br">*</span><div class="inne"><input type="text" name="rname" id="irname" class="a13ng" style="width:200px;" maxlength="60" value="<?php echo $rname; ?>" /></div></div>
  309.                         <div class="left">Email:<span class="a14br">*</span>
  310.                             <div class="inne"><input type="text" name="remail" id="iremail" class="a13ng" style="width:200px;" maxlength="128" value="<?php echo $remail; ?>" /></div>
  311.                         </div>
  312.                         <div class="left">Address:<div class="inne"><input type="text" name="raddr" id="iraddr" class="a13ng" style="width:200px;" maxlength="60" value="<?php echo $raddr; ?>" /></div></div>
  313.                         <div class="left">City:<div class="inne"><input type="text" name="rcity" id="ircity" class="a13ng" style="width:200px;" maxlength="40" value="<?php echo $rcity; ?>" /></div></div>
  314.                         <div class="left">State:<div class="inne"><input type="text" name="rstate" id="irstate" class="a13ng" style="width:20px;" maxlength="2" value="<?php echo $rstate; ?>" />
  315.                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZIP: <input type="text" name="rzip" id="irzip" class="a13ng" style="width:100px;" maxlength="10" value="<?php echo $rzip; ?>" /></div></div>
  316.                         <div class="left">Phone:<span class="a14br">*</span><div class="inne"><input type="text" name="rph1" id="irph1" class="a13ng" style="width:30px;" maxlength="3" value="<?php echo $rph1; ?>" /> -
  317.                         <input type="text" name="rph2" id="irph2" class="a13ng" style="width:30px;" maxlength="3" value="<?php echo $rph2; ?>" /> -
  318.                         <input type="text" name="rph3" id="irph3" class="a13ng" style="width:40px;" maxlength="4" value="<?php echo $rph3; ?>" /></div></div>
  319.                         <p>&nbsp;</p>
  320.                         <div class="left"><input type="checkbox" name="rnews" value="Y" <?php if($rnews == 'Y') {echo 'checked="checked"';} ?> />&nbsp; Opt-in to receive our monthly newsletter?</div>
  321.                         <a name="amsg"></a>
  322.                         <div class="left a14br"><?php echo $msg; ?></div>
  323.  
  324.                         <div class="inb"><input type="image" name="sendButton" id="sendB" style="outline-width:0;" src="http://bytes.com/images/b_send.png" alt="Send referral" onclick="return validateForm()"
  325.                         onmouseover="changeImage('sendB','images/bmo_send.png')" onmouseout="changeImage('sendB','images/b_send.png')" /></div>
  326.                     </div>
  327.                 </form>
  328.  
  329.                 <script type="text/javascript">
  330.                     document.getElementById('<?php echo $field; ?>').focus();
  331.                 </script>
  332.  
  333.             </div>
  334.  
  335.             <div id="botright">
  336.                 <a href="calculator.php">
  337.                 <input type="image" id="calcB" src="http://bytes.com/images/rb_calc.jpg" alt="Solar Calculator" style="margin-bottom:2px;"
  338.                 onmouseover="changeImage('calcB','images/rbmo_calc.jpg')" onmouseout="changeImage('calcB','images/rb_calc.jpg')" />
  339.                 </a>
  340.                 <a href="project-galleries.php">
  341.                 <input type="image" id="gallB" src="http://bytes.com/images/rb_gall.jpg" alt="Photo gallery of our projects" style="margin-bottom:2px;"
  342.                 onmouseover="changeImage('gallB','images/rbmo_gall.jpg')" onmouseout="changeImage('gallB','images/rb_gall.jpg')" />
  343.                 </a>
  344.                 <a href="services.php">
  345.                 <input type="image" id="servB" src="http://bytes.com/images/rb_serv.jpg" alt="Our Services" style="margin-bottom:2px;"
  346.                 onmouseover="changeImage('servB','images/rbmo_serv.jpg')" onmouseout="changeImage('servB','images/rb_serv.jpg')" />
  347.                 </a>
  348.                 <a href="history-sun-integration.php">
  349.                 <input type="image" id="histB" src="http://bytes.com/images/rb_hist.jpg" alt="Our history" style="margin-bottom:2px;"
  350.                 onmouseover="changeImage('histB','images/rbmo_hist.jpg')" onmouseout="changeImage('histB','images/rb_hist.jpg')" />
  351.                 </a>
  352.                 <a href="newsletter.php">
  353.                 <input type="image" id="newsB" src="http://bytes.com/images/rb_news.jpg" alt="CAGD in the news" style="margin-bottom:2px;"
  354.                 onmouseover="changeImage('newsB','images/rbmo_news.jpg')" onmouseout="changeImage('newsB','images/rb_news.jpg')" />
  355.                 </a>
  356.             </div>
  357.  
  358.         </div>
  359.  
  360.         <?php require 'footer.html'; ?>
  361.  
  362.     </div>
  363.  
  364. </body>
  365. </html>

Any help will be huge, thanks 805 web designs.
May 10 '13 #1
0 1508

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jason | last post by:
I am having trouble using the CONTAINS function in sql server(enterprise manager). I am typing the following: Select * FROM mytable WHERE CONTAINS(myfield,'mystring') This returns the...
2
by: Jeff Wilson | last post by:
Lots of posts explained to me how to invoke a function inside a form from another form. Unfortunately, it appears that a function inside a form can have at most 1 argument. I can create a form...
6
by: Robert C | last post by:
I have 2 forms, an unbound which calls a bound form via a command button. Both forms have a textbox called TDate. The name of the calling form is SelectionFrm. When I set the DefaultValue...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
4
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following...
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
3
by: Russ | last post by:
I have a usercontrol that is loaded by a webform. The usercontrol populates a datagrid which users need the capability to export data from the grid to Excel. The problem is that when I attempt to...
1
by: DR | last post by:
When a clr has the input type of SqlString it causes nvarchar(4000) to be the parameter type of the function in sql server. how to modify my CLR function to use nvarchar(max) ?
1
by: lisa007 | last post by:
Warning: mail() : SMTP server response: 503 valid RCPT command must precede DATA on whenever user click on to get new password but doesnt fill in the username field it shows that message i have...
0
by: ramuksasi | last post by:
Hi, I've an asp.net .ascx form and a gridview on that form.I've placed that form on an .aspx. Now while I'm trying to import data from gridview to excel it is showing the error "Control 'GridView'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.