IM A NOOB!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

IM A NOOB!

Post by alex_cunningham »

I dont know what im doing but i need a php code that will bring up a diferent page every time you click on a button
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: IM A NOOB!

Post by RobertGonzalez »

You are going to have to be way more informational that that, I'm afraid.
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

yah your right

Post by alex_cunningham »

well i want a code that it will randomly pick a site and open it but only the site's in the folder its in
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

do u get it now
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: IM A NOOB!

Post by RobertGonzalez »

When you say sites that in the folder its in, what do you mean?
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

it will randomly open a site in a web folder
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: IM A NOOB!

Post by Eran »

oh .. the random sites in the web folder trick. I get it 8O

maybe you should try rewording what you mean? what is a web folder? and what is a site in your dictionary?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: IM A NOOB!

Post by RobertGonzalez »

So do you have a file with sites listed in it that is living in a directory? Or is there a file for each site that is living in a directory? I'm sorry, but I am having a heck of a time understanding what you are asking.
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

yah
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

sory i keep going away from my computer
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

ok like this i find this site o look this button says random site i click on it. it takes me to a site
i click on it again hey look its a different site i try it on my friends computer hey its still a different site its not the same as the one on my computer
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

get it yet pytrin
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: IM A NOOB!

Post by Jenk »

Code: Select all

<?php
$pages = glob('./*.html');
include $pages[rand(0, count($pages))];
?>
alex_cunningham
Forum Newbie
Posts: 13
Joined: Tue Jun 24, 2008 6:34 pm

Re: IM A NOOB!

Post by alex_cunningham »

A
|
|
|


what do i do with this
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: IM A NOOB!

Post by John Cartwright »

Moved to PHP-Code.
Post Reply