form sends from mobile browser but not desktop browser

Hello all, first time post…

So I along with my brother-in-law who is the more technical expert built a basic site for a drilling company. We built a form that, when filled in, will send the details to their email address. Worked fine for a long time, now it seems the form will only send from a mobile browser and not from a desktop browser. It’s fairly basic, only requiring a contact name and email address for the thing to be sent through as well as a date picker. Any thoughts? Not sure what other details I should include. Thanks for any help.

[php]<?php
session_start();
$OrderDate = $_POST[‘OrderDate’] ;
$CompanyName = $_POST[‘CompanyName’] ;
$ContactName = $_POST[‘ContactName’] ;
$Address = $_POST[‘Address’] ;
$City = $_POST[‘City’] ;
$PostalCode = $_POST[‘PostalCode’] ;
$Phone = $_POST[‘Phone’] ;
$Fax = $_POST[‘Fax’] ;
$Cell = $_POST[‘Cell’] ;
$Email = $_POST[‘Email’] ;

$JobNo = $_POST[‘JobNo’] ;
$PONo = $_POST[‘PONo’] ;
$StartDate = $_POST[‘StartDate’] ;
$EndDate = $_POST[‘EndDate’] ;
$StartTime = $_POST[‘StartTime’] ;

$JobLocation = $_POST[‘JobLocation’] ;

$MeetingLocation = $_POST[‘MeetingLocation’] ;
$SonicDrillRig = $_POST[‘SonicDrillRig’] ;
$AugerTrackRig = $_POST[‘AugerTrackRig’] ;
$ScopeOfWork = $_POST[‘ScopeOfWork’] ;

$ServicesChecked = $_POST[‘ServicesChecked’];
$PermitsInPlace = $_POST[‘PermitsInPlace’];
$SiteCleared = $_POST[‘SiteCleared’];
$CoringRequired = $_POST[‘CoringRequired’];
$DCPTSampling = $_POST[‘DCPTSampling’];
$VaneTesting = $_POST[‘VaneTesting’];
$SiteContaminated = $_POST[‘SiteContaminated’];
$ShelbySampling = $_POST[‘ShelbySampling’];
$PotentialContaminations = $_POST[‘PotentialContaminations’];
$HolesHydrovaced = $_POST[‘HolesHydrovaced’];

$AccessIssues = $_POST[‘AccessIssues’];
$Comments = $_POST[‘Comments’] ;

// ------------- CONFIGURABLE SECTION ------------------------

$mailto = ‘[email protected]’ ;
$subject = “Job Order Request” ;
$formurl = “http://www.omegaenvironmentaldrilling.ca/forms.php” ;
$thankyouurl = “http://www.omegaenvironmentaldrilling.ca/complete.php” ;
$errorurl = “http://www.omegaenvironmentaldrilling.ca/error.php” ;

$uself = 0;
$forcelf = 0;
$use_envsender = 0;
$use_sendmailfrom = 1;
$smtp_server_win = ‘’ ;
$use_webmaster_email_for_from = 0;
$use_utf8 = 1;

// -------------------- END OF CONFIGURABLE SECTION ---------------

define( ‘MAX_LINE_LENGTH’, 600 );
$headersep = $uself ? “\n” : “\r\n” ;
$content_nl = $forcelf ? “\n” : (defined(‘PHP_EOL’) ? PHP_EOL : “\n”) ;
$content_type = $use_utf8 ? ‘Content-Type: text/html; charset=“utf-8”’ : ‘Content-Type: text/html; charset=“iso-8859-1”’ ;
if ($use_sendmailfrom) {
ini_set( ‘sendmail_from’, $mailto );
}
if (strlen($smtp_server_win)) {
ini_set( ‘SMTP’, $smtp_server_win );
}
$envsender = “-f$mailto” ;

$http_referrer = getenv( “HTTP_REFERER” );

if (((empty($Email) || !preg_match(’/@/’, $Email))) || (empty($ContactName))) {
header( “Location: $errorurl” );
exit ;
}
//$fromemail = $use_webmaster_email_for_from ? $mailto : $email ;

if (function_exists( ‘get_magic_quotes_gpc’ ) && get_magic_quotes_gpc()) {
$Comments = stripslashes( $Comments );
}

$messageproper =

This message was sent from:” . “$http_referrer” . “


” .
"<p><strong><u>Client Information</u></strong></p>" .
"<p><strong>Order Date:  </strong> $OrderDate</p>" .
"<p><strong>Company Name:  </strong> $CompanyName</p>" . 
"<p><strong>Contact Name:  </strong> $ContactName</p>" . 
"<p><strong>Address:  </strong> $Address</p>" . 
"<p><strong>City:  </strong> $City</p>" . 
"<p><strong>Postal Code:  </strong> $PostalCode</p>" . 
"<p><strong>Phone:  </strong> $Phone</p>" . 
"<p><strong>Fax:  </strong> $Fax</p>" .
"<p><strong>Cell:  </strong> $Cell</p>" . 
"<p><strong>Email:  </strong> $Email</p><br>" . 

"<p><strong><u>Job Information</u></strong></p>" .
"<p><strong>Job No.:  </strong> $JobNo</p>" .
"<p><strong>P.O. No.:  </strong> $PONo</p>" .
"<p><strong>Start Date:  </strong> $StartDate</p>" . 
"<p><strong>End Date:  </strong> $EndDate</p>" . 
"<p><strong>Start Time:  </strong> $StartTime</p>" . 	

"<p><strong>Job Location:  </strong> $JobLocation</p>" . 

"<p><strong>Meeting Location (if differnet than job location):  </strong> $MeetingLocation</p>" .

"<p><strong>Sonic Drill Rig:  </strong>" . "$SonicDrillRig" . "</p>" .
"<p><strong>Auger Track Rig:  </strong>" . "$AugerTrackRig" . "</p>" .

"<p><strong>Scope of Work (i.e. hollow/solid stem, depth, no. of holes):  </strong> $ScopeOfWork</p><br>" . 	

"<p><strong>Have all services been checked?  </strong>" . "$ServicesChecked" . "</p>" .
"<p><strong>Permits in place?  </strong>" . "$PermitsInPlace" . "</p>" .  
"<p><strong>Site cleared for accessibility?  </strong>" . "$SiteCleared" . "</p>" .
"<p><strong>Concrete coring required?  </strong>" . "$CoringRequired" . "</p>" .
"<p><strong>DCPT Sampling?  </strong>" . "$DCPTSampling" . "</p>" .
"<p><strong>Vane testing required?  </strong>" . "$VaneTesting" . "</p>" .
"<p><strong>Shelby Sampling?  </strong>" . "$ShelbySampling" . "</p>" .
"<p><strong>Are holes hydrovaced (daylighted)?  </strong>" . "$HolesHydrovaced" . "</p>" .
"<p><strong>Site Contaminated?  </strong>" . "$SiteContaminated" . "</p>" .
"<p><strong>If yes, type of potential contaminations? </strong> $PotentialContaminations</p><br>" . 

"<p><strong>Access Issues/Comments:  </strong> $Comments</p>" . 

//wordwrap( $Comments, MAX_LINE_LENGTH, $content_nl, true ) . 
"<br>" ;

$_SESSION['message'] = $messageproper;

$headers =
“From: “$ContactName” <$Email>” . $headersep . “Reply-To: “$ContactName” <$Email>” . $headersep . “X-Mailer: chfeedback.php 2.16.2” .
$headersep . ‘MIME-Version: 1.0’ . $headersep . $content_type ;

if ($use_envsender) {
mail($mailto, $subject, $messageproper, $headers, $envsender );
}
else {
mail($mailto, $subject, $messageproper, $headers );
}
header( “Location: $thankyouurl” );
exit ;
?>[/php]

And this is the web page that refers to the php form

[code]

<?php include('html-head.php'); ?>
	<?php include('header.php'); ?> 
    
    <div id="wrapper">
    <div id="main">
	<div id="content">	
      
		<header><h1>Job Order</h1></header> 		
		<div><img src="images/forms_banner.jpg" alt="" align="middle" /></div>
    
        
		<form id="SendOrder" action="send_order.php" method="post">
			<section id="client_info">
				<h2>Client Information</h2>
				
				<div class="_50"><label for="ContactName">*Contact Name</label><input type="text" id="ContactName" name="ContactName" size="43" required="required"  data-message="Required field."></div>
				<div class="_25"><label for="Email">*Email</label><input type="text" name="Email" id="Email" size="47" required="required" data-message="Required field."></div>
				<div class="_25"><label for="OrderDate">Order Date</label><input type="date" name="OrderDate" id="OrderDate" size="20"></div>
				
								
				<div class="_50"><label for="Address">Address</label><input type="text" name="Address" id="Address" size="115"></div>
				<div class="_25"><label for="City">City</label><input type="text" name="City" id="City" size="115"></div>
				<div class="_25"><label for="PostalCode">Postal Code</label><input type="text" name="PostalCode" id="PostalCode" size="115"></div>
				
				<div class="_40"><label for="CompanyName">Company Name</label><input type="text" id="CompanyName" name="CompanyName" size="40"></div>
				<div class="_20"><label for="Phone">Phone</label><input type="text" name="Phone" id="Phone" size="10"></div>
				<div class="_20"><label for="Fax">Fax</label><input type="text" name="Fax" id="Fax" size="10"></div>
				<div class="_20"><label for="Cell">Cell</label><input type="text" name="Cell" id="Cell" size="10"></div>
				
				
					
			</section>
			
			<section id="job_info" class="last">
			<h2>Job Information</h2>
			
			<div class="_20"><label for="JobNo">Job No.</label><input type="text" name="JobNo" id="JobNo" size="15"></div>
			<div class="_20"><label for="PONo">P.O. No.</label><input type="text" name="PONo" id="PONo" size="15"></div>
			<div class="_20"><label for="StartDate">Start Date</label><input type="date" name="StartDate" id="StartDate" size="14"></div>
			<div class="_20"><label for="EndDate">End Date</label><input type="date" name="EndDate" id="EndDate" size="14"></div>
			<div class="_20"><label for="StartTime">Start Time</label><input type="text" name="StartTime" id="StartTime" size="16"></div>
			<div class="_100"><label for="JobLocation">Job Location</label><input type="text" name="JobLocation" id="JobLocation" size="109"></div>
			
			<div class="_100"><label for="MeetingLocation">Meeting Location (if different than job location)</label><input type="text" name="MeetingLocation" id="MeetingLocation" size="73"></div>
			
			<div class="_101">Select Rig:<input type="radio" name="SonicDrillRig" value="Yes">Sonic Drill Rig</input>&nbsp;&nbsp;&nbsp;<input type="radio" name="AugerTrackRig" value="Yes">Auger Track Rig</input></div>
							
			<div class="_100"><label for="ScopeOfWork">Scope of Work (i.e. hollow/solid stem, depth, no. of holes)</label>
			<textarea rows="3" cols="126" name="ScopeOfWork" id="ScopeOfWork"></textarea></div>
			
			
			
			<div class="_50">
				<div class="_67"><label for="ServicesChecked">Have all services been checked?</label></div>
				<div class="_33"><input type="radio" name="ServicesChecked" value="Yes"> Yes</input><input type="radio" name="ServicesChecked" value="No"> No</input></div>
				
				<div class="_67"><label for="SiteCleared">Site cleared for accessibility?</label></div>
				<div class="_33"><input type="radio" name="SiteCleared" value="Yes"> Yes</input><input type="radio" name="SiteCleared" value="No"> No</input></div>
				
				<div class="_67"><label for="DCPTSampling">DCPT Sampling?</label></div>
				<div class="_33"><input type="radio" name="DCPTSampling" value="Yes"> Yes</input><input type="radio" name="DCPTSampling" value="No"> No</input></div>
				
				<div class="_67"><label for="HolesHyrdrovaced">Are holes hydrovaced (daylighted)?</label></div>
				<div class="_33"><input type="radio" name="HolesHydrovaced" value="Yes"> Yes</input><input type="radio" name="HolesHydrovaced" value="No"> No</input></div>
			
				<div class="_100">&nbsp;</div>
			
				<div class="_67"><label for="SiteContaminated">Site Contaminated?</label></div>
				<div class="_33"><input type="radio" name="SiteContaminated" value="Yes"> Yes</input><input type="radio" name="SiteContaminated" value="No"> No</input></div>
			</div>
			
			<div class="_50">
				<div class="_67"><label for="PermitsInPlace">Permits in Place?</label></div>
				<div class="_33"><input type="radio" name="PermitsInPlace" value="Yes"> Yes</input><input type="radio" name="PermitsInPlace" value="No"> No</input></div>
				
				<div class="_67"><label for="CoringRequired">Concrete coring required?</label></div>
				<div class="_33"><input type="radio" name="CoringRequired" value="Yes"> Yes</input><input type="radio" name="CoringRequired" value="No"> No</input></div>
				
				<div class="_67"><label for="VaneTesting">Vane testing required?</label></div>
				<div class="_33"><input type="radio" name="VaneTesting" value="Yes"> Yes</input><input type="radio" name="VaneTesting" value="No"> No</input></div>
				
				<div class="_67"><label for="ShelbySampling">Shelby Sampling?</label></div>
				<div class="_33"><input type="radio" name="ShelbySampling" value="Yes"> Yes</input><input type="radio" name="ShelbySampling" value="No"> No</input></div>
				
				<div class="_100">&nbsp;</div>
				
				<div class="_100"><label for="PotentialContaminations">If yes, type of potential contamination(s)?</label>
				<input type="text" name="PotentialContaminations" id="PotentialContaminations" size="23"></input></div>
				
			</div>
					
			<div class="_100"<label for="Comments">Access Issues/Comments</label>
			<textarea rows="3" cols="126" name="Comments" id="Comments"></textarea></div>
			<div class="_100"><input type="submit" value="Send Form"/></div>
		
			

		</form>
		

      <div class="_100"><a href="forms/joborder.pdf">Click here to download the form in PDF format.</a></div>   
	  </div><!-- #content -->
    </div><!-- #main -->
	</div><!-- #wrapper -->
<?php include('footer.php'); ?>
 </div><!-- #container -->
 
 <script type="text/javascript">
	$(function(){
		$("#SendOrder").validator({
			position: 'center left'
		});
		
		$( ":date" ).datepicker();
		
		$( "input:submit, button" ).button();
		
	});
 </script>
[/code]

I tested it and it works. Your email validation is very weak. If a user does not enter an email with an @ in it, the form goes to an error page. Validation should happen before they even leave the form page.

Thanks for the response. I’ll change the validation thanks.

As for it working when you tested it, could there be any reason then, why sending the form from any browser outside of a mobile platform won’t work? I put my own email into the $mailto and receive nothing. It goes to the ‘thankyouurl’ that I have set up but nada. This is using different computers.

edit…

Well it seems that it’s working now oddly. Can’t explain why it hasn’t been for the past week or so. Maybe
server issues? Thanks for the help anyways.

Sponsor our Newsletter | Privacy Policy | Terms of Service