/    Sign up×
Community /Pin to ProfileBookmark

Who can make files open automatically with PHP?

I want to make this

[QUOTE]

Pages: 1 , 2 , 3 Next >>

[/QUOTE]

with PHP

Lets say that i have a folder “Games”

i wand any game be added to this foler open in another
page and this

[QUOTE]

Pages: 1 , 2 , 3 Next >>

[/QUOTE]

changes automatically

I want to make it in a php function

and i think this will use “IF” statment but i am not professional in php

so i search for some one who can help me to do this

any body can help?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@chazzyDec 19.2006 — This forum's more of a question and answer type of place. People who post here aren't paid, so we don't really just give out solutions.

If you have specific questions, feel free to ask.
Copy linkTweet thisAlerts:
@itbeingsDec 19.2006 — Are you talking about pagination or what? Explain better.
Copy linkTweet thisAlerts:
@master_modeauthorDec 19.2006 — yes i am talking about pagination, but look to "chazzy" reply

it is so silly
Copy linkTweet thisAlerts:
@JayMDec 20.2006 — Welcome to the forums!

Chazzy is right.

This should help you with pagination.
Copy linkTweet thisAlerts:
@NightShift58Dec 20.2006 — Hi master_mode,

I guess Chazzy is having a bad day... He's answered worse things before...

And yes, this is a forum to ask questions. Of course, nobody has to answer, because nobody gets paid to answer. But anyone can ask. And anyone can answer. So you're in the right place.

Back to your question: Does that mean that you want to list the contents of the folder one-game-per-page? It doesn't make sense to me. Maybe I didn't understand what you're trying to accomplish...

Or do you want to list of maybe 15-20 games and then show the next 15-20 on the next page - and so on?
Copy linkTweet thisAlerts:
@master_modeauthorDec 20.2006 — Yes i want to list the contents of the folder one-game-per-page & and also have a pagination
Copy linkTweet thisAlerts:
@NightShift58Dec 20.2006 — [code=php]<?php

$arrDIR = glob("*");

IF (!isset($_GET['f']) OR $_GET['f']=="") :
$thisFILE = 0;
ELSE:
$thisFILE = $_GET['f'];
ENDIF;

$FIRSTfile = 0;
$LASTfile = count($arrDIR)-1;
$PREVfile = $thisFILE - 1;
$NEXTfile = $thisFILE + 1;
IF ($PREVfile < 0) :
$PREVfile = $LASTfile;
ENDIF;
IF ($NEXTfile > $LASTfile) :
$NEXTfile = 0;
ENDIF;

print "<hr>";
print "Current File: " . $arrDIR[$thisFILE];
print "<hr>";
print "<a href='{$_SERVER['PHP_SELF']}?f=$FIRSTfile'>First</a>";
print "&nbsp;&nbsp;";
print "<a href='{$_SERVER['PHP_SELF']}?f=$PREVfile'>Previous</a>";
print "&nbsp;&nbsp;";
print "<a href='{$_SERVER['PHP_SELF']}?f=$NEXTfile'>Next</a>";
print "&nbsp;&nbsp;";
print "<a href='{$_SERVER['PHP_SELF']}?f=$LASTfile'>Last</a>";
print "<hr>";

print "<pre>";
print_r($arrDIR);
print "</pre>";

?>
[/code]
Here's one way to do it. The code is written so that you can experiment. In a live script, I would have done it a bit differently, but I think that, until you know exactly how it's going to look like, it's a good starting point.
×

Success!

Help @master_mode spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...