chennaibala Posted November 24, 2009 Share Posted November 24, 2009 hi frd i have upload my photo in upfile folder inside www folder of wamp.now i want to display my photo to modify.for that i got root path in hiden textbox and append upload photo name to diplay. <td align="center"><input id="sam" name="text" type="text" size="10" value="<?php error_reporting(E_ALL^E_NOTICE); $directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); $val1=$_SERVER['DOCUMENT_ROOT'] . $directory_self . 'upfile/'; echo "$val1" ; ?>"></td> when i run the code..i can get phot image root path like below.. D:/wamp/www//upfile/ for display purpose i used java script.. document.getElementById('pic1').src=document.getElementById('sam').value+sun.gif; these code work nice in local machine....when i run these code in lan network machine where wamp server installed in other machine.pic is not diaplaying because my code serching for photos D:/wamp/www//upfile/sun.gif in that running machine!!!it not getting server path to get show that image..wht may problem..thanks in advance frdss Link to comment https://forums.phpfreaks.com/topic/182745-problem-in-getting-server-path-to-get-display-that-image/ Share on other sites More sharing options...
taquitosensei Posted November 24, 2009 Share Posted November 24, 2009 echo basename($_SERVER['PHP_SELF']) make sure it's the right value, also echo out your $directory_self make sure it looks right. Link to comment https://forums.phpfreaks.com/topic/182745-problem-in-getting-server-path-to-get-display-that-image/#findComment-964667 Share on other sites More sharing options...
chennaibala Posted November 24, 2009 Author Share Posted November 24, 2009 thanks for reply taquitosensei ....my code work fine in wamp server installed machine. it get image frm server path and displayed...if i run that same site in other machine in lan network by calling server number of wamp installed machine..picture is not displayed,because it serching for image in running machine path....wht is solution to to get image path of server while i run in lan connection? Link to comment https://forums.phpfreaks.com/topic/182745-problem-in-getting-server-path-to-get-display-that-image/#findComment-964691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.