What I think your trying to say is,
How do I upload an image to a file on my server, then send that path to the browser when I need to display the image?
If so,
<form method="post" enctype="multipart/form-data" action="path/to/php/script">
<input type="file" name="myImage" />Upload Photo:
<input type="submit" value="Submit">
</form>
You can use JavaScript to submit the form or the submit input.
Next you'll have a php script on your server that stores the image in a file and saves the image path to a database or flat file. When you want to send this image back to the client, you'll have to use PHP (or another more prestigious language). I would send a JSON object to your client, so that you can work in JavaScript properly. But, if you want to do it in php you can always try this,
window.onload(<?php echo imageVariable; ?>);
Some would consider that bad practice I guess.
Let me know if I can help any further.