Jump to content

problem in getting server path to get display that image..


chennaibala

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.