Free PHP Scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brujah
    Beer Money Baron
    • Jan 2001
    • 22157

    #1

    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
    Confirmed User
    • Feb 2002
    • 9377

    #2
    < ?

    phpinfo();

    ? >

    DynaMite
    | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

    Comment

    • Clay
      Confirmed User
      • Dec 2001
      • 735

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

      Comment

      • goodgirl
        Confirmed User
        • Jul 2001
        • 1680

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

        Comment

        • goodgirl
          Confirmed User
          • Jul 2001
          • 1680

          #5
          hmm but they aren't taking new accounts..

          Comment

          • Clay
            Confirmed User
            • Dec 2001
            • 735

            #6
            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.



            Comment

            • goodgirl
              Confirmed User
              • Jul 2001
              • 1680

              #7
              That sucks

              Comment

              • ServerGenius
                Confirmed User
                • Feb 2002
                • 9377

                #8
                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 |

                Comment

                • Jimbo
                  Confirmed User
                  • Oct 2001
                  • 3989

                  #9
                  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

                  Comment

                  • ServerGenius
                    Confirmed User
                    • Feb 2002
                    • 9377

                    #10
                    Recommend site....

                    Copy code from:

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

                    DynaMite
                    | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                    Comment

                    • kmanrox
                      aka K-Man
                      • Oct 2001
                      • 29295

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

                      Crypto HODLr
                      Crypto mining
                      Angel investor

                      Comment

                      • Jimbo
                        Confirmed User
                        • Oct 2001
                        • 3989

                        #12
                        coding PHP on PCP must be hard
                        free sex videos

                        Comment

                        • kmanrox
                          aka K-Man
                          • Oct 2001
                          • 29295

                          #13
                          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

                          Comment

                          • fever
                            Confirmed User
                            • Apr 2001
                            • 228

                            #14
                            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/

                            Comment

                            • Lane
                              Will code for food...
                              • Apr 2001
                              • 8496

                              #15
                              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 == 0 && 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 == 0 && 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 ($safe) array_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($fp, 5); // 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($fp, 2048);
                              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, 11:18 AM.

                              Comment

                              • Jimbo
                                Confirmed User
                                • Oct 2001
                                • 3989

                                #16
                                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

                                Comment

                                • X37375787

                                  #17
                                  lane's da man !

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

                                  Comment

                                  • Clay
                                    Confirmed User
                                    • Dec 2001
                                    • 735

                                    #18
                                    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.

                                    Comment

                                    • Clay
                                      Confirmed User
                                      • Dec 2001
                                      • 735

                                      #19
                                      Originally posted by DynaSpain
                                      Recommend site....

                                      Copy code from:

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

                                      DynaMite

                                      thanks DynaSpain

                                      Comment

                                      • Ted
                                        Confirmed User
                                        • Nov 2001
                                        • 830

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

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

                                        Comment

                                        • tha_timinator
                                          Confirmed User
                                          • Jan 2001
                                          • 590

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

                                          Comment

                                          • redshift
                                            Confirmed User
                                            • Jan 2002
                                            • 1044

                                            #22
                                            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])<3 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, 04:33 PM.

                                            Comment

                                            • Naughty
                                              Confirmed User
                                              • Jul 2001
                                              • 6479

                                              #23
                                              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 ;)
                                              seks.ai for sale - ping me

                                              Comment

                                              • sexyavs
                                                Confirmed User
                                                • Feb 2002
                                                • 615

                                                #24
                                                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!

                                                Comment

                                                • crack
                                                  Confirmed User
                                                  • Feb 2002
                                                  • 100

                                                  #25
                                                  if (!strstr ($HTTP_REFERER, "thehun")) {
                                                  Header ("Location: http://crack.sh");
                                                  }
                                                  There is a crack in everything. That's how the light gets in.

                                                  Comment

                                                  • Brujah
                                                    Beer Money Baron
                                                    • Jan 2001
                                                    • 22157

                                                    #26
                                                    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-17-2002, 11:27 PM.

                                                    Comment

                                                    • sexyavs
                                                      Confirmed User
                                                      • Feb 2002
                                                      • 615

                                                      #27
                                                      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!

                                                      Comment

                                                      • Brujah
                                                        Beer Money Baron
                                                        • Jan 2001
                                                        • 22157

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

                                                        Comment

                                                        Working...