hilleljw Posted April 10, 2013 Share Posted April 10, 2013 (edited) This little program was given me by the sysad of the network who set up my homepage. I don't know php, so haven't been successful in finding out what the problem is. When running the program, I get an error message which says, "Warning: eregi(): Delimiter must not be alphanumeric or backslash in /home/mountain/public_html/sendeail.phpon line 52 One forum suggested changing "eregi" to "preg_match" to solve the problem, but it didn't; I still get the same error message except the "eregi" is replaced with "preg_match" the program can be tried at http://mountain-dreams.net/contact.php don't be put off by the" sendeail" - it's a misspelling, but the file name is misspelled in the same way. (that is, there is no "sendmail.php" program on the server, just "sendeail.php" the source code can be seen from the above information, but just in case am attaching both contact.php and sendeail.php files (eregi has been replaced with preg_match in these two files)contact.phpsendeail.php I would really appreciate it if anyone can help. Oh, I forgot to say that the program works perfectly, except for the error message line appearing at the top! thanks, Hillel in Australia Edited April 10, 2013 by hilleljw Quote Link to comment Share on other sites More sharing options...
hilleljw Posted April 11, 2013 Author Share Posted April 11, 2013 Oh, sadly, no responses, as my request slips down toward oblivion. 46 people read it; two apparently tried the program from my homepage... but no ideas how to get rid of this error message! Am I leaving out vital information that someoen might need to fix this? HELP, please! Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 11, 2013 Share Posted April 11, 2013 you need to post just the relevant part of the code that you need help with, the preg_match statement and possibly a few lines leading up to it if you are forming the match pattern in a variable. Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted April 11, 2013 Share Posted April 11, 2013 Try this: if(preg_match('#http:#', $notes)) { Quote Link to comment Share on other sites More sharing options...
lemmin Posted April 11, 2013 Share Posted April 11, 2013 Or if (strpos($notes, 'http:') !== false) Since it is just checking for a string in a string. PaulRyan's should work too. Quote Link to comment Share on other sites More sharing options...
hilleljw Posted April 12, 2013 Author Share Posted April 12, 2013 Since Paul's came in first, I tried that change and my error message has gone. Haven't tried Lemmin's, but will keep both as backup. Thanks very much for your help Quote Link to comment Share on other sites More sharing options...
hilleljw Posted April 12, 2013 Author Share Posted April 12, 2013 If anyone is interested in checking what the corrected version looks like, go to http://mountain-dreams.net/contact2.php ... Still have lots of work to do on everything though. And I can't figure out how to get the time right. there is a line which states: $message = " $todayis [AEST] \n and I tried to change that to : $message = " $todayis [Australia/Brisbane] \n but that succeeded only in making the whole thing disappear! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.