Welcome to WebmasterWorld Guest from 54.225.56.78

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

`ereg is deprecated` errors in PHP 5.3

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

Junior Member

5+ Year Member

joined:Oct 14, 2009
posts: 41
votes: 0


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 Sept 18, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 14, 2009
posts: 41
votes: 0


Got it-

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

Senior Member

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

joined:Aug 7, 2003
posts:4783
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members