Jump to content

Php Form Not Working In Ie


jendep

Recommended Posts

Hi,

I hope someone can help me. I don't really know anything about PHP, but somehow I created a form for a survey. It actually works in firefox :) but in IE when I hit "send" it goes to a blank page, whereas in firefox it goes to the thank you page. Also, the email doesnt send. So I'm thinking there is some glitch in my code that IE doesnt like.

 

I've attached the send portion of the code. I would really really appreciate if someone could have a quick look and let me know what I've done wrong.

Thank you!!!!!

 

 

<?php

define('IRONCLAD_CAPTCHA_APIKEY','IRONCLAD-CAPTCHA-QPEIW-4345875019');

require('ironclad_captcha_lib.php');

 

$captcha_result = ironclad_captcha_check(

IRONCLAD_CAPTCHA_APIKEY,

$_POST['ironclad_captcha_vx'],

$_POST['ironclad_captcha_input1'],

$_POST['ironclad_captcha_input2'],

$_POST['ironclad_captcha_input3']

);

 

/* Specify your SMTP Server, Port and Valid From Address */

ini_set("SMTP","mail.mail.com");

ini_set("smtp_port","25");

ini_set("sendmail_from","myemail@myemail");

 

/*

This first bit sets the email address that you want the form to be submitted to.

You will need to change this value to a valid email address that you can access.

*/

$webmaster_email = "myemail@myemail";

 

/*

This bit sets the URLs of the supporting pages.

If you change the names of any of the pages, you will need to change the values here.

*/

$feedback_page = "survey-form.php";

$error_page = "error_message.php";

$thankyou_page = "thank_you.html";

 

/*

This next bit loads the form field data into variables.

If you add a form field, you will need to add it here.

*/

$email_address = $_REQUEST['email_address'] ;

$name = $_REQUEST['name'] ;

$phone = $_REQUEST['phone'] ;

$satisfaction = $_REQUEST['satisfaction'] ;

$obtainappointment = $_REQUEST['obtainappointment'] ;

$obtainappointmentcomments = $_REQUEST['obtainappointmentcomments'] ;

$timetoservice = $_REQUEST['timetoservice'] ;

$feelwelcome = $_REQUEST['feelwelcome'] ;

$feelwelcomecomments = $_REQUEST['feelwelcomecomments'] ;

$serviceadvisorperformance = $_REQUEST['serviceadvisorperformance'] ;

$courtesy = $_REQUEST['courtesy'] ;

$explainationcharges = $_REQUEST['explainationcharges'] ;

$considerationtime = $_REQUEST['considerationtime'] ;

$knowledgeexperience = $_REQUEST['knowledgeexperience'] ;

$commitments = $_REQUEST['commitments'] ;

$serviceadvisorimprove = $_REQUEST['serviceadvisorimprove'] ;

$valuebusiness = $_REQUEST['valuebusiness'] ;

$valuebusinesscomments = $_REQUEST['valuebusinesscomments'] ;

$readywhenpromised = $_REQUEST['readywhenpromised'] ;

$delay = $_REQUEST['notifiedofdelay'] ;

$fixauthorizedrepairs = $_REQUEST['fixauthorizedrepairs'] ;

$nofixrepairs = $_REQUEST['nofixrepairs'] ;

$recommendfriend = $_REQUEST['recommendfriend'] ;

$additionalfeedback = $_REQUEST['additionalfeedback'] ;

$contactconcerns = $_REQUEST['contactconcerns'] ;

 

 

/*

The following function checks for email injection.

Specifically, it checks for carriage returns - typically used by spammers to inject a CC list.

*/

function isInjected($str) {

$injections = array('(\n+)',

'(\r+)',

'(\t+)',

'(%0A+)',

'(%0D+)',

'(%08+)',

'(%09+)'

);

$inject = join('|', $injections);

$inject = "/$inject/i";

if(preg_match($inject,$str)) {

return true;

}

else {

return false;

}

}

 

// If the user tries to access this script directly, redirect them to the feedback form,

if (!isset($_REQUEST['email_address'])) {

header( "Location: $feedback_page" );

}

 

// check if any of the SPAMBOT criteria are true

 

if(preg_match("/bcc:|cc:|multipart|url|Content-Type:/i", implode($_POST))) {

$spam=true;

}

if (preg_match_all("/<a|http:/i", implode($_POST), $out) > 3) {

$spam=true;

}

if(!empty($_POST['emailagain'])){

$spam = true;

}

 

// if e-mail is not formatted correctly, show error message

if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email'])) {

$error = true ;

}

 

if($_POST['formtime'] < time()-3600) {

$spam=true;

}

 

// If email injection is detected, redirect to the error page.

elseif ( isInjected($email_address) ) {

header( "Location: $error_page" );

}

 

// If email injection is detected, redirect to the error page.

elseif (!$captcha_result) {

header( "Location: $error_page" );

}

// If we passed all previous tests, send the email then redirect to the thank you page.

else {

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

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

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

$body .= "satisfaction " . $satisfaction . "\n";

$body .= "Were you satisfied with your ability to obtain an appointment at Uptown Imports? " . $obtainappointment . "\n";

$body .= "Obtain Appointment Comments " . $obtainappointmentcomments . "\n";

$body .= "Time To Service: " . $timetoservice . "\n";

$body .= "Feel Welcome: " . $feelwelcome . "\n";

$body .= "Feel Welcome Comments: " . $feelwelcomecomments . "\n";

$body .= "Serviceadvisorperformance: " . $serviceadvisorperformance . "\n";

$body .= "Courtesy: " . $courtesy . "\n";

$body .= "Explaination Charges: " . $explainationcharges . "\n";

$body .= "Consideration Time: " . $considerationtime . "\n";

$body .= "Knowledge Experience: " . $knowledgeexperience . "\n";

$body .= "Commitments: " . $commitments . "\n";

$body .= "Service Advisor Improve: " . $serviceadvisorimprove . "\n";

$body .= "Value Business: " . $valuebusiness . "\n";

$body .= "Value Business Comments: " . $valuebusinesscomments . "\n";

$body .= "Ready When Promised: " . $readywhenpromised . "\n";

$body .= "Notified of Delay: " . $notifiedofdelay. "\n";

$body .= "Fixed Authorized Repairs" . $fixauthorizedrepairs . "\n";

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

$body .= "Recommend Friend: " . $recommendfriend . "\n";

$body .= "Additional Feedback: " . $additionalfeedback . "\n";

$body .= "Contact Me: " . $contactconcerns . "\n";

 

 

 

mail( "$webmaster_email", "Feedback Form Results", $body, "From: $email_address" );

 

header( "Location: $thankyou_page" );

}

?>

Link to comment
Share on other sites

PHP has nothing to do with whether the form will submit or not. The form is built in HTML. So, the problem is either with the HTML source (including Javascript) of the form OR with the processing page. Trying to debug HTML errors from the PHP source to create it is difficult. Since you have many 'conditions' in your code there is no way for us to determine what the source of your HTML form even is. Plus, the above code would not generate a full HTML page so there is obviously other code to build that page not displayed.

Link to comment
Share on other sites

Either enter your URL here http://validator.w3.org/ or copy and paste the source code and if there is an issue it will tell you.

 

If you don't get an answer do the same with your css here http://jigsaw.w3.org/css-validator/

 

Be careful of extra brackets left in your css while editing.

 

Is this with ie 7/8 or 9?

Link to comment
Share on other sites

Thank you for your replies. It is coming from a form, sending to the above code you are right. I thought it was in the send code tho because that's when I get the no response, after I hit send, in IE. It's version IE 9. I will try your suggestions on the validators, it's quite possible that it is a typo that I can not see, which I was I asked you all. Thanks!!!

Link to comment
Share on other sites

Only issue I can think of off the top of my head involving IE and form submission is when using an image as the submit button:

 

<input type="image"/>

 

Are you using an image as the submit button? IE (not 100% sure about IE9) will send the clicked coords of the button, in which case, you need to check for form submission using _x and/or _y appended to your POSTed button name.

Link to comment
Share on other sites

Ok... I looked at the validator, there are errors. But nothing that, in my opinion, is causing my problem. My form says when the person hits enter it goes to send_mail.php, which is *supposed* to internally make sure everything is OK (which is the code I entered above) and then once it passes that, it sends it directly to the thank you page, so the user doesnt see the send_mail.php page at all... What I realized is that in IE it sends it to send_mail.php, doesnt bypass it like firefox does. So... if anyone could help, I am putting the original form page in that is supposed to direct where everything goes. maybe the problem lies in that page? I do thank you in advance for your effort :)

 

Here is the start form page code...

<?php

define('IRONCLAD_CAPTCHA_APIKEY','IRONCLAD-CAPTCHA-QPEIW-4345875019');

require('ironclad_captcha_lib.php');?>

 

<html xmlns="http://www.w3.org/1999/xhtml">

 

 

<head>

<title>Uptown Imports * BMW * Mercedes * Jaguar</title>

<link href="styles.css" rel="styleSheet" type="text/css">

 

 

 

 

</head>

 

<body marginheight="0" marginwidth="0" topmargin="0">

<table border="0" width="100%" cellpadding="1" cellspacing="1" background="images/background_brown.gif">

<tr><td>

 

<table border="0" width="893" cellpadding="5" cellspacing="0">

<tbody><tr>

<td height="100" width="226"><div align="center">

<img src="images/uptown_imports_logo.gif" width="178" height="88" border="0" alt=""></td>

<td valign="top" width="351"><div align="left">

<p align="center"><strong><font face="Arial, Helvetica, sans-serif" size="4">Uptown Imports</font><font face="Arial, Helvetica, sans-serif" size="3"><br>

2324-A Distribution St. • Charlotte, NC 28203<br>

Phone: (704) 375-6777 • Fax: (704) 375-6780</font></strong></p>

</div></td>

<td valign="middle" width="302"><div align="left">

<p align="center"><font face="Arial, Helvetica, sans-serif" size="4"><strong>BMW • Mercedes • Jaguar </strong></font>

</div></td>

</tr></table>

 

<!--- LINKS --->

 

<table width="900" height="25" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><a href="aboutus.cfm"

onmouseover="popUp('elMenu1',event);topmenu1.src='images/link_1_on.gif';"

onmouseout="popDown('elMenu1');topmenu1.src='images/link_1.gif';"><img name="topmenu1" src="images/link_1.gif" width="77" height="46" border="0"></a></td>

 

<td><a href="facilities.cfm"

onmouseover="popUp('elMenu2',event);topmenu2.src='images/link_2_on.gif';"

onmouseout="popDown('elMenu2');topmenu2.src='images/link_2.gif';"><img name="topmenu2" src="images/link_2.gif" width="85" height="46" border="0"></a></td>

 

<td><a href="services.cfm"

onmouseover="popUp('elMenu3',event);topmenu3.src='images/link_3_on.gif';"

onmouseout="popDown('elMenu3');topmenu3.src='images/link_3.gif';"><img name="topmenu3" src="images/link_3.gif" width="80" height="46" border="0"></a></td>

 

 

<td><a href="asktheexpert.cfm"

onmouseover="popUp('elMenu4',event);topmenu4.src='images/link_4_on.gif';"

onmouseout="popDown('elMenu4');topmenu4.src='images/link_4.gif';"><img name="topmenu4" src="images/link_4.gif" width="123" height="46" border="0"></a></td>

 

 

<td><a href="testimonials.cfm"

onmouseover="popUp('elMenu5',event);topmenu5.src='images/link_5_on.gif';"

onmouseout="popDown('elMenu5');topmenu5.src='images/link_5.gif';"><img name="topmenu5" src="images/link_5.gif" width="95" height="46" border="0"></a></td>

 

<td><a href="showcase.cfm"

onmouseover="popUp('elMenu6',event);topmenu6.src='images/link_6_on.gif';"

onmouseout="popDown('elMenu6');topmenu6.src='images/link_6.gif';"><img name="topmenu6" src="images/link_6.gif" width="115" height="46" border="0"></a></td>

 

<td><a href="history101.cfm"

onmouseover="popUp('elMenu7',event);topmenu7.src='images/link_7_on.gif';"

onmouseout="popDown('elMenu7');topmenu7.src='images/link_7.gif';"><img name="topmenu7" src="images/link_7.gif" width="99" height="46" border="0"></a></td>

 

<td><a href="appointment.php"

onmouseover="popUp('elMenu8',event);topmenu8.src='images/link_8_on.gif';"

onmouseout="popDown('elMenu8');topmenu8.src='images/link_8.gif';"><img name="topmenu8" src="images/link_8.gif" width="106" height="46" border="0"></a></td>

 

<td><a href="survey-form.php"

onmouseover="popUp('elMenu9',event);topmenu9.src='images/link_10_on.gif';"

onmouseout="popDown('elMenu9');topmenu9.src='images/link_10.gif';"><img name="topmenu9" src="images/link_10.gif" width="109" height="46" border="0"></a></td>

 

<td><a href="index.cfm"

onmouseover="popUp('elMenu10',event);topmenu10.src='images/link_9_on.gif';"

onmouseout="popDown('elMenu910');topmenu10.src='images/link_9.gif';"><img name="topmenu10" src="images/link_9.gif" width="74" height="46" border="0"></a></td>

</tr></table>

 

 

</td>

</tr></table>

<!--- END LINKS --->

 

 

<h1>Send Us Your Feedback!</h1><div align="center">

<form action="send_mail.php" method="post">

<table cellpadding="3" cellspacing="3" border="0" width="600" cellpadding="0">

 

 

 

<tr><td align="left">

Name   

<input type="text" name="name" size="40" required="required"/></td></tr>

<tr><td align="left">

Phone   

<input type="text" name="phone" size="40" required="required"/></td></tr>

<tr><td align="left">

E-mail   

<input type="text" name="email_address" size="40" required="required"/></td></tr>

 

 

<tr><td><p><font color="teal"><strong>Please Answer The Following Questions With "Yes" - "No" or "N/A" and/or Fill in The Comments Portions to Provide Additional Information.</strong></font><p>

 

<strong>Were you satisfied with your ability to obtain an appointment at Uptown Imports?</strong><br />

 

<input type="text" name="obtainappointment" size="5" value="Yes"/>   </td></tr>

<tr><td> <em>If no, please tell us why.</em><br />

 

<textarea cols="50" rows="5" name="obtainappointmentcomments" class="input" style="width: 500px;"></textarea><br /><br />

<strong>How long did it take to get your vehicle in for service?</strong><br />

<textarea cols="25" rows="1" name="timetoservice" class="input" style="width: 500px;"></textarea><br /><br />

</td></tr>

 

<tr><td>

<strong>Did the Uptown Imports staff make you feel welcome and valued at the time of your arrival?</strong><br />

 

<input type="text" name="feelwelcome" size="5" value="yes" />

</td></tr>

<tr><td> <em>If no, do you have any suggestions as to how we can improve for future visits?</em><br />

 

<textarea cols="50" rows="5" name="feelwelcomecomments" class="input" style="width: 500px;"></textarea><br />

<br />

</td></tr>

<tr><td>

<strong> Were you satisfied with your Service Advisor's performance for each of the service aspects listed below?</strong><br /><br />

a. Understanding of your service needs:    <input type="text" name="serviceadvisorperformance" size="5" value="yes" /><br /><br />

b. Level of courtesy, honesty and respect:    <input type="text" name="courtesy" size="5" value="yes" /></textarea><br /><br />

c. Explaination of the charges and work performed:    <input type="text" name="explainationcharges" size="5" value="yes" /><br /><br />

d. Consideration of your time:    <input type="text" name="considerationtime" size="5" value="yes" /><br /><br />

e. Knowledge and experience:    <input type="text" name="knowledgeexperience" size="5" value="yes" /><br /><br />

f. Fullfillment of commitments made to you:    <input type="text" name="commitments" size="5" value="yes" /><br /><br />

 

 

<strong>Do you have any suggestions as to how your Service Advisor an improve?</strong><br />

 

<textarea cols="50" rows="5" name="serviceadvisorimprove" class="input" style="width: 500px;"></textarea><p>

</td></tr>

 

<tr><td>

<strong>Do you feel that our staff valued your business?</strong><br />

<input type="text" name="valuebusiness" size="5" value="yes" /></textarea><br />

</td></tr>

<tr><td> <em>If no, please tell us why</em>.<br />

<textarea cols="50" rows="5" name="valuebusinesscomments" class="input" style="width: 500px;"></textarea><br /><br />

</td></tr>

 

<tr><td>

<strong>Was your vehicle ready when promised?</strong>    <input type="text" name="readywhenpromised" size="5" value="yes" /></textarea><br />

</td></tr>

 

 

<tr><td>

If no were you notified of the delay?    <input type="text" name="notifiedofdelay" size="5" value="yes" /></textarea><br />

 

</td></tr>

 

<tr><td>

Did this service visit fix all authorized repairs    <input type="text" name="fixauthorizedrepairs" size="5" value="yes" /></textarea><br />

<br />

</td></tr>

<tr><td> <em>If no, please explain.</em><br />

<textarea cols="50" rows="5" name="nofixrepairs" class="input" style="width: 500px;"></textarea><br />

</td></tr>

 

<tr><td>

Overall, would you recommend Uptown Imports to a family member or close friend for their future service needs?

   <input type="text" name="recommendfriend" size="5" value="yes" /></textarea><br />

</td></tr>

 

 

<tr><td> Please provide us additional feedback or questions about your service experience at Uptown Imports.<br />

<textarea cols="50" rows="7" name="additionalfeedback" class="input" style="width: 500px;"></textarea><br />

</td></tr>

<tr><td>

Would you like to be contacted by Uptown Imports to further discuss any open concerns from your most recent visit?    <input type="text" name="contactconcerns" size="5" value="yes" /></textarea><br />

</td></tr>

 

 

 

<tr><td colspan="2" align="center"><style type="text/css">

<!--

.ironclad-captcha_table {

border: 1px solid #AAAAAA;

font-size: 11px;

background-color: white;

color: black;

background-image: url(http://captcha.securitystronghold.com/bg.png);

}

.ironclad-captcha_image { border: 1px solid #DDDDDD; }

.ironclad-captcha_row { }

.ironclad-captcha_cell { }

.ironclad-captcha_cell a { text-decoration: none; }

.ironclad-captcha_input { width: 18px; }

-->

</style>

<?php print ironclad_captcha_get_form(IRONCLAD_CAPTCHA_APIKEY); ?><p>

<?php

$captcha_result = ironclad_captcha_check(

IRONCLAD_CAPTCHA_APIKEY,

$_POST['ironclad_captcha_vx'],

$_POST['ironclad_captcha_input1'],

$_POST['ironclad_captcha_input2'],

$_POST['ironclad_captcha_input3']

);

?>

<input type="submit" name="Submit" value="SEND" /><br /><br /><br />

</p></td></tr>

</table>

 

</form>

<table border="0" cellpadding="10" cellspacing="0" width="893" background="images/background_brown.gif">

<tr><td valign="bottom"><div class="descrip">  © Copyright Uptown Imports</font>  </td>

<td align="right" valign="bottom"><div class="descrip"><div align="right">  <a href="http://www.shoppecharlotte.com" class="menu2">Site Design and Management: ShoppeCharlotte.com</a></font>   </td></tr>

</table>

 

 

<div align="center"><br><br><!-- Site Meter -->

<script type="text/javascript" src="http://s45.sitemeter.com/js/counter.js?site=s45uptown">

</script>

<noscript>

<a href="http://s45.sitemeter.com/stats.asp?site=s45uptown" target="_top">

<img src="http://s45.sitemeter.com/meter.asp?site=s45uptown" alt="Site Meter" border="0"/></a>

</noscript>

<!-- Copyright ©2006 Site Meter -->

 

 

 

</body>

</html>

Link to comment
Share on other sites

What I realized is that in IE it sends it to send_mail.php, doesnt bypass it like firefox does.

....

<form action="send_mail.php" method="post">

....

 

I must be missing something, your form is sending it to send_mail.php

 

 

Do you have exit()'s on redirects in send_mail.php

 

From stackoverflow

 

Without the exit call, the exact point/time at which your script will terminate will come down to two factors:

  1. How quickly the client browser reacts to the redirect
  2. How much time it takes the rest of your script to execute

Edited by floridaflatlander
Link to comment
Share on other sites

IE also has an issue where if you hit the "Enter" button instead of clicking the "Submit" button it will not process without a hidden field matching the name of the Submit button.

 

However, I do not see this as being an issue for you as you don't seem to be checking for form submission (that I can see), like so:

 

if (isset($_POST['Submit'])) {

Edited by mrMarcus
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.