Safari losing POST information when submitting a form to a PHP page

Community,

I have seen several related questions but none to my point, so I'm asking this:

I created a web form (standard html) that submits to a PHP page. The submitted data is just fine when submitted in Firefox and IE, but in Safari (both Mac and PC) no data is received by the PHP page.

The code of the form is here, below is the PHP code to work with the input.


<script language="JavaScript" type="text/javascript">
function Enable_Submit()
{
	if (document.form1.Bedingungen.checked)
	{
		document.form1.Submit.disabled = false;
	}
	else
	{
		document.form1.Submit.disabled = true;
	}
}
</script>
 
// the form
 
<table width="99%" border="0" align="center" cellpadding="10" cellspacing="0">
    <tr>
      <td width="75%" valign="top"><form action="http://www.kyudo-frankfurt.de/antrag.php" method="POST" enctype="enctype=text/plain" name="form1">
          <p>Name:<br>
            <input name="Name" type="text" id="Name" maxlength="50">
          </p>
          <p>Stra&szlig;e:<br>
            <input name="Strasse" type="text" id="Strasse" maxlength="50">
          </p>
          <p>PLZ/Ort:<br>
            <input name="PLZ" type="text" class="plzinput" id="PLZ" maxlength="5">
            <input name="Ort" type="text" class="ortinput" id="Ort" maxlength="50">
          </p>
          <p>Telefon:<br>
            <input name="Telefon" type="text" id="Telefon" maxlength="30">
          </p>
          <p>E-Mail:<br>
            <input name="Mail" type="text" id="Mail" maxlength="50">
          </p>
          <p>Kommentar:<br>
              <textarea name="Kommentar" cols="52" rows="5" id="Kommentar"></textarea>
		</p>
		<p><input class="checkbox" type="checkbox" name="Bedingungen" value="ja" onClick="JavaScript:Enable_Submit()">
            Ich habe die <a href="PDF/Bedingungen_Einsteigerkurs.pdf" target="_blank">Bedingungen zur Anmeldung</a>, die <a href="PDF/Dojo-Etikette.pdf">Dojo-Etikette</a> und die <a href="PDF/Sicherheitsordnung.pdf">Sicherheitsordnung</a> gelesen und akzeptiert.
		  </p>
 
 
          <p> <input class="button" type="submit" name="Submit" value="Abschicken" disabled>
            <input class="button" name="Reset" type="reset" id="Reset" value="Zur&uuml;cksetzen">
          </p>
        </form></td>
    </tr>
  </table>
 
//what follows is the PHP code to process the form data
 
<?php
if ($_POST['Name'])
{
	$MailTo = 'information@kyudo-frankfurt.de';
	$Subject = '[Kyudo-Frankfurt] Anmeldung zum Einsteigerkurs';
	$AdditionalHeader = 'From: webform@kyudo-frankfurt.de' . "\r\n" .
    			'Reply-To: webform@kyudo-frankfurt.de' . "\r\n" .
				'Return-Path: webform@kyudo-frankfurt.de' . "\r\n";
	$Body = 'Die folgenden Daten wurden im Formular übermittelt:'. "\r\n\r\n";
	$Body .= 'Name: ' . $_POST['Name'] . "\r\n";
	$Body .= 'Straße: ' . $_POST['Strasse'] . "\r\n";
	$Body .= 'PLZ, Ort: ' . $_POST['PLZ'] . ' ' . $_POST['Ort'] . "\r\n";
	$Body .= 'E-Mail: ' . $_POST['Mail'] . "\r\n";
	$Body .= 'Kommentar: ' ."\r\n\r\n" . $_POST['Kommentar'] . "\r\n\r\n";
	$Body .= 'Die Bedingungen wurden zur Kenntnis genommen.';
 
	mail($MailTo, $Subject, $Body, $AdditionalHeader);
	echo "<p>Vielen Dank. Wir haben Ihre Anmeldung erhalten und werden uns schnellstens mit Ihnen in Verbindung setzen.</p>";
}
else
	echo('<meta http-equiv="refresh" content="1, f_formular_ek.html">');
?>

Open in new window

nick601Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nplibCommented:
is the forming submiting, just no data is going? or is the form doing nothing when the submit button is clicked.


also you should have {} around your else conditions.
else {
   echo('<meta http-equiv="refresh" content="1, f_formular_ek.html">');
}
?>

Open in new window

0
nick601Author Commented:
Hi nplib,

the form is submitting but no data going (NB: There is Data Going when using IE and FF). REgarding the brackets, yes - I am used to C++ style without brackets in one-liners :) I'll improve

Nick
0
nplibCommented:
PHP sometimes acts weird if you mix and match the styles.
 you had brackets in the beginning of the if statement, but not after the if.


try adding
just to see if any data is going

also can you give me the link to the form, maybe I can see something..
<?php
print_r($_POST);
if ($_POST['Name'])
{
        $MailTo = 'information@kyudo-frankfurt.de';
        $Subject = '[Kyudo-Frankfurt] Anmeldung zum Einsteigerkurs';

Open in new window

0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

ddrudikCommented:
You might consider:
<form name="form1" action="<?php echo$_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="post">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nick601Author Commented:
Found the issue. Ddrudik's hint was helpful, the enctype was incorrect (text/plain) submits a blank array in Safari. However also thanks to nplib for the print_r hint in PHP. Didn't know that trick yet.

Nick
0
ddrudikCommented:
Thanks for the question and the points.
0
nick601Author Commented:
Final comment from me:

Safari (both MAC and PC) appears to be sensitive to the enctype of a form (IE and FF ignore the setting). Be sure to set the enctype to "multipart/form-data".

Also if you're (like me) from an ASP / VB background looking for an alternative to Request.Form - print_r is what you're after in PHP

Cheers dudes.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.