I need a little nudge in the right direction.

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

Post Reply
bissquitt
Forum Newbie
Posts: 7
Joined: Sun Oct 29, 2006 4:59 am

I need a little nudge in the right direction.

Post by bissquitt »

Xposted from the volenteer work section cuz I dont really need it dont for me, i just need a good start and the commands ill need and i can take it from there even though I know 0 PHP.

Im looking for a fairly simple script, It would take me like 5min to do in C++ but that wont really help.

Basicly I need a page that will display all pictures in a perticular directory on a diffrent one of my sites so it will need to have the full url not just a relative link.

psudo code of what i need:

Code:
Function1:
for x = 0 to 64 (10 numbers, 26 lowercase letters, 26 upper case letters, space, return nothing (this is for the early part of the loop when there are only like 1 character so the 5th etc character will return nothing))

Code:
<img src="http://www.mysite.com/mypicturefolder/[b]Function1[/b].jpg>

This will produce every possiable combination of pictures in that folder with 1 character
I need to expand this so that after it tries every combo of one character it goes on to do every possiable combo of X number of characters.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Please use descriptive thread titles, and don't cross-post.

You may try opendir() -- also has an FTP wrapper. If the URL you are opening supports directory listing, this will work without having to use FTP.
bissquitt
Forum Newbie
Posts: 7
Joined: Sun Oct 29, 2006 4:59 am

Post by bissquitt »

this is simply to list all the items to other people that dont have ftp access. I just want something quick and dirty
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Consider a local php script that returns links to all files in its directory in XML or CSV, and call it remotely using another script that parses that original file. Try scandir() for the local script, and file_get_contents() in the remote script.
bissquitt
Forum Newbie
Posts: 7
Joined: Sun Oct 29, 2006 4:59 am

Post by bissquitt »

ok well I tried learning a little but all i was able to get was a giant case statement thats not really working.

a simple loop would be the best.
Post Reply