PHP related files only work when launched from dreamweaver

Linear88

New Member
I am starting to learn php, I made a form that uses a php file to write the information into an xml file. The form is in an html file, and the php action in a seperate file. I am using EAsyphp 12.1 Whenever I use the upload form publishing it through dreamweaver everything goes fine.But when I open it directly into the broswer it shows me part of the php code.This is the code for html\[code\]<form enctype="multipart/form-data" action="chng.php" method="POST"><div>Name <input type='text' name="tf" /> </div><div>image <input name="uploadedfile1" type="file" /> </div><br /><input type="submit" /></form>\[/code\]The php is \[code\]$target_path4 = "../img/";$target_path4 = $target_path4 . basename( $_FILES['uploadedfile4']['name']);$name4="../img/linkimagen.jpg";$t = $_POST['tf'];if(move_uploaded_file($_FILES['uploadedfile4']['tmp_name'], $name4)) {$xml = simplexml_load_file('info.xml');$xml->names[0]=$t;file_put_contents('info.xml', $xml->asXML());$xml->images[0]=$shortname;file_put_contents('info.xml', $xml->asXML());}?>\[/code\]The xml information is then picked up by another page using Jquery ajax.Everything works fine if I launch the form file using dreamweaver as I said before. Also, sometimes the page that displays the information from the xml will display it if opened directly from the browser, other times it won't, however it will always display if opened from dreamweaver. I've found information for php not working in dreamweaver but not the opposite, as is my case. Is there anything I have to do so it works always? Thanks for any info!
 
Back
Top