homepage Welcome to WebmasterWorld Guest from 54.211.73.232
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
`ereg is deprecated` errors in PHP 5.3
Silver007A

5+ Year Member



 
Msg#: 4496723 posted 11:51 am on Sep 18, 2012 (gmt 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

 

Silver007A

5+ Year Member



 
Msg#: 4496723 posted 12:46 pm on Sep 18, 2012 (gmt 0)

Got it-

preg_replace("/www./","",$_SERVER["SERVER_NAME"]) .">\r\n";

swa66

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



 
Msg#: 4496723 posted 6:28 pm on Sep 18, 2012 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved