Jump to content

Need help with script


php11980

Recommended Posts

Kind of inherited this project and could use some assistance. The script below worked on a windows server running IIS and php 4. Upgraded server and PHP to version 5.5.3 and the script no longer works. Keep getting an error of undefined variable for the following lines of code:

 

  $name=strtoupper($name);
  $email=strtoupper($email);
  $sub=trim($subject);
  $problem=trim($problem);
 
Complete script:
 
<?php
  
  $name=strtoupper($name);
  $email=strtoupper($email);
  $sub=trim($subject);
  $problem=trim($problem);



  if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
  {
    echo "That is not a valid email address.  Please return to the"
         ." previous page and try again.";
    exit;
  }
 
  $toaddress = "[email protected]";  // thelpdesk mail box

 

  
  
  $subject = $sub;
  $mailcontent = "Your name:<i> ".strtolower($name)."</i>\n"
		     ."Your email address is: <i>".strtolower($email)."</i>\n"
		     ."Subject: <i>".$sub."</i>\n"
             ."Helpdesk Request: <i>".$problem."</i>\n";
				 
  $emailcontent = $problem;
  

  mail($toaddress, $sub, $emailcontent, "From: $name<$email>");

  
?>

Any help is appreciated. 

 

Link to comment
https://forums.phpfreaks.com/topic/288483-need-help-with-script/
Share on other sites

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.