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 = "helpdesk@maharam.com";  // 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
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.