Hello coders all over the world

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
User avatar
iknowu99
Forum Commoner
Posts: 39
Joined: Thu Aug 14, 2008 3:20 pm

Hello coders all over the world

Post by iknowu99 »

Hello Everybody!

My first post, this site seems great,

i want to get started right away:

The goal is to create the main page of a new website. in the same directory will be some pictures and the idea is to post all the *.jpg files in the main webpage. The dialema is that these jpg files have weird names, so i want to create some code for the index that will include all pictures.
Thanks!
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: Hello coders all over the world

Post by desmi »

Hello iknowu99, and welcome to forum!


You could make a code to read all imagenames in array, and echo them inside html code to be shown as images..
User avatar
iknowu99
Forum Commoner
Posts: 39
Joined: Thu Aug 14, 2008 3:20 pm

Re: Hello coders all over the world

Post by iknowu99 »

i dont know the names of the jpg's, would that be fine to get an array like that?

there are 20 jpg's that are uploaded to the ftp, and for now there isnt even an index.html file

i came to php because i believe it's very secure (even though there's nothing to hide:) it will be good practice

where can i find some code?
thanks!
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: Hello coders all over the world

Post by desmi »

Well, since you're a beginner, take a look at this for example:

http://sourceforge.net/project/screensh ... _id=234581

Analyze that script, it'll get you some basics about listing directory content, and after that, try to create your own, and in a different way. :)

Feel free to ask any advise!
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: Hello coders all over the world

Post by desmi »

Sorry about that.. I just downloaded thsi script to see what it's like.. It's a real MESS!

All variables are like $a $b $c $f $x..

If you still havn't solved this one, please ask for more info :)
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Hello coders all over the world

Post by Zoxive »

Code: Select all

<?php
 
$Files = glob('*.jpg');
 
foreach($Files as $File){
  echo $File . '<br/>' . PHP_EOL;
}
 
Post Reply