Running php in JavaScript
<p>I am making an application on my server, where the user uploads an image through some HTML combined with javascript.</p>

<p>The user finds an image on the computer through </p>

<pre><code>&lt;form action="uploadimage.php" method="post"
enctype="multipart/form-data"&gt;
&lt;label for="file"&gt;Filnavn:&lt;/label&gt;
&lt;input type="file" name="file" id="file" value="100000" /&gt;
</code></pre>

<p>Then the point behind the javascript, is to validate on the users image</p>

<pre><code>if(picture_headline.value == "" || picture_uploaded.value == "" || !ischecked)
{
   // Don't execute, stay on same site
}
else
{
   // execute php and upload image
}
</code></pre>

<p>the php is an upload image php script</p>

<pre><code>&lt;?php 
// The file is being uploaded into the folder "upload"
$target = "/navnesutten.eu/facebook/uploads/"; 
// add the original filename of our target path
$target = $target . basename( $_FILES['uploaded']['name']) ; 
$ok=1; 
// Moves the uploaded file into correct folder
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} 
else {
echo "Sorry, there was a problem uploading your file.";
}
?&gt; 
</code></pre>

<p>I must say I am a bit confused here, since I have only been working with html, php and javascript for a few days now.</p>

<p>Am I totally off or what?</p>

<p>I found some "simple" examples online, which I put on my server through cuteFTP, but everytime i press upload, the website just sends me to the .php file and says the site doesn't exist.</p>
