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

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
PHP Script In An HTML Site
leaseman




msg:4494917
 10:14 pm on Sep 13, 2012 (gmt 0)

I have a HTML/CSS site and have recently been hit with lots of form spam (bots sending me bogus form fills). I have found a way that sound like it will fix this but it requires that I add a bit of PHP code. Problem is I don't know where or how to add this code.

Can anyone direct me on this?

 

tedster




msg:4494938
 11:37 pm on Sep 13, 2012 (gmt 0)

This thread in our PHP Forum may help: Parsing PHP with HTML file extension [webmasterworld.com]

leaseman




msg:4494941
 11:47 pm on Sep 13, 2012 (gmt 0)

This might be getting a bit over my head. Do you know anyone for a few bucks could handle this for me? Its too small a job for Elance, etc.

swa66




msg:4495152
 11:18 am on Sep 14, 2012 (gmt 0)

There's 2 steps, both easy:

1. Add one line to your .htaccess file (assuming you're using an apache server and you have not disabled the use of .htaccess files by disallowing overrides; in which case the same line needs to be added to your httpd.conf and the apache server needs to be restarted.).
AddType application/x-httpd-php .htm .html

or create the file with that content if you have none.

2. add the php code you created to your .html files
<?php "your code goes here" ?>

You can split this out over multiple line if you prefer:
<?php
"your code goes here"
?>
as you please.

That's it, unless you're not using apache, in which case I've no clue whatsoever.


Now the core of the problem: spammers submitting forms isn't all that easy to solve, and I kinda doubt adding something to the creation of the form alone is going to stop them - I'd assume there's going to be a need for a lot more where you process the form submissions.

strgraphics




msg:4506384
 10:13 am on Oct 10, 2012 (gmt 0)

we can get this by doing modifications in .httc related file in your hosting root

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
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