MY PHP works (PHP support is “automatically” supplied by my hosting company), but when the web page (http://mywebsite/xxx.htm) executes the PHP (uploader.php) from the , the browser displays a new web page (http://mywebsite/uploader.php) and the echo occurs on that page and not on the calling web page (http://mywebsite/xxx.htm). I want the PHP to execute behind the scenes and display any messages on the calling web page or a separate popup window. This is the first time I’ve used PHP, so I’m sure I’m missing something basic here.
My HTML (xxx.htm - snippet below) uses to upload a file:
Choose file to upload:
My PHP (uploader.php - see below) uploads the file:
<?php // Directory where the uploaded file is going to be placed $target_path = "uploads/"; // Use the original filename $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?>Thanks for any help!