Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to build page where user enters his rollno and the pic is retrieved from folder with having same rollno name eg(<rollno>.jpg) i will save pic with <rollno>.jpg
in results folder
the only to do is retrieve the pic with same rollno entered by user
plz help me out
Posted
Updated 27-Sep-14 8:41am
v2
Comments
In PHP or ASP.NET?

1 solution

As you have tagged php here so this method in php will help:

PHP
//path to directory to scan
$directory = "mytheme/images/myimages";

//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");

//print each file name
foreach($images as $image)
{
// put your condition here like for a particular roll no etc.
  echo $image;
}
 
Share this answer
 
Comments
lantianziyun 28-Sep-14 22:38pm    
array glob ( string $pattern [, int $flags ] )

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900