.-INSANE-. Posted March 17, 2006 Share Posted March 17, 2006 ok i go to preview it on the dreamweaver thing and some of this script shows up i cant figure out whats wrong[code]<?PHPif($_POST['submit']){$directory = "/home/username/public_html/files/";$max_file_size = "26214400";$allowedfile[] = "video/x-ms-wmv"; $allowedfile[] = "video/x-msvideo"; $allowedfile[] = "video/mpeg"; $allowedfile[] = "video/quicktime"; if (is_uploaded_file($_FILES["file"]["tmp_name"])) { if($_FILES["file"]["size"]>$max_file_size) { $is_uploaded = "failed"; echo 'Sorry, this file is too large. The maximum filesize is '.$max_file_size.' bytes, although your file is '.$_FILES["file"]["size"].'. '; exit(); } if(!in_array($_FILES["file"]["type"],$allowedfile)) { $is_uploaded = "failed"; echo 'Sorry, wrong file type, "'.$_FILES["file"]["type"].'" is not allowed. '; exit(); } if(file_exists($directory.$_FILES["file"]["name"])) { $is_uploaded = "failed"; echo 'Sorry, this file already exists. '; exit(); if($is_uploaded!="failed") { $replace = array("$","%","#","@","!","&","^","*","(",")","-"); $new = str_replace($replace,"",$_FILES["file"]["name"]); $fileName = str_replace(" " , "_" , $new); if(! is_dir($directory)){ mkdir($directory,0777); } if (move_uploaded_file($_FILES["file"]["tmp_name"], $directory.$fileName)) { echo "Your file, ". $fileName ." has successfully been uploaded! Click <a href=\"".$directory.$fileName."\">Here</a> to view your file."; } else { echo 'Sorry, your file has not uploaded.'; exit(); } }} else { echo 'There has been an unknown error while uploading'; exit();}}?>[/code] Quote Link to comment Share on other sites More sharing options...
shortj75 Posted March 17, 2006 Share Posted March 17, 2006 if you do not preview it throught a web browser by typeing [a href=\"http://127.0.0.1\" target=\"_blank\"]http://127.0.0.1[/a] or your ip address or webpage name you will see the code because php only parses it through a web browser Quote Link to comment Share on other sites More sharing options...
txmedic03 Posted March 17, 2006 Share Posted March 17, 2006 Actually it has nothing to do with the browser, but PHP is only processed with an interpreter. Dreamweaver does not have an interpreter. You can configure your local system to execute php scripts via the php interpreter or via a httpd, which employs the php interpreter to process the script before passing it to the client that generated the request (generally a web browser). Quote Link to comment Share on other sites More sharing options...
.-INSANE-. Posted March 19, 2006 Author Share Posted March 19, 2006 ok so what do i do then to fix it Quote Link to comment Share on other sites More sharing options...
.-INSANE-. Posted March 19, 2006 Author Share Posted March 19, 2006 *bump* Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 20, 2006 Share Posted March 20, 2006 Down load [a href=\"http://www.apachefriends.org/en/xampp-windows.html\" target=\"_blank\"]xampp[/a] which installes Apache 2, PHP 5, Mysql, perl, python... on your PC. Then you can test your PHP scripts locally.Ken Quote Link to comment Share on other sites More sharing options...
.-INSANE-. Posted March 20, 2006 Author Share Posted March 20, 2006 ok i got it now i dont understand what to do i go to dreamweaver and it still shows up bad and i dont understnad whats wrong wit iti alos cant get apache to start only thing running is mysql is that the problemok i now uninstalled and then reinstalled and now i have FileZilla running but when i hir start on Apache itll strat for a quick second then itll end Quote Link to comment Share on other sites More sharing options...
txmedic03 Posted March 21, 2006 Share Posted March 21, 2006 The million dollar question is what is the conflict in your configuration which causes Apache to fail to load. Are there any error messages returned when you try to start Apache?Dreamweaver will not view PHP files correctly because it does not contain an interpreter and therefore can not comprehend it or the desired end results of it. I don't think I can make it any clearer, at the moment. If anyone feels the need to elaborate, please do so.Edit: Dreamweaver was only designed to edit (x)html/javascript/dhtml/etc...things that a web browser processes as this deals with the end result. It was not designed to handle things that are processed on the server-side. Quote Link to comment Share on other sites More sharing options...
.-INSANE-. Posted March 22, 2006 Author Share Posted March 22, 2006 is there a plugin for a n interpreter in dreamweaver Quote Link to comment Share on other sites More sharing options...
txmedic03 Posted March 22, 2006 Share Posted March 22, 2006 Though that would be a wonderful tool for those that do not understand (x)html, but would like to make minor changes to their premade scripts, I have no knowledge of such a thing. My suggestion to you is to spend a little time studying xhtml, php and css. Then, if you insist on using a WYSIWYG editor, you will be able to design the page in the editor and go to code view and insert php snippets. It won't look right in the editor, but then you can view it on the server. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.