Current location: Hot Scripts Forums » Programming Languages » PHP » preview image


preview image

Reply
  #1 (permalink)  
Old 05-18-08, 09:02 AM
myslowquietlife's Avatar
myslowquietlife myslowquietlife is offline
Newbie Coder
 
Join Date: Mar 2008
Location: London
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
preview image

Hi again.

I am not sure this is the right place for this so i am very sorry if i am wrong.

I would like my members to preview their images before upload i have a script in written in Javascript which does this (if it is only for Firefox, %$£& IE)

But i would like to know if this can be done using just PHP, is this possible? or would i always have to use javascript?

Thanks

Ben
__________________
"It's not the strong that survive, nor is it the intelligent, but those that can adapt to change"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-18-08, 09:54 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
There's no way you can create a preview of an image before you upload it to the server. PHP dosn't have access to a user's computer, and therefor isn't able to open/edit/read the image before it is completely uploaded to the server

Where did you find that javascript, cause it's hard to believe it actually lets you preview an image before uploading?
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-18-08, 05:26 PM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
If php can read the fonts on your machine I am sure it can read the path to an image?

Or do I know this because I am running on my local machine.
__________________
Can you think outside the box but remain inside the box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-19-08, 03:37 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
It can read a path to a local image, but not to a remote image.
If PHP would be able to read data from a remote host, all computers would be hacked in no time. As far as I know, you can't get any access to remote files on a users computer, unles he specifically allows you too (through a 'Open' dialog window, or by opening a port, ....) via a web browser (or for that: any server-sided programming language).

The reason why you could read the image on your local machine is because the fonts are located on your local machine itself.
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image preview not working in IE7.Please help subhasps8 JavaScript 1 10-03-07 06:02 AM
Image Upload and Preview Script needed markimarkc Script Requests 1 02-19-06 11:48 AM
searching image nurqeen PHP 4 07-09-05 10:35 AM
Help with image on form... Adrianaa03 JavaScript 1 10-06-04 08:38 AM
how to draw an image inside a table? davidklonski HTML/XHTML/XML 2 07-06-04 11:27 AM


All times are GMT -5. The time now is 11:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.