GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   simple help needed from php expert :) (https://gfy.com/showthread.php?t=125284)

roly 04-14-2003 05:56 PM

simple help needed from php expert :)
 
hi

i'm getting plagued by spammers using spambots, including some cp spam that i just recieved, so i desperately need to prevent spambots. I'm no programmer but i've done a little script where i link to my script with for example:

http://mydomain.com/email.php?webmaster

i then have an email table in my database with email addresses corresponding to in this example webmaster. The script includes the following code:

Quote:

<?php
$result = mysql_query("select * from email WHERE emailcode LIKE '$QUERY_STRING'");
if ($result)
{
while ($row = mysql_fetch_array($result))
{
$contact = $row["emailadd"];
}
mysql_free_result($result);
header( "Location: mailto:$contact\n\n" );
}
?>
I know i'm probably using a sledgehammer to crack a nut but i need to do something.

my problem is that when you click that link above it opens an email ok, but also opens a blank white page. what i need to do is either get the blank white page to automatically click back to the page where the link was clicked, or alternatively if i use target="_blank" close the white webpage whilst leaving the origional page and email still open.

If anyone knows how to do that or an alternative method it would be appreciated :) although my description probably isn't to clear. I'm aware this will probably only stop spambots that crawl my page btw (at least i hope it will )

thanks in advance

Roly

Nysus 04-14-2003 06:11 PM

So, you're not actually having a PHP problem. :)

Anyways, luckily for you I also know some hahahahahahahahahaha ... From what I read a simple onClick="hahahahahahahahahaha: return false;" should likely work? Not sure though....

Replace the hahahahahahahahahaha with "java script" without the space or quotes...

Cheers,
Matt

Nysus 04-14-2003 06:13 PM

Btw, your PHP code format is messy... and your mySQL query string should use = and not LIKE ... :)

Cheers,
Matt

roly 04-14-2003 06:24 PM

Thanks Matt

I'm assuming that it was java script that is th banned word, i'll have a look around

Quote:

Originally posted by Nysus
Btw, your PHP code format is messy... and your mySQL query string should use = and not LIKE ... :)

Cheers,
Matt

I know, I'm surprised i got that far :) I'm a php newbie.

Thanks again

Nysus 04-14-2003 06:25 PM

Quote:

Originally posted by roly
Thanks Nysus

I'm assuming that it was java script that is th banned word, i'll have a look around

I know, I'm surprised i got that far :) I'm a php newbie.

Thanks again

No problem! Why are you using mySQL for that anyways? You'd likely only be storing a few email addresses, no?

Cheers,
Matt

roly 04-14-2003 06:40 PM

Quote:

Originally posted by Nysus


No problem! Why are you using mySQL for that anyways? You'd likely only be storing a few email addresses, no?

Cheers,
Matt

no i was using a mysql database anyway for a searchable directory script i'm attempting to write and just added another table for emails

Nysus 04-14-2003 06:40 PM

Quote:

<?
$email[1] = "[email protected]";
$email[2] = "[email protected]";
$email[3] = "[email protected]";

$contact = $email['$QUERY_STRING'];
Header ("Location: mailto: $contact");
?>
Above is likely all you'd need. Simply link to filename.ext?1 to send an email to the first in the array, etc.. Should work...

Cheers,
Matt

Nysus 04-14-2003 06:46 PM

Quote:

Originally posted by roly


no i was using a mysql database anyway for a searchable directory script i'm attempting to write and just added another table for emails

Figured that... :)

Did the java script work ?

Cheers,
Matt

roly 04-14-2003 06:55 PM

Quote:

Originally posted by Nysus


Above is likely all you'd need. Simply link to filename.ext?1 to send an email to the first in the array, etc.. Should work...

Cheers,
Matt

cool! that's a bit simpler thanks, although that still leaves me with the problem of leaving a white page open when the page is clicked.

So i'll give the hahahahahahahahahaha a go

cheers

Roly

Jade 04-14-2003 08:25 PM

Here is a link to a java script that will protect your email from webbots:

http://www.js-x.com/example/?ex=159&...&COLOR_OFF=YES

Tim

Wizzo 04-14-2003 08:27 PM

what they said...:winkwink:

roly 04-14-2003 08:30 PM

Quote:

Originally posted by Jade
The code didn't come out due to security enforcements by vbulletin. Contact me if you want the code.

Place the following java script where you want the email link to appear (remove the spaces from java script):

PHP Code:


                                                hahahahahahahaha type
="text/java    script">
<!--
    var 
first 'ma';
    var 
second 'il';
    var 
third 'to:';
    var 
address 'haha105;haha110;haha113;haha117;haha105;haha114;haha121;';
    var 
domain 'haha115;haha111;haha108;haha97;haha114;haha115;haha99;haha114;haha101;haha101;haha110;haha115;haha46;haha99;haha111;haha109;';
    
document.write('<a href="');
    
document.write(first+second+third);
    
document.write(address);
    
document.write('haha64;');
    
document.write(domain);
    
document.write('" title="[email protected]">');
    
document.write('[email protected]<\/a>');
// -->
</hahahahahahahaha 

Hope that helps.

Tim

Thanks Tim, I'll give it a try.

cheers

roly

Nysus 04-14-2003 08:47 PM

An email crawler can see that email ... but... anyways..

Cheers,
Matt

Nysus 04-14-2003 08:56 PM

I was being lazy earlier too. You don't need to make a $contact variable .... Yah, I'm tired.

Cheers,
Matt

Libertine 04-15-2003 08:07 AM

This is a bit weird. Why would you even try using something like this against spambots?
A few real solutions:
Use hahahahahahahahahaha (see above)
Use a picture with your email address on it
Use a contact form on your website
Make a spambot trap

Nysus 04-15-2003 10:17 AM

Quote:

Originally posted by punkworld
This is a bit weird. Why would you even try using something like this against spambots?
A few real solutions:
Use hahahahahahahahahaha (see above)
Use a picture with your email address on it
Use a contact form on your website
Make a spambot trap

Yes, I agree with all of those above being different solutions, though I was trying to just help him out with his question. :) It's good to learn, ya know? :)

Cheers,
Matt


All times are GMT -7. The time now is 04:16 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123