Jump to content

PHP5 Problem with older contact form


bmueller77

Recommended Posts

Hi guys,

 

my provider changed to PHP5 and now my contact form does not work any longer. I am not used to PHP and checking the web did not show me a solution.

Could you please be so kind and tell me, what i have to change to make it working again? thank you very much in advance for your help.

 

HTML-File

(...)
<form action="bestellanfrage-danke.php" method="post" target="_self">
(...)
<td valign="top" colspan="5">  <input type="submit" name="senden" style="background-color: #d9d9d9; color : #5890C8; font-size : 11px; Border-Right: #FFFFFF thin solid; Border-Left: #FFFFFF thin solid; Border-Top: #FFFFFF thin solid; Border-Bottom: #FFFFFF thin solid;" value="senden"></td>

PHP-File

<?
  $fehler = 0;
  if (strlen($email)==0) { $fehler=1;}
  $test = strtok($email,"@");
  $test = explode(".",$email);
  if (strlen($test[0])==0) { $fehler=1;}
  if (strlen($test[1])==0) { $fehler=1;}
  if (strlen($Nachname)==0){ $fehler=1; }
  if ($fehler == 0)
  {
    $to="[email protected]";
    $subject="Bestellung";
    $message="Folgende Bestellung/Informationsanforderung wurde im Internet an Sie gesendet:\n\n";
    $message.="Typ: $typ\n";
    $message.="Qualitaet: $Qualitaet\n\n";
    $message.="Menge: $Menge\n\n";
    $message.="Liefertermin: $Tag.$Monat\n\n\n";
    $message.="Leistung: $Leistung\n";
    $message.="Firma: $Firma\n";
    $message.="Vorname: $Vorname\n";
    $message.="Nachname: $Nachname\n\n";
    $message.="Strasse: $Strasse\n";
    $message.="PLZ/ Ort: $PLZ $Stadt\n";
    $message.="Bundesland: $Bundesland\n";
    $message.="Land: $Land\n\n";
    $message.="Telefon: $Telefon\n";
    $message.="Telefax: $Fax\n";
    $message.="E-Mail: $email\n\n";
    $message.="Ihr Wunsch: $Anfrage\n\n";
    $message.="Mitteilung:\n";
    $message.="$Mitteilung\n\n";
    $message.="IP des Benutzers: $REMOTE_ADDR\n";
    $header ="From:Bestellformular<[email protected]>\n";
    $header.="Reply-to:$email";
    mail($to,$subject,$message,$header);
    $toinfo="[email protected]";
    mail($toinfo,$subject,$message,$header);
    $text = "und werden Ihre Anfrage umgehend beantworten.";
  }
    if ($fehler == 1)
  {
    $text = "Bitte geben Sie Ihren Nachnamen und Ihre E-Mail Adresse ein!";
  }

?>
Link to comment
https://forums.phpfreaks.com/topic/278536-php5-problem-with-older-contact-form/
Share on other sites

Is this the full amount of code? What defines the variable $email? In case you don't know what I'm asking, where do you have: $email = code; ? It seems that is the only missing part of code I would need, but before we get into that let's change the subject really quick.

 

Do you understand you are using short tags? This means declaring php code by using <? instead of <?php. So you should be starting the file with <?php

 

Also, please try to be very specific when asking for help. It would be very helpful if you provided the error message you are getting if any and how it does not work.

Hi, no it is not the full amount of code as i truncated the HTML-parts, where all those forms are being filled. 

I guess, this is, what you were asking for when talking about $email?!

 

Part of HTML-File

<input size="20" name="email" style="width: 110;  font-family: Arial "></td>

Unfortunately i do not get any error message and the website behaves like before, but no eMails are being sent anymore.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.