RE: question about some php code

  • From: Alex Parks <mehgcap@xxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sun, 21 Oct 2007 09:44:22 -0400

That makes sense, but everything is on the server so why, when the page is downloaded, does the code not run after being written? Thanks for the help.

Have a great day,

----- Original Message -----
From: Ilian Andreev <ilian_andreev@xxxxxx
To: programmingblind@xxxxxxxxxxxxx
Date sent: Sun, 21 Oct 2007 12:24:32 +0300 (EEST)
Subject: RE: question about some php code

Hello, the reason why your code doesn`t execute is because PHP is
server-side language, i.e. it is only processed on the server. Thus when your print PHP statements via "echo" through your Javascript, which in terms is a client-side language, i.e. processed on your machine, you actually print pure HTML and text, and nothing happens. Note that you can do the reverse sometimes, print javascript via PHP and it will get executed because you pass it to the client-side. Hope you understood me here. I couldn`t figure out why you choose to print via javascript when you could simply echo-ed it: <?php echo'$REMOTE_ADDR';?>.

Now to the second question.

In your solution, you don`t actually upload the file but just
read its name and tmp_name. Use bool move_uploaded_file ( string $filename, string $destination ) to upload the file like this:

$target_path = 'upload/';
$target_path = $target_path . basename(
$_FILES['uploadedfile']['name']) ;
echo "The file ". basename( $_FILES['uploadedfile']['name']). "
has been uploaded";
else {
echo "Sorry, there was a problem uploading your file.";

P.S. I changed the current dir to "upload" dir relative to the
uploader.php file because it didn`t work on my home Windows server with the current directory.

ÅËÀ è íàïðàâè ñâîé ñàéò, îòêðèé íîâè ïðèÿòåëè!
View the list's information and change your settings at

View the list's information and change your settings at

Other related posts: