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="formular@xxxxxx.com";
    $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<formular@xxxxxx.com>\n";
    $header.="Reply-to:$email";
    mail($to,$subject,$message,$header);
    $toinfo="mail@xxxxxx.com";
    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
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.

Link to comment
Share on other sites

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.

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.