01-10-2014, 11:40 AM
I am able to use PHP, excpt for one little issue.. I never have composed PHP myself, having done nothing bust static sites for such a long time. In fact i did start a thread about my less than ideal Form mail situation, which is apparently due to an issue with the PHP code my hosting company provides me. That thread is here... http://www.webdeveloper.com/forum/sh...deal-form-mail
That issue is even more important to me, because that deal with my form email, which I'm, sure will get used far more often than my alternate (non scriptable ) email. And I think some help there would educate me a LOT more about actually using PHP, and maybe set me on my way to being able to write my own. For the alternate, I'm content using the HTTP_REFERRER and my easily changeable email forwarder address. But I'm still having trouble understanding the RIGHT syntax to make that variable work for me.
01-10-2014, 11:52 AM
You'll be way better off using PHP for this task, as PHP not only allows you to completely hide the email you're sending to (doesn't get sent to the client at all), but will also overcome any cross-domain referencing issues (aka "Same-origin policy") which I can see as possibly being problematic in this case. My next reply will be in the existing thread that you've just provided a link to. I'll need you to check if you have cURL installed and operational on your server, as hopefully that's what we'll be utilizing with the PHP code. If you do have cURL capabilities, kindly let me know either through a PM or just reply here. Thanks!
01-10-2014, 12:05 PM
OK... i think I've got this HTTP_REFERER thing working. maybe some of you could test for me? The first test is very easy. Just point your browser to
It should display a 404 error, which is currently handled by wordpress for now.
Since I've been warned that HTTP_REFERER is browser dependent, if you don't get the 404 for the first test, please let me know what browser you used. I do know that once you do the second test, you won't be able to do the first one again in some browsers because the "refere" is now in your cache. But I can live with that! :-)
01-10-2014, 12:13 PM
Everything seems to work as expected!
01-10-2014, 12:16 PM
Originally Posted by Gray1989
I'll need you to check if you have cURL installed and operational on your server, as hopefully that's what we'll be utilizing with the PHP code. If you do have cURL capabilities, kindly let me know either through a PM or just reply here. Thanks!
I don't think I do. I couldn't find it in my Cpanel, and when I plugged "curl into the company site's (hostmonster.com) search, it came up dry.
I'm really getting sick of hostmonster. Its not a FREE host, its support is in the toilet, and its help agents don't have a clue about anything. Anyway, as i said... if I do use any scripting right now, it will be to help with that form mail proble, Please look at that thread, at http://www.webdeveloper.com/forum/sh...deal-form-mail Maybe there's some way i can download the PHP that handles the form (apparently at http://www.hostmonster.com/monstermail ), and maybe I'll be able to fix it and install my own copy, in my cgi-bin directory. Or maybe it will be easier to just find another form mail script that already works, and doesn't have the problems I described with losing text line breaks.
01-10-2014, 12:27 PM
@Gray1989 Thanks a heap! I did none to prevent hot links to my graphics too. I need to get my brain back into gear with this and other .htaccess features I haven't messed with in ages.
01-10-2014, 12:37 PM
No problem, I replied in the thread you linked (http://www.webdeveloper.com/forum/sh...deal-form-mail), you can test out the script I made. Hopefully you have cURL and it works for you. You use it in the exact same way you use your existing form mailer, just omit the "sendtoemail" variable and make sure that you change the email "email@example.com" to the correct one. Let me know if you have any issues.
01-10-2014, 12:40 PM
I use HostGator by the way, I really like their service and support. It is, however, the only hosting company that I have any experience with. If you're looking to switch it up, they're definitely not a bad choice. Probably not the cheapest option to go with but I'm definitely happy.