Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-03-2004, 03:18 PM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
image

aku dah buat path utk display image file...
//--------- file name: user_profile.php
<html>
:
:
<img src ="C:/phpdev/www/star/photo_profile/<?php echo $_SESSION['user_photo']; ?>" ... >
:
:
</html>

tp bila aku browse fail tu image tu tak dapat di view oleh mata aku..
ataupun utk view gamba using php ni ada enabled function dia cam kat phpinfo tu?

sudah baca harap balas
harap balas la ye....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-03-2004, 03:54 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
You can't use: C:/phpdev/www/star/photo_profile/

You will need to use the HTTP equivalent, for example:

Code:
<img src ="http://localhost/star/photo_profile/<?php echo $_SESSION['user_photo']; ?>" ... >
or the following may also work (depending on hour your dirrectories are set up:

Code:
<img src ="/star/photo_profile/<?php echo $_SESSION['user_photo']; ?>" ... >
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-03-2004, 03:57 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
By the way, $_SESSION['user_photo'] should hold a string, with reference to the image file name, e.g. 'me.jpg'

So when it is parsed, it will output:

Code:
<img src ="/star/photo_profile/me.jpg" ... >
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2004, 09:53 AM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
i tried the first one.. but it display the same result. then i looked up the image props from the browser, the file path is : http://localhost/http://localhost/star/photo_profile/(blank)

i had tried all the solution given but it still display the same result.
anyway, thanks for your patient and help.
__________________
To follow the path:
Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2004, 10:36 AM
Inspired Webmaster
 
Join Date: Feb 2004
Location: Shah Alam
Posts: 175
Rep Power: 62
hftey is on a distinguished road
Send a message via ICQ to hftey Send a message via MSN to hftey Send a message via Yahoo to hftey Send a message via Skype™ to hftey
Try session_start() before your <html> tag.
__________________
Venzon Solution Services
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-03-2004, 10:42 AM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
same result
__________________
To follow the path:
Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-03-2004, 11:06 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
could you post the full source to: user_profile.php

I don't know how you got: http://localhost/http://localhost/star/photo_profile/(blank)...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-03-2004, 11:08 AM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
this is the full path

C:/phpdev/star/www/photo_profile/ (file name.. suppose to be)
__________________
To follow the path:
Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-03-2004, 12:14 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
we need full source code of the page to help you solve the problem, not only full path.

btw,
Quote:
i tried the first one.. but it display the same result. then i looked up the image props from the browser, the file path is : http://localhost/http://localhost/star/photo_profile/(blank)
If it is (blank), then I guess the
PHP Code:
<?php echo $_SESSION['user_photo']; ?>
does not return any value.

So, we still need the source code...
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-03-2004, 12:43 PM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
<?php
include 'Connections/star.php'; // file scripot connect to dbase
session_start();
?>
<html>
:
:
<tr>
<td valign="top"><p><img name="gambar_anda" width="100" height="100" alt=<?php echo $_SESSION['user_name'];?> style="background-color: #FFFFFF" src="/star/profile_photo/"<?php echo $_SESSION['user_photo'];?>></p>
<p> <span class="header">Selamat Datang : <?php echo $_SESSION['user_name'];?></span></p>
<span class="para">Waktu : &nbsp;
:
:
</html>

aku store img tu folder spt path yg aku tulis tuh... aku try nak submit the whole script.. tp dah over 1000 char plak alert msg tu dipslay tadi.. lgpun yg tak work cuma this linejek.. yg lelain tupun cuma html code jek.. so, aku rasa aku paste kan yg ni jek laa.. kalau tak cukup bgtahu aku ekk..
lagi satunak bgtahu aku ada table nama user_mgt yg ada field user_photo type varchar 225/255 (some sort of that binary equivalent value laa. aku pun lupa..) with default value 'question.gif' yg aku simpan dlm foldr photo_profile tuh.. kira kalau first2 login n tak upload gamba.. gamba 'question.gif' ni yg aku try nak kuarkan tuk user. hopefully info ni membantu sesapa yg nk membantu aku.. TQ
__________________
To follow the path:
Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 05-03-2004, 01:10 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
I see the problem now...

Replace with:

PHP Code:
:
<tr>
<td valign="top"><p><img name="gambar_anda" width="100" height="100" alt="<?php echo $_SESSION['user_name'];?>" style="background-color: #FFFFFF" src="/star/profile_photo/<?php echo $_SESSION['user_photo'];?>"></p>
<p> <span class="header">Selamat Datang : <?php echo $_SESSION['user_name'];?></span></p>
<span class="para">Waktu :  
:
See if that works...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 05-03-2004, 01:17 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
In your browser, try viewing a photo:
http://localhost/star/profile_photo/test.jpg

(replace test.jpg with a photo in that folder)

If you see a photo, then the code above should work. If you get an error (should be 404 error), means that the folder location is still wrong.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 05-03-2004, 02:03 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
he left out double quotation (") at the end huh?
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 05-03-2004, 03:35 PM
nurulmajdi's Avatar
Inspired Webmaster
 
Join Date: Feb 2004
Location: Klang Bandar Diraja
Posts: 160
Rep Power: 62
nurulmajdi is on a distinguished road
Send a message via Yahoo to nurulmajdi
i got the same result, but the img is loaded when i tried to view with
http://localhost/star/photo_profile/question.gif
means the foldr is ok, am i right, sufyan? well, really hope for all your patient. TQ
__________________
To follow the path:
Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 05-03-2004, 03:49 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Ok, you tested http://localhost/star/photo_profile/question.gif and it works right?

How come in your code it's:
/star/profile_photo/

instead of

/star/photo_profile/

Which one is the actual folder you store your photos in???

Now try:

PHP Code:
:

<tr>

<td valign="top"><p><img name="gambar_anda" width="100" height="100" alt="<?php echo $_SESSION['user_name'];?>" style="background-color: #FFFFFF" src="/star/photo_profile/<?php echo $_SESSION['user_photo'];?>"></p>

<p> <span class="header">Selamat Datang : <?php echo $_SESSION['user_name'];?></span></p>

<span class="para">Waktu :  

:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Image Host Unknowmaster Websites Review and Suggestion 2 02-12-2006 11:06 AM
image position in css xtau Website Design 6 21-06-2005 11:52 AM
setting image bell Website Programming 1 09-08-2004 08:55 PM
Image Site al1 Websites Review and Suggestion 2 22-03-2004 02:03 PM
How to create an image preloader full time kille Website Design 7 15-10-2002 01:07 AM


All times are GMT +8. The time now is 03:14 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.