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-25-2007, 09:07 PM   #1
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Some php help please....

I know that if I want to include a file on a page I put the line...

Code:
<? @include("http://www.domain.com/file.html"); ?>
But what if I want the file to change with each refresh of the page what to I put...?


Thanks in advance for any help you give
Jon Clark - 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 03-25-2007, 09:18 PM   #2
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
one quick way you could do that is create an array of all your links, and then generate a random number between 0 and the number of links - 1 and use that number.

so like this if you had 3

Code:
<?php 
$url[0] = 'http://www.fuck.you/fuckoff.html';
$url[1] = 'http://www.suckmyballs.com';
$url[2] = 'http://www.lickmynuts.com';

$fuckingNumber = strval(rand()%3);

include($url[$fuckingNumber]);
?>
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:27 PM   #3
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Beaver Bob View Post
one quick way you could do that is create an array of all your links, and then generate a random number between 0 and the number of links - 1 and use that number.

so like this if you had 3

Code:
<?php 
$url[0] = 'http://www.fuck.you/fuckoff.html';
$url[1] = 'http://www.suckmyballs.com';
$url[2] = 'http://www.lickmynuts.com';

$fuckingNumber = strval(rand()%3);

include($url[$fuckingNumber]);
?>
Thanks... But would I put replace "fuckingnumber" with the number of files there are?
Jon Clark - 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 03-25-2007, 09:30 PM   #4
Cyrano
Confirmed User
 
Join Date: Apr 2006
Location: USA
Posts: 900
No. 1234
Cyrano is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:36 PM   #5
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
Quote:
Originally Posted by Jon Clark View Post
Thanks... But would I put replace "fuckingnumber" with the number of files there are?
you would replace the 3 with the number of files you have.
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:37 PM   #6
Napolean
Old school
 
Napolean's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: Kettering, OH
Posts: 4,327
Quote:
Originally Posted by Jon Clark View Post
Thanks... But would I put replace "fuckingnumber" with the number of files there are?
Code:
<?php
$url[] = 'http://www.test1.com';
$url[] = 'http://www.test2.com';
$url[] = 'http://www.test3.com';

$x= strval(rand()%count($url));

include($url[$x]);
?>
simpler version of the example above, only modification needed is to add more url's as you need them.
__________________
Need a programmer? (Desktop/Web Applications) --- Skype: napoleande
Napolean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:40 PM   #7
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
OK, I have tried to lines of code... Neither are working for me...

First one is located at http://www.freepornation.com/test/index.php
Code:
<? $sl = rand(1,5);include ('1.htm'.$sl.'2.htm'.$sl.'3.htm'.$sl.'4.htm'.$sl.'5.htm'); ?>
Second one is located here http://www.freepornation.com/test/index2.php
Code:
<?php 
$url[0] = '1.htm';
$url[1] = '2.htm';
$url[2] = '3.htm';
$url[3] = '4.htm';
$url[4] = '5.htm';

$no. 01234 = strval(rand()%5);

include($url[$no. 01234]);
?>
As you can see neither work
Jon Clark - 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 03-25-2007, 09:42 PM   #8
Napolean
Old school
 
Napolean's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: Kettering, OH
Posts: 4,327
Quote:
Originally Posted by Jon Clark View Post
OK, I have tried to lines of code... Neither are working for me...

First one is located at http://www.freepornation.com/test/index.php
Code:
<? $sl = rand(1,5);include ('1.htm'.$sl.'2.htm'.$sl.'3.htm'.$sl.'4.htm'.$sl.'5.htm'); ?>
Second one is located here http://www.freepornation.com/test/index2.php
Code:
<?php 
$url[0] = '1.htm';
$url[1] = '2.htm';
$url[2] = '3.htm';
$url[3] = '4.htm';
$url[4] = '5.htm';

$no. 01234 = strval(rand()&#37;5);

include($url[$no. 01234]);
?>
As you can see neither work
change "$no. 01234" to simply "$no"
__________________
Need a programmer? (Desktop/Web Applications) --- Skype: napoleande
Napolean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:44 PM   #9
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Napolean View Post
Code:
<?php
$url[] = 'http://www.test1.com';
$url[] = 'http://www.test2.com';
$url[] = 'http://www.test3.com';

$x= strval(rand()%count($url));

include($url[$x]);
?>
simpler version of the example above, only modification needed is to add more url's as you need them.

Worked perfect...

http://www.freepornation.com/test/index3.php

Thank you very much
Jon Clark - 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 03-25-2007, 09:44 PM   #10
Dvae
Confirmed User
 
Dvae's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: US
Posts: 5,326
Quote:
Originally Posted by Jon Clark View Post
OK, I have tried to lines of code... Neither are working for me...

First one is located at http://www.freepornation.com/test/index.php
Code:
<? $sl = rand(1,5);include ('1.htm'.$sl.'2.htm'.$sl.'3.htm'.$sl.'4.htm'.$sl.'5.htm'); ?>
Second one is located here http://www.freepornation.com/test/index2.php
Code:
<?php 
$url[0] = '1.htm';
$url[1] = '2.htm';
$url[2] = '3.htm';
$url[3] = '4.htm';
$url[4] = '5.htm';

$no. 01234 = strval(rand()%5);

include($url[$no. 01234]);
?>
As you can see neither work
You should take the time to learn the basics of PHP.
__________________
.
.

Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.
Dvae is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:44 PM   #11
Napolean
Old school
 
Napolean's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: Kettering, OH
Posts: 4,327
Quote:
Originally Posted by Jon Clark View Post
Worked perfect...

http://www.freepornation.com/test/index3.php

Thank you very much
Cool
__________________
Need a programmer? (Desktop/Web Applications) --- Skype: napoleande
Napolean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:45 PM   #12
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
Quote:
Originally Posted by Napolean View Post
Code:
<?php
$url[] = 'http://www.test1.com';
$url[] = 'http://www.test2.com';
$url[] = 'http://www.test3.com';

$x= strval(rand()%count($url));

include($url[$x]);
?>
simpler version of the example above, only modification needed is to add more url's as you need them.
nice modification man i shoulda thought of that but I was jus tryin to get him a quick basic idea.
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:47 PM   #13
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Napolean View Post
change "$no. 01234" to simply "$no"
And so did that....

http://www.freepornation.com/test/index2.php

Thanks






Now which one is better to use....


I plan on haveing several groups on one php page if that makes a difference
Jon Clark - 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 03-25-2007, 09:48 PM   #14
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,148
Damn, I didn't get to play
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:49 PM   #15
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Beaver Bob View Post
nice modification man i shoulda thought of that but I was jus tryin to get him a quick basic idea.

I thank you too
Jon Clark - 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 03-25-2007, 09:52 PM   #16
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Dvae View Post
You should take the time to learn the basics of PHP.

You are more then correct and it is in my plans, but managing the designers, clients and working on this new program I hardly have time for anything at all
Jon Clark - 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 03-25-2007, 09:53 PM   #17
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
Quote:
Originally Posted by Jon Clark View Post
And so did that....

http://www.freepornation.com/test/index2.php

Thanks






Now which one is better to use....


I plan on haveing several groups on one php page if that makes a difference
his is better because it counts the number of elements in the array for you. but both will do the job.
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:55 PM   #18
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by sarettah View Post
Damn, I didn't get to play

I am sure there will be a next time... I am a total newb at alot of things and I am not scared to ask for help
Jon Clark - 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 03-25-2007, 09:55 PM   #19
Sly
Let's do some business!
 
Sly's Avatar
 
Industry Role:
Join Date: Sep 2004
Location: Austin, TX
Posts: 31,348
Quote:
Originally Posted by Jon Clark View Post
You are more then correct and it is in my plans, but managing the designers, clients and working on this new program I hardly have time for anything at all
For starters, you can't have a space in variable names.
__________________
Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

Windows VPS now available
Great for TSS, Nifty Stats, remote work, virtual assistants, etc.
Click here for more details.
Sly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:56 PM   #20
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
Quote:
Originally Posted by Jon Clark View Post
I thank you too
no prob. one of the very basic things about PHP is you can't have spaces in your variable names or periods and certain other special characters that are used as operators.
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 09:57 PM   #21
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Beaver Bob View Post
his is better because it counts the number of elements in the array for you. but both will do the job.

Thanks Bob... I will play around with them both and see which ends up working best for my application
Jon Clark - 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 03-25-2007, 10:04 PM   #22
Kaylum
Confirmed User
 
Industry Role:
Join Date: Aug 2005
Location: Costa Rica
Posts: 465


way to go jon, work the php!
__________________
-- "You can't stop ingenuity, trust me.."
Kaylum is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-25-2007, 10:14 PM   #23
Jon Clark - BANNED FOR LIFE
North Coast Pimp
 
Join Date: Dec 2005
Location: 304-534-757
Posts: 9,395
Quote:
Originally Posted by Kaylum View Post


way to go jon, work the php!

Thanks Kaylum, I am trying
Jon Clark - 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 03-26-2007, 09:20 AM   #24
Domain Distribution
Ask me about negative cash flow
 
Join Date: May 2006
Posts: 539
The only gracious way to accept an insult is to ignore it.
__________________
Artifical Intelligence AIM Bot ~ $199.00
[email protected]
238102273
Domain Distribution 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.