chunkymonkey11 Posted August 10, 2012 Share Posted August 10, 2012 Hi guys, I am new to using PHP and HTML and any help would be appreciated. I am trying to make a website for my business, and I bought Dreamweaver and Installed XAMPP on my Win 7 computer. The HTML design was simple to make, but when I tried making a login system I was told to create a PHP script. I went online I found some great videos on how to script PHP in Dreamweaver. The first problem I encounter is when I start typing PHP inside Dreamweaver; the starting (<?php) don't turn red, the whole script stays normal text black. My HTML and PHP login files are not saved in my XAMPP htdocs, they are saved in a folder on my desktop. When I finished my PHP script (still in normal text color) and click on the html file to test it out, my html does not execute the login that my PHP script tells it to do. When I type in username and password then click submit (in my html file), a dialog box opens telling me to save or open the php login file. I tried to give you as much information as possible, and any help would be great! I thought starting a business was the hard part, but I was mistaken. Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/ Share on other sites More sharing options...
Christian F. Posted August 10, 2012 Share Posted August 10, 2012 I recommend that you start with a regular text editor, and a PHP tutorial, to learn the basics. Using an WYSIWYG editor to learn PHP is making things harder than what they need to be, as it often gets in the way and does things you don't want to do. The PHP manual is a great resource to go to, both for learning PHP and for those of us who know a bit more. Also, you'll need to run the PHP file through a web server, to get it to parse the PHP code before sending it to the browser. It's a server-side scripting language, after all. Storing it on the desktop will not help, as the web server doesn't know where the file is. (Nor are you requesting the file via the server, which you need to do.) Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368397 Share on other sites More sharing options...
Porl123 Posted August 10, 2012 Share Posted August 10, 2012 Have you tried putting the files in htdocs and running from that location from the browser? Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368401 Share on other sites More sharing options...
chunkymonkey11 Posted August 10, 2012 Author Share Posted August 10, 2012 I see what ChristianF is saying (and I will most likely have to end up doing that), but I am still confused on why Dreamweaver does not color coordinate the PHP code (tried to call Adobe but the hold time was 1.5+ hours); when I first got my Dreamweaver it would color coordinate PHP like everybody else, but now it does not. Another question that pops up in my mind is what is the color coordination for (is it commands that need to be color oriented for the server to understand)? Example: tags: red, echo: green, ect Porl123: No, I was considering do that, but I was a bit confused: htdocs are for both php and html, or do I put html in htdocs, and PHP in another XAMPP root folder? I appreciate the quick responses from you guys! You guys sure beat Adobe by a lot! Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368412 Share on other sites More sharing options...
Porl123 Posted August 10, 2012 Share Posted August 10, 2012 Typically you would put the entire directory in htdocs and run the project from there. You can only preview HTML in browser, the PHP will be displayed as text. You need to have PHP installed into your environment, which XAMP does, so I'd run your PHP files from there. Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368415 Share on other sites More sharing options...
Christian F. Posted August 10, 2012 Share Posted August 10, 2012 The htdocs folder is for all the files that he web server should be able to serve, just like the web root on the host where you are planning to put the finished product. So, put all of the files in there, and make sure the site works using your browser going through your browser. As for why it's not colour coding the PHP tags/code, that can be because a number of reasons. Most likely because you're either not in the raw code editor, or that the file doesn't have the correct file extension. Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368417 Share on other sites More sharing options...
chunkymonkey11 Posted August 10, 2012 Author Share Posted August 10, 2012 That would make sense, I guess I will try that out. Now regarding the color coding: I think there might be something wrong with my Dreamweaver since I saved the file as a PHP file and I go into the files code environment so I guess it could be the preferences that causes it. One last thing that I have a question about is on my desktop my html files looks like explorer (because explorer opens it) but my PHP file looks like a text document. It opens with Dreamweaver though. Could that have something to do with why instead of executing the PHP script it thinks its a text file and asks me to save or open it, or it that how its supposed to be and keeping it in the htdocs should causes that to not happen? Also towards ChristianF: Since you recommend a WYSIWYG editor, any you would recommend? Thanks again guys! Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368424 Share on other sites More sharing options...
Christian F. Posted August 10, 2012 Share Posted August 10, 2012 I recommended something which isn't a WYSIWYG-editor, as they tend to get in the way (and produce crappy code). For a list of different editors, most of them good, please look in the Editors thread. The reason the browser asks you to save the PHP file is because it doesn't know how to parse it, you have to request it via a web server. You cannot open it directly on your computer, via a local file path. Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368438 Share on other sites More sharing options...
chunkymonkey11 Posted August 10, 2012 Author Share Posted August 10, 2012 Sorry for the mistake ChristianF. Thanks for all the help, I think this case is closed I'm off to the Editors thread Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368443 Share on other sites More sharing options...
Christian F. Posted August 10, 2012 Share Posted August 10, 2012 That's OK, and you're welcome. Good luck on your project. Quote Link to comment https://forums.phpfreaks.com/topic/266914-help-with-php-in-dreamweaver-using-xampp/#findComment-1368447 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.