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 07-24-2008, 07:29 AM   #1
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,676
All you clever coder types ! Beginners PHP Question

Just starting 'learning' PHP...

Can a more experienced coder show me the way?

What Im looking to do, is to have a sig on a surfer forum that reads 'CLICK HERE! LUCKY DIP!'

They click the link it goes to one-of-my-domians.com/php-page.php

That php page has 3 or 5 different URLs programmed into it... ie domain-1.com/blog/ domain-2.com/sexygirls/index.html and domain-3.com etc etc...

When the sig clicking surfer hits the php page at one-of-my-domians.com/php-page.php it randomly chooses one of the 3 or 5 domains, and sends him to it... In other words, per click each domain has a 1 in 3 or 1 in 5 chance of getting the 'hit'...

I'm not interested in 'Weighting' the results... Im just trying to learn the simplest, cleanest way to use PHP to split the results 'randomly' ?

Whats the right PHP to do this a simple as poss?

Be gentle with me LOL I'm genuinely TRYING to learn, and we all have to start somewhere !
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 07:32 AM   #2
JayS
Confirmed User
 
JayS's Avatar
 
Join Date: Oct 2007
Posts: 138
Quote:
Originally Posted by ThatGuyInTheCorner View Post
Be gentle with me LOL I'm genuinely TRYING to learn, and we all have to start somewhere !
http://php.net/array_rand
JayS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 07:38 AM   #3
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
I do it like this:

<?
$urls = file ("random.txt"); //replace with the name of your file
srand(time());
$count = count($urls);
$random = (rand()%$count);
Header("Location: $urls[$random]");
?>

random.txt contains a list of URLs.

You could put the URLs into an array in the code if you prefer. I have them in a separate file so I can use them from other code.

Example is in my sig.



mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 08:01 AM   #4
gornyhuy
Chafed.
 
gornyhuy's Avatar
 
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
What mikey said, but if you don't wanna use a file for the urls, here's an easy way to do the arrray:

<?
$linkArray[0]="http://www.google.com";
$linkArray[1]="http://www.yahoo.com.com";
srand(time());
$count = count($linkArray);
$random = (rand()&#37;$count);
Header("Location: $linkArray[$random]");
?>
__________________

icq:159548293
gornyhuy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 08:04 AM   #5
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Quote:
Originally Posted by mikeyddddd View Post
I do it like this:

<?
$urls = file ("random.txt"); //replace with the name of your file
srand(time());
$count = count($urls);
$random = (rand()&#37;$count);
Header("Location: $urls[$random]");
?>

random.txt contains a list of URLs.

You could put the URLs into an array in the code if you prefer. I have them in a separate file so I can use them from other code.

Example is in my sig.



this is pretty much the best way to do it, personally i'd just make the code like this if you just need simple

PHP Code:
<?php
$urls 
file("./random.txt");
exit(
header("Location: " $urls[rand(0, (count($urls)-1))]));
?>
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 10:00 AM   #6
tranza
ICQ: 197-556-237
 
Join Date: Jun 2003
Location: BRASIL !!!
Posts: 57,559
Man this is crazy!!
__________________
I'm just a newbie.
tranza is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 10:02 AM   #7
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
You tricky script kiddies you...
__________________

I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 10:13 AM   #8
plsureking
bored
 
plsureking's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: PORNCMS.com
Posts: 4,782
wanna sell those clicks? lol
__________________
#
plsureking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 11:43 AM   #9
BigBen
Confirmed User
 
Join Date: Nov 2004
Location: scv
Posts: 2,299
Code:
$urls = file('urls.txt');
header("Location: " . array_rand($urls));
BigBen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 12:52 PM   #10
d-null
. . .
 
d-null's Avatar
 
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
Quote:
Originally Posted by tranza View Post
Man this is crazy!!
I see nothing of the sort here
__________________

__________________

Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
Check out the #1 WordPress SEO Plugin: CyberSEO Suite
d-null is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 01:27 PM   #11
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
I was just notified about this thread and thought I would come in with what I use across my huge network of highly redundant traffic nodes. Advanced eyes only.

Code:
<?php
$domain_base_url = 'http://www.yourdomain.com/';
$randomized_urls = file($domain_base_url . 'files/urls.txt');

$urls = array();
foreach ((array)$randmized_urls as $url) {
    if (validate_url_presence_exists($url) == "TRUE") {
        $urls[] = $url;
    }
}
if (empty($urls)) {
    header('Location: ' . $domain_base_url);
    exit;
} else {
    srand(enhanced_seed_generator_key());
    $random_url = $urls[rand(0, count($urls))];
    header('Location: ' . $random_url);
    exit;
}

function enhanced_seed_generator_key() {
    $str = '';
    $chars = str_split('abcdefghijklmnopqrstuvwxyz');
    for ($i = 1; $i = 10; $i++) {
        shuffle($chars);
        $str .= $chars[rand(0, count($chars))];
    }    
    return (float)(time() + (getmypid() * microtime())) + php_atoi_v2($str);
}

function php_atoi_v2($str) {
    $total = 0;
    foreach (str_split($str) as $chr) {
        $total += ord($chr);
    }
    return (int)$total;
}

function validate_url_presence_exists($url) {
    $ch = curl_init();
    curl_setopt($ch, curlOPT_URL, $url);
    curl_setopt($ch, curlOPT_NOBODY, true);
    curl_setopt($ch, curlOPT_CONNECTTIMEOUT, 2);
    curl_setopt($ch, curlOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, curlOPT_HEADER, true);
    $res = curl_exec($ch);
    curl_close($ch);
    return false if $res === false;
    $code = explode($res);
    return $code[1] == '200' ? "TRUE" : "FALSE";
}
?>
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 01:31 PM   #12
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
See sig.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:00 PM   #13
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
I was just notified about this thread and thought I would come in with what I use across my huge network of highly redundant traffic nodes. Advanced eyes only.

Code:
<?php
$domain_base_url = 'http://www.yourdomain.com/';
$randomized_urls = file($domain_base_url . 'files/urls.txt');

$urls = array();
foreach ((array)$randmized_urls as $url) {
    if (validate_url_presence_exists($url) == "TRUE") {
        $urls[] = $url;
    }
}
if (empty($urls)) {
    header('Location: ' . $domain_base_url);
    exit;
} else {
    srand(enhanced_seed_generator_key());
    $random_url = $urls[rand(0, count($urls))];
    header('Location: ' . $random_url);
    exit;
}

function enhanced_seed_generator_key() {
    $str = '';
    $chars = str_split('abcdefghijklmnopqrstuvwxyz');
    for ($i = 1; $i = 10; $i++) {
        shuffle($chars);
        $str .= $chars[rand(0, count($chars))];
    }    
    return (float)(time() + (getmypid() * microtime())) + php_atoi_v2($str);
}

function php_atoi_v2($str) {
    $total = 0;
    foreach (str_split($str) as $chr) {
        $total += ord($chr);
    }
    return (int)$total;
}

function validate_url_presence_exists($url) {
    $ch = curl_init();
    curl_setopt($ch, curlOPT_URL, $url);
    curl_setopt($ch, curlOPT_NOBODY, true);
    curl_setopt($ch, curlOPT_CONNECTTIMEOUT, 2);
    curl_setopt($ch, curlOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, curlOPT_HEADER, true);
    $res = curl_exec($ch);
    curl_close($ch);
    return false if $res === false;
    $code = explode($res);
    return $code[1] == '200' ? "TRUE" : "FALSE";
}
?>

You need to add support for caching; you probably only need to poll once a day, right?

Here, have some functions:

Code:
 function read_cachefile($url = FALSE) {
   if (function_exists('file_get_contents')) {
     $array = file_get_contents($url);
   } else {
      $array = "";
      if (file_exists($url)) {
        $fp = fopen($url, 'r');
        while (!FEOF($fp)) {
          $array .= fread($fp, 4096);
        }
        fclose($fp);
      }
    }
    return ($array ? unserialize($array) : FALSE);
  }

  function beginDay($date = FALSE) {
    $date = (isset($date)) ? strtotime($date) : time();
    return date("U", mktime(0, 0, +1, date("m", $date), date("d", $date), date("Y", $date)));
  }
HOPE THAT HELPS
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:08 PM   #14
Sands
Confirmed User
 
Sands's Avatar
 
Join Date: Feb 2007
Location: 418194907
Posts: 3,134
Quote:
Originally Posted by mrkris
<?php
$domain_base_url = 'http://www.yourdomain.com/';
$randomized_urls = file($domain_base_url . 'files/urls.txt');

$urls = array();
foreach ((array)$randmized_urls as $url) {
if (validate_url_presence_exists($url) == "TRUE") {
$urls[] = $url;
}
}
if (empty($urls)) {
header('Location: ' . $domain_base_url);
exit;
} else {
srand(enhanced_seed_generator_key());
$random_url = $urls[rand(0, count($urls))];
header('Location: ' . $random_url);
exit;
}

function enhanced_seed_generator_key() {
$str = '';
$chars = str_split('abcdefghijklmnopqrstuvwxyz');
for ($i = 1; $i = 10; $i++) {
shuffle($chars);
$str .= $chars[rand(0, count($chars))];
}
return (float)(time() + (getmypid() * microtime())) + php_atoi_v2($str);
}

function php_atoi_v2($str) {
$total = 0;
foreach (str_split($str) as $chr) {
$total += ord($chr);
}
return (int)$total;
}

function validate_url_presence_exists($url) {
$ch = curl_init();
curl_setopt($ch, curlOPT_URL, $url);
curl_setopt($ch, curlOPT_NOBODY, true);
curl_setopt($ch, curlOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, curlOPT_FOLLOWLOCATION, true);
curl_setopt($ch, curlOPT_HEADER, true);
$res = curl_exec($ch);
curl_close($ch);
return false if $res === false;
$code = explode($res);
return $code[1] == '200' ? "TRUE" : "FALSE";
}
?>
Quote:
Originally Posted by GrouchyAdmin View Post
You need to add support for caching; you probably only need to poll once a day, right?

Here, have some functions:

Code:
 function read_cachefile($url = FALSE) {
   if (function_exists('file_get_contents')) {
     $array = file_get_contents($url);
   } else {
      $array = "";
      if (file_exists($url)) {
        $fp = fopen($url, 'r');
        while (!FEOF($fp)) {
          $array .= fread($fp, 4096);
        }
        fclose($fp);
      }
    }
    return ($array ? unserialize($array) : FALSE);
  }

  function beginDay($date = FALSE) {
    $date = (isset($date)) ? strtotime($date) : time();
    return date("U", mktime(0, 0, +1, date("m", $date), date("d", $date), date("Y", $date)));
  }
HOPE THAT HELPS
My nipples are hard.
Sands is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:19 PM   #15
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
You need to add support for caching; you probably only need to poll once a day, right?

...
Thanks. I took your code but modified it to work with memcache. ENJOY THE SCALABILITY.

Code:
<?php
### DEFINE MEMCACHE CONSTANTS
DEFINE('MEMCACHE_HOST', 'localhost');
DEFINE('MEMCACHE_PORT', 11211);

### THIS IS MY DOMAIN, PLZ DONT USE MY LINKS
$domain_base_url = 'http://www.mydomain.com/';
$randomized_urls = file($domain_base_url . 'files/urls.txt');

$urls = array();
foreach ((array)$randomized_urls as $url) {
    if (!check_cache($url)) {
        ### MAKE SURE ITS ONLINE
        if (validate_url_presence_exists($url) == "TRUE") {
            $urls[] = $url;
            add_cache($url);
        }
    } else {
        $urls[] = $url;
    }
}
if (empty($urls)) {
    ### EVERYONE LIKES HEAD // todo, get head
    header('Location: ' . $domain_base_url);
    exit;
} else {
    srand(enhanced_seed_generator_key());
    $random_url = $urls[rand(0, count($urls)-1)]; // BUG FIXED
    header('Location: ' . $random_url);
    exit;
}

### PASS MY SEED
function enhanced_seed_generator_key() {
    $str = '';
    $chars = str_split('abcdefghijklmnopqrstuvwxyz');
    for ($i = 1; $i = 10; $i++) {
        shuffle($chars);
        $str .= $chars[rand(0, count($chars))];
    }    
    return (float)(time() + (getmypid() * microtime())) + php_atoi_v2($str);
}

### PHP FAILURE
function php_atoi_v2($str) {
    $total = 0;
    foreach (str_split($str) as $chr) {
        $total += ord($chr);
    }
    return (int)$total;
}

function validate_url_presence_exists($url) {
    $ch = curl_init();
    curl_setopt($ch, curlOPT_URL, $url);
    curl_setopt($ch, curlOPT_NOBODY, true);
    curl_setopt($ch, curlOPT_CONNECTTIMEOUT, 2);
    curl_setopt($ch, curlOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, curlOPT_HEADER, true);
    $res = curl_exec($ch);
    curl_close($ch);
    return false if $res === false;
    $code = explode($res);
    return $code[1] == '200' ? "TRUE" : "FALSE";
}

function check_cache($url) {
    $memcache = get_memcache_object_balanced();
    return $memcache->get($url);
}

function add_cache($url) {
    $memcache = get_memcache_object_balanced();
    $memcache->set($url, 1, 0, 86400);
}

### BALANCE THE LOAD??? TODO -- MAKE IT BALANCE
function get_memcache_object_balanced() {
    $memcache = new Memcache;
    $memcache->connect(MEMCACHE_HOST, MEMCACHE_PORT) or die ("Could not connect");
    return $memcache;    
}
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:25 PM   #16
dig420
Confirmed User
 
Industry Role:
Join Date: May 2001
Posts: 9,240
ok which one of you guys knows nats and is looking for work?
dig420 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:34 PM   #17
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by dig420 View Post
ok which one of you guys knows nats and is looking for work?
The brotherhoods knowledge can not be purchased, unless you have money, and hookers.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:35 PM   #18
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
The brotherhoods knowledge can not be purchased, unless you have money, and hookers.
Are you trying to undercut me, bitch?! It's Money, Hookers, and Blow.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:37 PM   #19
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by GrouchyAdmin View Post
Are you trying to undercut me, bitch?! It's Money, Hookers, and Blow.
I AM THE PUMPKIN KING.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:39 PM   #20
Bama
Confirmed User
 
Join Date: Nov 2001
Location: Redmond, WA
Posts: 2,727
lol - you guys are going to be measuring dicks before this thread is through!
Bama is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:44 PM   #21
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by Bama View Post
lol - you guys are going to be measuring dicks before this thread is through!
We already do that in the backroom at the shows
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:44 PM   #22
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
wait, let me try this

PHP Code:
<?php
$outurls 
= array("http://site1.com""http://site2.com""http://site3.com""http://site4.com""http://site5.com""http://site6.com""http://site7.com");
$r rand(0count($outurls));
header("location: " $outurls[$r]);
?>
yay!!
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:56 PM   #23
testpie
Mostly retired
 
testpie's Avatar
 
Industry Role:
Join Date: Apr 2006
Location: UK
Posts: 3,231
Quote:
Originally Posted by mrkris View Post
Thanks. I took your code but modified it to work with memcache. ENJOY THE SCALABILITY.

Code:
<?php
### DEFINE MEMCACHE CONSTANTS
DEFINE('MEMCACHE_HOST', 'localhost');
DEFINE('MEMCACHE_PORT', 11211);

### THIS IS MY DOMAIN, PLZ DONT USE MY LINKS
$domain_base_url = 'http://www.mydomain.com/';
$randomized_urls = file($domain_base_url . 'files/urls.txt');

$urls = array();
foreach ((array)$randomized_urls as $url) {
    if (!check_cache($url)) {
        ### MAKE SURE ITS ONLINE
        if (validate_url_presence_exists($url) == "TRUE") {
            $urls[] = $url;
            add_cache($url);
        }
    } else {
        $urls[] = $url;
    }
}
if (empty($urls)) {
    ### EVERYONE LIKES HEAD // todo, get head
    header('Location: ' . $domain_base_url);
    exit;
} else {
    srand(enhanced_seed_generator_key());
    $random_url = $urls[rand(0, count($urls)-1)]; // BUG FIXED
    header('Location: ' . $random_url);
    exit;
}

### PASS MY SEED
function enhanced_seed_generator_key() {
    $str = '';
    $chars = str_split('abcdefghijklmnopqrstuvwxyz');
    for ($i = 1; $i = 10; $i++) {
        shuffle($chars);
        $str .= $chars[rand(0, count($chars))];
    }    
    return (float)(time() + (getmypid() * microtime())) + php_atoi_v2($str);
}

### PHP FAILURE
function php_atoi_v2($str) {
    $total = 0;
    foreach (str_split($str) as $chr) {
        $total += ord($chr);
    }
    return (int)$total;
}

function validate_url_presence_exists($url) {
    $ch = curl_init();
    curl_setopt($ch, curlOPT_URL, $url);
    curl_setopt($ch, curlOPT_NOBODY, true);
    curl_setopt($ch, curlOPT_CONNECTTIMEOUT, 2);
    curl_setopt($ch, curlOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, curlOPT_HEADER, true);
    $res = curl_exec($ch);
    curl_close($ch);
    return false if $res === false;
    $code = explode($res);
    return $code[1] == '200' ? "TRUE" : "FALSE";
}

function check_cache($url) {
    $memcache = get_memcache_object_balanced();
    return $memcache->get($url);
}

function add_cache($url) {
    $memcache = get_memcache_object_balanced();
    $memcache->set($url, 1, 0, 86400);
}

### BALANCE THE LOAD??? TODO -- MAKE IT BALANCE
function get_memcache_object_balanced() {
    $memcache = new Memcache;
    $memcache->connect(MEMCACHE_HOST, MEMCACHE_PORT) or die ("Could not connect");
    return $memcache;    
}
And that's the reason my code now looks like this:
Code:
<?php
function nameHere() {
 die("Error: I can't code for shit");
}
?>
__________________

Affiliates: DogFart ~ Domain parking: NameDrive ~ Traffic broker: Traffic Holder
testpie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 02:56 PM   #24
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by Jaysin View Post
wait, let me try this

PHP Code:
<?php
$outurls 
= array("http://site1.com""http://site2.com""http://site3.com""http://site4.com""http://site5.com""http://site6.com""http://site7.com");
$r rand(0count($outurls));
header("location: " $outurls[$r]);
?>
yay!!
Your code isn't optimized, so I'm not going to even give it a moment of my time. Sucker.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:01 PM   #25
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
Quote:
Originally Posted by mrkris View Post
Your code isn't optimized, so I'm not going to even give it a moment of my time. Sucker.
I'll optimize my weiner on your jaw!
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:05 PM   #26
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Hey, assholes.

count() positive indexes starts at one (0 == FALSE (when not === tested)).
arrays start at zero.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:07 PM   #27
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
Quote:
Originally Posted by GrouchyAdmin View Post
Hey, assholes.

count() positive indexes starts at one (0 == FALSE (when not === tested)).
arrays start at zero.
stfu i rarely use count() and all that jazz, gawd its for n00bs like you and mrkris
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:07 PM   #28
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by Jaysin View Post
I'll optimize my weiner on your jaw!
your weiner isn't optimized enough to get hard.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:08 PM   #29
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
n00bs, every last one of ya
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:10 PM   #30
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by Jaysin View Post
n00bs, every last one of ya
Don't hate, just learn to code. Is that to much to ask?
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:11 PM   #31
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Jaysin View Post
n00bs, every last one of ya
I'm not paying you to 'consult', I'm paying you to 'take three cocks in the rectal cavity'.

FOCUS, GOD DAMN IT!
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:15 PM   #32
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:25 PM   #33
dig420
Confirmed User
 
Industry Role:
Join Date: May 2001
Posts: 9,240
Quote:
Originally Posted by mrkris View Post
The brotherhoods knowledge can not be purchased, unless you have money, and hookers.
I provide the money, what you do with it is your business ;)

Hit me up on icq if you or grouchy is interested, I need a coder who can handle more than two days of working before he needs a two week break.
dig420 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:26 PM   #34
gornyhuy
Chafed.
 
gornyhuy's Avatar
 
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
count($cockinches[$GrouchyAdmin]) starts and ENDS at zero.

Ooooh nerd burn.
__________________

icq:159548293
gornyhuy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:36 PM   #35
testpie
Mostly retired
 
testpie's Avatar
 
Industry Role:
Join Date: Apr 2006
Location: UK
Posts: 3,231
Quote:
Originally Posted by Jaysin View Post
n00bs, every last one of ya
I admit it. I'm not even pro enough to get those two zeros in the noob tag...
__________________

Affiliates: DogFart ~ Domain parking: NameDrive ~ Traffic broker: Traffic Holder
testpie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:37 PM   #36
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by gornyhuy View Post
count($cockinches[$GrouchyAdmin]) starts and ENDS at zero.

Ooooh nerd burn.
All you're gonna get is that $cockinches[$GrouchyAdmin] is not set. Not circumcised, either.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:40 PM   #37
NickPapageorgio
Confirmed User
 
Join Date: Apr 2004
Location: NC
Posts: 8,323
<? echo "Hello World!!!"; ?>

You can thank me later. ;)
__________________
NickPapageorgio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:45 PM   #38
LazyD
Confirmed User
 
Join Date: Aug 2004
Location: www.calidi.com
Posts: 102
You all fail at speed optimization with your over-engineered solutions
Array solution is over 20 times faster than file cache solution which is already 3 times faster than memcache solution, so all of you
__________________
Calidi studio
http://www.calidi.com
ICQ: #18466283
LazyD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:46 PM   #39
Lane
Will code for food...
 
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
switch to mt_rand already

also, seeding is mostly useless
__________________

Last edited by Lane; 07-24-2008 at 03:47 PM..
Lane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:48 PM   #40
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
Quote:
Originally Posted by Lane View Post
switch to mt_rand already

also, seeding is mostly useless
Holy shit, I thought you were dead... any updates on CJUltra man? I've defended that script so many times because of people assuming it was sending visitors to warez sites and shit because of your skim... wooo, update it or something man.
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 03:56 PM   #41
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by LazyD View Post
You all fail at speed optimization with your over-engineered solutions
Array solution is over 20 times faster than file cache solution which is already 3 times faster than memcache solution, so all of you
You were so damn close, too.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 04:30 PM   #42
HighEnergy
So Fucking Banned
 
Join Date: Apr 2007
Posts: 806
Congratulations - 300 lines of code to rotate 5 links.
HighEnergy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-24-2008, 06:56 PM   #43
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by HighEnergy View Post
Congratulations - 300 lines of code to rotate 5 links
If you don't understand the awesomeness, you are in the wrong field.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 01:43 PM   #44
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,676
Update ! Just revisiting this thread to say thanks for all the replies... Even if I DID get totally lost towards the end LOL

I went with the Mikeyddddd solution in the end. I liked the idea of the seperate text file...

You see, as opposed to just posting 'how do I do this?' and grabbing the first reply, copy pasting it, and going off on my merry way...

I do actually want to learn, so I went out a bought (DONT LAUGH) a 'book' ? and have been reading it over the last few days... Now at least I understand (kinda) HOW it works...

Anyway, I have it all working like a dream!
So THANKS
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 01:45 PM   #45
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
does it have a section on poop?
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 01:49 PM   #46
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,676
Quote:
Originally Posted by Jaysin View Post
does it have a section on poop?



Please note: When I'm posting serious threads, I post sig free
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 01:53 PM   #47
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,676
Quote:
Originally Posted by Jaysin View Post
does it have a section on poop?
I have however, enjoyed reading the book while sat on the toilet, so there is a tenuous connection I suppose
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 01:58 PM   #48
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by ThatGuyInTheCorner View Post
I have however, enjoyed reading the book while sat on the toilet, so there is a tenuous connection I suppose
Your pooping is not optimized. You need to straighten your back to allow for maxium force.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-31-2008, 02:04 PM   #49
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
Your pooping is not optimized. You need to straighten your back to allow for maxium force.
The last time a noob tried that, he shit out his whole spine.
__________________
GrouchyAdmin 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.