I use the SkaLinks directory script, but it does not come with a built-in captcha or other anti-spam system. I need the script to be modified to include a captcha to prevent the several hundred spam submissions I receive each day. I found the following pages while looking for a solution:
http://www.skalinks.com/forums/1_710_0.html
http://www.hamidof.com/Downloads/PHP_Scripts/Simple_Captcha_Script/
However, I was unable to get these to work - this may help if you decide to try to fix this problem for me.
I'll offer 400FRIH$ for anyone who is able to create a proper (working) captcha system for the submission page of my directory.
If this is not possible, I will offer 150FRIH$ for anyone who implements a more simple spam-prevention system. For example, 4 or 5 radio buttons could be displayed at the bottom of the page with some text instructing users which to select in order for the submission to be successful. This would not have to change each time - it would be a fairly simple addition to the html code.
The code that needs to be modified is the add_url.php file included with the script. You can get a text version of this file by clicking here - please let me know if you need any more information.
Looking forward to a quick solution to my spam problem - thanks for any help!
Hi mate,
I shall get to this pronto, however i need to know how long this is going to take, i have a simple example of a verification system on a site i created for a client some time ago.
the link is http://www.infotechweb.freeweb7.com/contacting_us.php
Get back to me and let me know...spammers, the biggest annoyance sent to the internet (apart from hackers that is). If you need a reliable and heavy system, i cannot complete this job as it would take me a few days to do this job balancing. Let me know though
Cheers
| freelanceCMS wrote: |
| I shall get to this pronto, however i need to know how long this is going to take |
As a non-php coder, I don't know how long you should expect this to take. I'm not in any real rush for it, but the sooner you can implement it the better.
That image verification would be perfect - if you could implement that on my site, I would be most grateful!
Let me know if you need access to the original files - I can send them to you if you require more than the php code I have already provided.
hey,
ill help you with it... i can make a image verification thing... but there is another simple thing...
it requires a user to copy the text and paste it into the field... less annoyance to users... more security against spammers ! :p ..
ill post it soon ...
| salman_500 wrote: |
ill help you with it... i can make a image verification thing... but there is another simple thing...
it requires a user to copy the text and paste it into the field... less annoyance to users... more security against spammers ! :p ..
ill post it soon ... |
Thanks - looking forward to seeing it!
erm.... spoke too soon.... there a couple probs for me ...
im not a real pro coder.. and that code is way to pro to go through my head...
but i still tried... and heres is my wage attempt ... may not work... may work ... keep back-up of your original file....
what i did here, is that i including a feature.... when someone submits the form .... a randomly generated number and a field appears along with a submit button.. users must copy the text and paste it into the field ... then submit... if it matched... they will be moved to further verification of the form.. original of Skalinks ...
try this out... and tell me what results you get...
| Code: |
<?php
/*
* SkaLinks, Links Exchange Script
* (c) Skalfa eCommerce, 2005
*
* TERMS OF USE
* You are free to use, modify and distribute the original code of SkaLinks software
* with the following restrictions:
* 1) You may not remove Skalfa eCommerce copyright notices from any parts of Skalinks software
* code.
* 2) You may not remove or modify "powered by" links to vendor's site from any web-pages of
* SkaLinks script.
* 3) You may use but may not distribute original or modified version of SkaLinks software
* for commercial purposes.
* Complete License Agreement text: http://www.skalinks.com/license.php
*
* Technical support: http://www.skalinks.com/support/
*/
require_once( 'headers.php' );
session_start();
// Input Data
$smarty = new DirSmarty();
$_output['linkback_mod'] = $SkaLinks->GetParam( "linkback_required" );
if ( $_GET['cat'] )
{
$cat_id = ( int )$_GET['cat'];
}
else
{
$cat_id = ( int )$_POST['cat'];
}
/////////////////////////////
if ($_POST['Form_submitted']) {
if (!$_POST['checking']) {
function randomimagecheck() {
$salt = "012345678901234567890123456789";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$function = randomimagecheck();
session_register('check');
$_SESSION['check'] = $function;
echo "<form name=\"form\" method=\"POST\">
<table width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"46%\" align=\"center\" valign=\"top\"><div align=\"center\"><table width=\"50%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td bgcolor=\"#FFFFFF\"><b>". $function ."</b></td>
</tr>
</table></div></td>
<td width=\"54%\" align=\"left\" valign=\"middle\"><label>
<input type=\"text\" name=\"check\"/>
</label></td>
</tr>
<tr>
<td> </td>
<td align=\"left\" valign=\"middle\"><label> <br />
<input name=\"checking\" type=\"submit\" id=\"checking\" value=\"Add\" />
</label></td>
</tr>
</table>
</form>";
}
else {
if (($_POST['check']) != ($_SESSION['check'])) {
echo "You entered the incorrect code. Please go back and try again";
}
else {
session_unset('check');
///////////////
if ( $_POST['Form_submitted'] )
{
$link_title_checked = convert_quote( $_POST['link_title'] );
$link_desc_checked = convert_quote( $_POST['link_description'] );
$link_extend_desc_checked = convert_quote( $_POST['link_full_description'] );
if ( !$_output['linkback_mod'] )
{
// get the incorrect field
if ( !preg_match( "/^http:\/\/[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\/)*[a-zA-Z0-9\-\._]*/", $_POST['link_url'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_url'];
}
elseif( ctype_space( $_POST['link_back'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_back'];
}
elseif( ctype_space( $_POST['link_title'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_title'];
}
elseif( ctype_space( $_POST['link_description'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_description'];
}
elseif( !preg_match("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/", $_POST['link_email'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_email'];
}
if ( !$inf_item )
{
$link_attribute = 1;
}
}
else
{
// get the incorrect field
if ( !preg_match( "/^http:\/\/[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\/)*[a-zA-Z0-9\-\._]*/", $_POST['link_url'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_url'];
}
elseif( ctype_space( $_POST['link_title'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_title'];
}
elseif( ctype_space( $_POST['link_description'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_description'];
}
elseif( !preg_match("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/", $_POST['link_email'] ) )
{
$inf_item = $_skalinks_lang['add_link']['link_email'];
}
if ( !$inf_item )
{
$link_attribute = 1;
}
}
}
}// if ( $_POST['Form_submitted'] )
if ( $link_attribute )
{
$_POST['link_url'] = trim( $_POST['link_url'] );
$_POST['link_title'] = trim( $_POST['link_title'] );
$_POST['link_description'] = trim( $_POST['link_description'] );
}
$template_id = ( int )$_POST['letter_id'];
$_output['menu'] = 0;
$_output['title'] = $SkaLinks->GetTitleChain( -1, $_skalinks_page['title'], $_skalinks_page['title_add_url'] );
$_output['show_dirtree'] = $SkaLinks->GetParam( 'show_dirtree' );
$_output['show_admin_ads'] = $SkaLinks->GetParam( 'show_admin_ads' );
$_output['mod_rewrite'] = $SkaLinks->GetParam( 'mod_rewrite' );
if ( $_output['mod_rewrite'] )
{
$_output['cat_index_url'] = $SkaLinks->GetParam( 'cat_index_url' );
}
$ADMIN = $SkaLinks->IsAdmin();
//
// TODO : Statements here...
$_output['cat_info'] = $SkaLinks->GetCatInfo( $cat_id );
$_output['cat_url'] = $SkaLinks->GetCategoryURL( $cat_id );
$_output['cat_navigation'] = $SkaLinks->GetCatNavigationLine( $cat_id );
if ( $_POST['Form_submitted'] )
{
$_POST['link_title'] = $link_title_checked['m_strip'];
$_POST['link_description'] = $link_desc_checked['m_strip'];
$_POST['link_full_description'] = $link_extend_desc_checked['m_strip'];
if ( !$link_attribute && $cat_id )
{
$msg = $_skalinks_lang['msg']['inf_incomplete']."<br/>".$inf_item;
$_output['info_inf'] = 1;
}
else
{
$_output['info_inf'] = 0;
$status = ( $ADMIN ) ? 0 : 1;
$alt_domain = ( $ADMIN ) ? $_POST['link_alt_domain'] : "";
$added = $SkaLinks->AddLink( $_POST['link_url'], $_POST['link_back'], $link_title_checked['s_strip'], $link_desc_checked['s_strip'], $link_extend_desc_checked['s_strip'], $_POST['link_email'], $cat_id, $ADMIN['Name'], $template_id, $alt_domain );
$link_info = $SkaLinks->GetLinksSearch( $_POST['link_url'], 0, 1 );
$link_id = $link_info[0]['ID'];
if ( $_output['linkback_mod'] )
{
$SkaLinks->VerifyLinkRecip( $link_info[0]['ID'] );
}
$location_link = $SkaLinks->GetCategoryURL( $cat_id );
$listing_link = ( $_output['mod_rewrite'] ) ? $location_link."listing".$link_id.".html" : $location_link."listing.php?link_id=".$link_id ;
if ( !$added )
{
$letter_theme = ( $ADMIN ) ? 't_admin_link_submitted' : 't_admin_link_approved';
$SkaLinks->Mailer( $_POST['link_email'], $_skalinks_site['mail_theme'], $letter_theme, $_POST['link_url'], $location_link, $listing_link, $_skalinks_site['brand'] );
}
if ( $added )
{
$msg = $_skalinks_lang['msg']['link_exists'];
}
else
{
$msg = $_skalinks_lang['msg']['link_added']."<br>".$SkaLinks->GetParam('same_site_display');
}
}
}
if ( !$cat_id )
{
$msg = $_skalinks_lang['msg']['add_url_root_cat'];
require_once( 'index.php' );
}
else
{
$tem_table = $SkaLinks->m_LetterTemTable;
$tem_binding_table = $SkaLinks->m_LetterTemBindingTable;
$cat_table = $SkaLinks->m_CategoriesTable;
$category_id = $cat_id;
while( !$_output['letter_template'] )
{
$result = $SkaLinks->db_Row( "SELECT `t2`.* FROM `$tem_binding_table` `t1` LEFT JOIN `$tem_table` `t2` ON `t1`.`Template_id`=`t2`.`ID` WHERE `t1`.`Cat_id`='$category_id'" );
if ( $result )
{
$_output['letter_template'] = $result;
}
else
{
$parent_category = $SkaLinks->db_Row( "SELECT `Parent` FROM `$cat_table` WHERE `ID`='$category_id'" );
$category_id = $parent_category['Parent'];
}
if ( !$category_id )
{
break;
}
}
if ( !$_output['letter_template'] )
{
$sql = "SELECT * FROM `$tem_table` WHERE `Status`='1'";
$result = $SkaLinks->db_Row( $sql );
$_output['letter_template'] = $result;
}
$_output['js'] = 'form.js';
display( 'add_url' );
}
}
}
?> |
sorry... but just copy this code...

Last edited by salman_500 on Thu Jun 07, 2007 12:13 pm; edited 1 time in total
Thanks for your efforts. Unfortunately, this doesn't work - a blank page is displayed when a user clicks on "Add Link". Could this error be caused by the fact the URLs are displayed like this: http://ignite.frih.net/add_url.php?cat=2
ermmm... blank page....
ok then provide me with one more thing...
the file that contains the original form... maybe its in html format or watever... give me the file so i can put it straight into the form....
provide me with that file and i can do something better.....
The php file I gave you was in its original form. You can download an un-altered version of the whole directory script from here.
Hope this helps.
yes.. i had already donwlaoded that... but was unable to get up on my local server.. localhost... so i just re tweaked the code i provided before...
ok i edited the code in my previous post... check i out... it should give somthing else... coz a blank page is not what i coded it to give...lol. [:p]
awaiting your reply !
Thanks for all your efforts. Unfortunately, it's still not working - it gives a blank page.
I've uploaded your code to http://ignite.frih.net/add_url_test.php - you can test this out yourself. I've also tried renaming it as add_url.php and using it as part of the directory script, but it still gives a blank page.
Yeah, if you can send me the original files that would be great and i'll code it for you, provided i get free time today..you can email these files
| freelanceCMS wrote: |
| Yeah, if you can send me the original files that would be great and i'll code it for you, provided i get free time today..you can email these files |
You can download the original files from here: http://www.skalinks.com/downloads/skalinks_1_5.zip
I'll make a skalinks directory and upload this to a subdomain, then i will copy and paste the relevant code so that you can just add this to your code, of course i will instruct you on how to do this.
For some reason i cannot find the correct function that the captcha system, let me see, if there is no reply within a few days i havent been able to do this and i apologise for any inconveniences in advance
Cheers,
Nick
That's no problem - thanks for your input. It would be great if you could get this working. Please let me know if you find that this isn't possible.
Hi mate,
have you got the captcha system running yet??
If not you can do it yourself, all you have to do is sign up (free) with the URL provided below
www.emailmeform.com
let me know if this works and also given i get some free time within the next few days i will see if i can get it working for you, time is the only thing stopping me at the moment
Hope the site helps. Good luck
Nick
| freelanceCMS wrote: |
Hi mate,
have you got the captcha system running yet?? |
I don't have it working yet.
| freelanceCMS wrote: |
If not you can do it yourself, all you have to do is sign up (free) with the URL provided below
www.emailmeform.com
let me know if this works and also given i get some free time within the next few days i will see if i can get it working for you, time is the only thing stopping me at the moment |
Looks really good - thanks. Unfortunately, I don't have much time at the moment to get this implemented. If you were to do it for me (add the captcha to the code I've already supplied) using this method, I'd still give you the 400FRIH$ as offered above.
Please let me know if you can do this - I'm really keen to have this implemented as soon as possible.
hey mate, hows this going? anyone been able to do this yet.
Im most likely available to do it now that Uni is on semester break, I plan to install skalinks onto my web server and see if we cant do this for you.
Cheers,
Nick
EDIT: Damn thats a tough one
| freelanceCMS wrote: |
| anyone been able to do this yet. |
Nope - my directory is still getting several hundred spam listing submissions a week.
| freelanceCMS wrote: |
Im most likely available to do it now that Uni is on semester break, I plan to install skalinks onto my web server and see if we cant do this for you.
EDIT: Damn thats a tough one |
That sounds great - thanks. I'd be most interested to see what you can come up with.
Quick bump on this topic - I've still not had any working submissions, so can anyone offer a php redesign to include a captcha on my directory?
Thanks 
I am going to give it a try. Did some php-images before, shouldn't be too hard.. I hope.
| rvec wrote: |
| I am going to give it a try. Did some php-images before, shouldn't be too hard.. I hope. |
Thanks very much! Let me know how you get on - I look forward to any solution you can come up with.
I have a script working to make the image with a random string made from A-Z and 1-9 (no 0). You can see my progress on http://www.bierkip.nl/link/test.php
Edit: I screwed up a lot now. Working on it tomorrow again. I hope I will get some better ideas in the mean time or there is someone else who can do better.
I got a bit stuck. I will try again in a couple of days, maybe I will think of something.
| rvec wrote: |
| I got a bit stuck. I will try again in a couple of days, maybe I will think of something. |
Ok, thanks for all your efforts - please let me know how you get on regardless of outcome.
Thanks again, 
I'm currently having a go, the stupid script doesn't well on my comp though (darn SkaLinks, even a rubbish name!
)
btw if anyone gets it done he/she should post it on the skalinks forum to make a lot more people happy.
Here is how I would do it:
- Seen as a custom script is almost un-hackable the solution doesn't have to be very complex
- Spambots don't understand javascript
- ...therefore just add document.write stuff around the entire submit form
- You could even include the form from a remote javascript file
- And also rename the file that the links are submitted too - (and fix references wherever they are) This way bots that don't even use the form, but just submit based on knowing how a skalinks list works won't be able to find the submit file.
...So in conclusion, try just adding:
| Code: |
| <script type="text/javascript">document.write('######');</script> |
...around your form, and seeing if that blocks the spammers. If it doesn't, rename files aswel.
If that still doesn't work, I'll use the database based captcha module from my blog
Keep me updated on how you go.
- Luke