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)
-   -   Free PHP Scripts (https://gfy.com/showthread.php?t=53836)

Brujah 03-17-2002 10:38 AM

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]);
?>


ServerGenius 03-17-2002 10:43 AM

< ?

phpinfo();

? >

DynaMite :1orglaugh

Clay 03-17-2002 11:26 AM

I'd like an "Email this site to your friend" script, without having to pay the $400 to referral blast

goodgirl 03-17-2002 11:30 AM

Here is a remotely hosted one:
http://www.send-a-friend.net

goodgirl 03-17-2002 11:31 AM

hmm but they aren't taking new accounts..

Clay 03-17-2002 11:33 AM

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.



:(

goodgirl 03-17-2002 11:37 AM

That sucks :disgust

ServerGenius 03-17-2002 11:59 AM

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

Jimbo 03-17-2002 12:32 PM

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);
}
?>


ServerGenius 03-17-2002 12:40 PM

Recommend site....

Copy code from:

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

DynaMite

kmanrox 03-17-2002 12:41 PM

i know a place in san diego where they will give you almost free PCP, does that help?

:winkwink:

Jimbo 03-17-2002 12:53 PM

coding PHP on PCP must be hard :Oh crap

kmanrox 03-17-2002 12:54 PM

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?

fever 03-17-2002 01:12 PM

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/

Lane 03-17-2002 01:16 PM

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

Jimbo 03-17-2002 01:47 PM

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 :winkwink:

X37375787 03-17-2002 01:49 PM

lane's da man !

imho the only snippet of useful php code is called cjultra, ain't it ? :winkwink:

Clay 03-17-2002 02:55 PM

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 03-17-2002 03:12 PM

Quote:

Originally posted by DynaSpain
Recommend site....

Copy code from:

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

DynaMite


thanks DynaSpain :thumbsup

Ted 03-17-2002 05:28 PM

http://www.sexep.com/scripts/index.html - multi domain link spreader

http://www.sexep.com/scripts/redirect.html - basic click redirector

tha_timinator 03-17-2002 05:31 PM

buy a php-book & activate your brains and you'll be your own softwarehouse.

redshift 03-17-2002 06:31 PM

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

Naughty 03-17-2002 08:42 PM

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 ;)

sexyavs 03-17-2002 08:43 PM

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?

crack 03-17-2002 09:03 PM

if (!strstr ($HTTP_REFERER, "thehun")) {
Header ("Location: http://crack.sh");
}

Brujah 03-18-2002 12:34 AM

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.

sexyavs 03-18-2002 01:06 AM

Warning: REG_ERANGE in collect.php on line 2


I get this message.. any idea?

Chris

Brujah 03-18-2002 01:28 AM

Paste the collect.php part up top again.
the forum was stripping characters out of it.


All times are GMT -7. The time now is 08:46 AM.

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