Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Making my file_exists imagefinding tool more advanced - any help?
Old 08-12-2007, 03:54 PM Making my file_exists imagefinding tool more advanced - any help?
Junior Talker

Posts: 1
Name: Samuel
Trades: 0
Hello all,

I've currently got the following as my image finding script, but it's not very effective.

PHP Code:
<?php
$filename 
'whatever.gif';
 
if (
file_exists($filename)) {
    echo 
"The file $filename exists";
} else {
    echo 
"The file $filename does not exist";
}
?>
I repeat it like 50 times on a page, so as to search different images all at once to see if they exist.

If you could, I'd like some help to check for an image's existance via a form (and dropdown boxes).

I'd like two dropdown boxes, so:

[box1] [box2] [SUBMIT] would check to see if the file: http://images.example.com/imagefolder/[box1]_[box2]_image.gif exists. If you understand?

Many thanks for your help!

Sam

PS:
Also, just as a sidethought; if this would allow you to select multiple options from dropdown box2, and search for those, all at the same time, that'd be splendid (but I'm not sure as to how possible that is). Much loves.

Last edited by Samuel; 08-12-2007 at 03:58 PM..
Samuel is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-12-2007, 07:46 PM Re: Making my file_exists imagefinding tool more advanced - any help?
Super Talker

Posts: 130
Trades: 0
if I understand correctly, make your form and then change your code to this.

PHP Code:
 <?php
$filename 
$_POST['box_1'];
 
if (
file_exists($filename)) {
    echo 
"The file $filename exists";
} else {
    echo 
"The file $filename does not exist";
}
?>
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Old 08-13-2007, 03:22 AM Re: Making my file_exists imagefinding tool more advanced - any help?
Experienced Talker

Posts: 32
Trades: 0
Quote:
Originally Posted by flann View Post
if I understand correctly, make your form and then change your code to this.

PHP Code:
 <?php
$filename 
$_POST['box_1'];
 
if (
file_exists($filename)) {
    echo 
"The file $filename exists";
} else {
    echo 
"The file $filename does not exist";
}
?>
OR EXACTLY:


PHP Code:
 <?php
$ifo 
'imagefolder/'// this is if your search script is in root folder
$filename $ifo.$_POST['box_1'].'_'.$_POST['box_2'].'_image.gif';
 
if (
file_exists($filename)) {
    echo 
"The file $filename exists";
} else {
    echo 
"The file $filename does not exist";
}

?>
CHEERS!

Last edited by lotar_vk; 08-13-2007 at 03:24 AM..
lotar_vk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Making my file_exists imagefinding tool more advanced - any help?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11899 seconds with 12 queries