Welcome to WebmasterWorld Guest from 54.163.168.15

Forum Moderators: coopster & jatar k

`ereg is deprecated` errors in PHP 5.3

   
11:51 am on Sep 18, 2012 (gmt 0)

5+ Year Member



Hi,

I'm getting some problems with an old form2mail script I used for a contact form and my server using 5.3.

It is this line-

$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". preg_replace("www.","",$_SERVER/["SERVER_NAME"]/) .">\r\n";


Can anyone help? I think I'm supposed to close my "pattern" with a "/", but I'm not sure I'm getting it in the right place.

The message I get after submitting the form is-

Parse error: syntax error, unexpected '[' in /home/fstf/public_html/howtogivegirloralsex.com/form2mailsales.php on line 111

Thanks
12:46 pm on Sep 18, 2012 (gmt 0)

5+ Year Member



Got it-

preg_replace("/www./","",$_SERVER["SERVER_NAME"]) .">\r\n";
6:28 pm on Sep 18, 2012 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You could leave out the Message-ID completely: the first MTA that gets the message without one will add one for you.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month