Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-17-2002, 10:38 AM   #1
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Free PHP Scripts

Post your useful php snippets or code here.

This code below, reads from a list of url's in a text file.
It uses cookies.
The person visiting or clicking your link to this file will see the first url in your text file, then next visit, will see the next.. and so on.

Useful for showing different galleries, sending to different sponsors, good with 404 pages, etc.

Code:
<?php
$domain = 'adultdomain.com';
$list = 'urls.txt';
$cookiedays = 7;

/* code below - be careful editing */
$urls = @file($list);
$x = count($urls);

if( !isset($visited) || $visited >= $x ) $visited = 0;
setcookie("visited", ++$visited, time()+($cookiedays*86400), '', ".$domain", 0);
header('Location: ' .$urls[$visited]);
?>
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 10:43 AM   #2
ServerGenius
Confirmed User
 
Join Date: Feb 2002
Location: Amsterdam
Posts: 9,377
< ?

phpinfo();

? >

DynaMite
__________________
| http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |
ServerGenius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:26 AM   #3
Clay
Confirmed User
 
Join Date: Dec 2001
Posts: 735
I'd like an "Email this site to your friend" script, without having to pay the $400 to referral blast
Clay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:30 AM   #4
goodgirl
Confirmed User
 
goodgirl's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: Behind the monitor since 1988
Posts: 1,679
Here is a remotely hosted one:
http://www.send-a-friend.net
__________________
Got Web Host providing Website Hosting since 2002.
goodgirl is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:31 AM   #5
goodgirl
Confirmed User
 
goodgirl's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: Behind the monitor since 1988
Posts: 1,679
hmm but they aren't taking new accounts..
__________________
Got Web Host providing Website Hosting since 2002.
goodgirl is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:33 AM   #6
Clay
Confirmed User
 
Join Date: Dec 2001
Posts: 735
Quote:
Originally posted by goodgirl
Here is a remotely hosted one:
http://www.send-a-friend.net
Due to a minority of users abusing our system.
We are no longer accepting new sign-up requests until further notice.



Clay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:37 AM   #7
goodgirl
Confirmed User
 
goodgirl's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: Behind the monitor since 1988
Posts: 1,679
That sucks
__________________
Got Web Host providing Website Hosting since 2002.
goodgirl is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 11:59 AM   #8
ServerGenius
Confirmed User
 
Join Date: Feb 2002
Location: Amsterdam
Posts: 9,377
Ok I'll be nice for a change.....hold you're breath for a bit....
check back in 30 minutes or so and I'll have it for ya

DynaMite
__________________
| http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |
ServerGenius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 12:32 PM   #9
Jimbo
Confirmed User
 
Industry Role:
Join Date: Oct 2001
Location: Montreal
Posts: 3,989
PHP Code:
echo "Hello World!"
ok a banner rotator for files like this:

imagename|extension|http://sponsorurl.com

for example:

advert1|gif|http://www.disney.com

ok heres the code: (I coded it so it's not stolen as you may think)

PHP Code:
<?
$filepath="/path/to/your/file.dat";
$banner_url="http://url.com/banners/images";

$nb_banners=0;
$fo = fopen($filepath,"r");
while (!feof($fo))

   $fo_array[$i] = fgets($fo,4096);
  if ($fo_array[$i] != "")
   $i++;
}
fclose($fo);
$nb_banners = $i - 1;
mt_srand(make_seed());
$randval = mt_rand(1,$nb_banners);

$result = explode("|",$fo_array[$randval]);

echo "<a target='_top' href='$result[2]'><img src='$banner_url/$result[0].$result[1]' border='1'></a>";

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
?>
__________________
free sex videos
Jimbo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 12:40 PM   #10
ServerGenius
Confirmed User
 
Join Date: Feb 2002
Location: Amsterdam
Posts: 9,377
Recommend site....

Copy code from:

http://www.dynamite.st/tell.phps

DynaMite
__________________
| http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |
ServerGenius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 12:41 PM   #11
kmanrox
aka K-Man
 
kmanrox's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: The Gutter
Posts: 29,291
i know a place in san diego where they will give you almost free PCP, does that help?

__________________
Crypto HODLr
Crypto mining
Angel investor
kmanrox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 12:53 PM   #12
Jimbo
Confirmed User
 
Industry Role:
Join Date: Oct 2001
Location: Montreal
Posts: 3,989
coding PHP on PCP must be hard
__________________
free sex videos
Jimbo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 12:54 PM   #13
kmanrox
aka K-Man
 
kmanrox's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: The Gutter
Posts: 29,291
perhaps your PHP would be really KILLER if coded while on PCP while posting on a BBS about free PHP while on PCP, know what I mean? LMK, OK? TTYL, cuz I'll BBIAB, K?
__________________
Crypto HODLr
Crypto mining
Angel investor
kmanrox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 01:12 PM   #14
fever
Confirmed User
 
Join Date: Apr 2001
Location: Sweden
Posts: 228
Quote:
Originally posted by Clay
I'd like an "Email this site to your friend" script, without having to pay the $400 to referral blast
Check this out, havent tried it but... http://www.shavenferret.com/scripts/tgpost/
fever is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 01:16 PM   #15
Lane
Will code for food...
 
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
a gallery checker that i wrote the other day:

PHP Code:
<?php
set_time_limit
(600);
echo 
"CHECKING<br><br><br>\n";
$urls file("galleries.txt");


$safelist = Array();
for (
$i 0$i sizeof($urls); $i++)
{
    
$line $i+1;
    
$url trim($urls[$i]);
    
$url_arr parse_url($url);
    
$header get_headers($url_arr[host],$url_arr[path]);
    
    
$safe 1;
    
    if (!
$header)
    {
        echo 
"Line <strong>$line</strong> - Url: $url - <strong>Connection Failed or Timed Out</strong><br><br>\n";
        
$safe=0;
    }
    else
    {
        for (
$j 0$j sizeof($header); $j++)
        {    
            if (
$j == && ereg("404"$header[$j]))
                {
$safe=0;echo "Line <strong>$line</strong> - Url: $url - <strong>404</strong> Header found - Full header:<br><small>" . (implode("<br>",$header)) . "</small><br><br>\n";}
            else if (
$j == && ereg("302"$header[$j]))
                {
$safe=0;echo "Line <strong>$line</strong> - Url: $url - <strong>302</strong> Header found - Full header:<br><small>" . (implode("<br>",$header)) . "</small><br><br>\n";}
            if (
ereg("^Location:",$header[$j])) 
                {
$safe=0;echo "Line <strong>$line</strong> - Url: $url - <strong>Forwards</strong> to $header[$j]<br><br>\n";}
        }
    }
    
    if (
$safearray_push($safelist,$url);
}

$safelist array_unique($safelist);

echo 
"<br><br>
SAFE LIST<br><br>\n" 
. (implode("<br>\n",$safelist));




function 
get_headers($host$path "/")
{
$fp fsockopen ("$host"80, &$errnr, &$errstr);
if (!
$fp) return 0;
socket_set_timeout($fp5); // TIMEOUT SET TO 5 SECONDS
$request_header "GET $path HTTP/1.1
Accept: */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
Host: 
$host
Connection: close

"
;
fputs($fp,$request_header);
for (
$i=0;!$end;$i++)
{
$line fgets($fp2048);
if (
trim($line) == "")
$end true;
else {
$header[$i] = $line;
}
}
fclose($fp);
return 
$header;
}
?>

it's kinda slow because it allows up to 5 seconds connection timeout per gallery (you can change it in the code) . i have over 200 galleries in a file and it takes about 3 minutes to check all.

the script will output 404, forwarding, or broken gallery links with detailed info, then it will output a list of safe galleries.

cheers,
Lane
__________________

Last edited by Lane; 03-17-2002 at 01:18 PM..
Lane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 01:47 PM   #16
Jimbo
Confirmed User
 
Industry Role:
Join Date: Oct 2001
Location: Montreal
Posts: 3,989
Quote:
Originally posted by kmanrox
perhaps your PHP would be really KILLER if coded while on PCP while posting on a BBS about free PHP while on PCP, know what I mean? LMK, OK? TTYL, cuz I'll BBIAB, K?
Sounds like too much multitasking for a PCP guy
__________________
free sex videos
Jimbo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 01:49 PM   #17
X37375787
Guest
 
Posts: n/a
lane's da man !

imho the only snippet of useful php code is called cjultra, ain't it ?
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 02:55 PM   #18
Clay
Confirmed User
 
Join Date: Dec 2001
Posts: 735
How about a php counter? Is it possible for it to reset at midnight?

My sextracker, paycounter and foxcounter all say 3 completely different numbers.
Clay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 03:12 PM   #19
Clay
Confirmed User
 
Join Date: Dec 2001
Posts: 735
Quote:
Originally posted by DynaSpain
Recommend site....

Copy code from:

http://www.dynamite.st/tell.phps

DynaMite

thanks DynaSpain
Clay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 05:28 PM   #20
Ted
Confirmed User
 
Join Date: Nov 2001
Posts: 830
http://www.sexep.com/scripts/index.html - multi domain link spreader

http://www.sexep.com/scripts/redirect.html - basic click redirector
Ted is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 05:31 PM   #21
tha_timinator
Confirmed User
 
Join Date: Jan 2001
Location: Amsterdam, the Netherlands
Posts: 590
buy a php-book & activate your brains and you'll be your own softwarehouse.
__________________
CELEBRITYSTART.COM
tha_timinator is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 06:31 PM   #22
redshift
Confirmed User
 
Join Date: Jan 2002
Location: anus fuckin' yo mama
Posts: 1,044
PHP Code:
<?php
srand
((double)Microtime()*1e6);
echo 
"<table width=800 >";
$index=-1;
echo  
"<tr>";
for (
$c=1;$c<=4;$c++)
{
$index++;
$urlfile=file("galleries.txt");
echo 
"<td valign=top  border=1 nowrap width=25%>";
for (
$z=0;$z<=50;$z++) #number of galleries per td
{

do{
$ru=rand(0,count($urlfile));
}
while(
strlen($urlfile[$ru])<or $saveru==$ru);
$gal=explode(",",$urlfile[$ru]);

if (
strlen($gal[0])==1)
{
$gal[0]="0".$gal[0];
}
if (
strlen($gal[2])>25)
{
$gal[2]=substr($gal[2],0,25)."...  ";
}
echo 
"<b><font color=yellow>",$gal[0]," </font></b>","<a href=/cjultra/out.php?url=",$gal[1],"&link=gal&s=70&first=1 target=\"_new\
$saveru=$ru;
}
echo "
<br></td>";
}
echo "
</tr>";



?>



this is a script that I hacked together the other night.
it randomly selects galleries and outputs them in a 4x1 table
put your url's in "galleries.txt"
in this format
12,http://www.galleryurl.com,description

I did this so I wouldn't have to update the tgp so often

Last edited by redshift; 03-17-2002 at 06:33 PM..
redshift is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 08:42 PM   #23
Naughty
Confirmed User
 
Industry Role:
Join Date: Jul 2001
Location: Utopia
Posts: 6,480
Quote:
Originally posted by Clay
My sextracker, paycounter and foxcounter all say 3 completely different numbers.
Maybe add www.tgp2stats.com counter and you can see how many the other 3 are off ;)
Naughty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 08:43 PM   #24
sexyavs
Confirmed User
 
Join Date: Feb 2002
Posts: 615
brujah,


I remember someone asked you about a 4 lines of php code that will allow users to submit their email address and save it to a file or soemthing?

You still have that?
__________________
<br>
<a href="http://www.sexypassport.com/webmaster/webmaster.php?siteid=752359">Join the Highest Paying FREE AVS. </a><br>
<a href="http://nakedpass.com/webmaster/webmaster.php">Naked Pass New FREE Avs Also Pays $20.00 Per FREE Signup!! </a><br>
Have you checked out <a href="http://makefuckingmoney.com">Make Fucking Money!</a> Get Paid on FREE Memberships!
sexyavs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2002, 09:03 PM   #25
crack
Confirmed User
 
Join Date: Feb 2002
Posts: 100
if (!strstr ($HTTP_REFERER, "thehun")) {
Header ("Location: http://crack.sh");
}
__________________
There is a crack in everything. That's how the light gets in.
crack is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-18-2002, 12:34 AM   #26
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Quote:
Originally posted by sexyavs
brujah,


I remember someone asked you about a 4 lines of php code that will allow users to submit their email address and save it to a file or soemthing?

You still have that?

Make a form like this one
&lt;form action="collect.php" method="post"&gt;
&lt;input type="text" name="email"&gt;&lt;br /&gt;
&lt;input type="submit" value="Subscribe"&gt;
&lt;/form&gt;

Then a php file named collect.php like this:
Code:
&lt;?php
if ( eregi( '^[-!#$%&\\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email )  )
{
    $fp=fopen('email.txt','a+');
    if($fp) {
        fwrite($fp,"$email\n");
        fclose($fp);
    }
}
?&gt;
You'll need a file like 'email.txt' with permission to write to it.
There isn't a lot of validation, but it'll log all the email addresses being entered.
__________________

Last edited by Brujah; 03-18-2002 at 01:27 AM..
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-18-2002, 01:06 AM   #27
sexyavs
Confirmed User
 
Join Date: Feb 2002
Posts: 615
Warning: REG_ERANGE in collect.php on line 2


I get this message.. any idea?

Chris
__________________
<br>
<a href="http://www.sexypassport.com/webmaster/webmaster.php?siteid=752359">Join the Highest Paying FREE AVS. </a><br>
<a href="http://nakedpass.com/webmaster/webmaster.php">Naked Pass New FREE Avs Also Pays $20.00 Per FREE Signup!! </a><br>
Have you checked out <a href="http://makefuckingmoney.com">Make Fucking Money!</a> Get Paid on FREE Memberships!
sexyavs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-18-2002, 01:28 AM   #28
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Paste the collect.php part up top again.
the forum was stripping characters out of it.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.