I have a register page I retrieved off of the following site. I downloaded the source code and extracted the file, finding the login.php
. I open it in Adobe Dreamweaver CS3 which loads it and shows no code, but when I click Preview in Chrome, Chrome shows the entire files code, which is shown below. When I click Preview in iExplore, it does the same. Am I doing something wrong or is there something I don't have on my laptop? I have not put the rest of the code for the webpage because I feel it is irevelent as when I cut the php code out and tested it it the page shows. It is just when I insert the PHP code. After the PHP is the normal code that Dreamweaver places in at the start of a new HTML or PHP file.
<?PHP
require_once("./include/membersite_config.php");
if(isset($_POST['submitted']))
{
if($fgmembersite->Login())
{
$fgmembersite->RedirectToURL("login-home.php");
}
}
?>
To display PHP on your computer you need to have a local PHP server set up. Without it there is no PHP engine that can interpret and parse your code to make it in to HTML for the browser.
If you haven't got a PHP server installed locally, then you will need to upload your files to a server via FTP, where PHP is installed.
You'll need a local web server with a PHP interpreter to parse the PHP code. There are a few to choose from. I personally use WAMP. Once it is installed place your php files in wamps www folder and browse to it in your browser using http://127.0.0.1/yourphpfilename.php
It should display the php output instead of the code then.
PHP file must be interpreted by web server (you may use XAMPP, which is popular set of servers for Windows including Apache HTTP server, MySQL database server and PHP extension for Apache).
Server executes PHP code and sends script output/result via http protocol to web browser.
Opening that file via filesystem is bad idea, because PHP file will be read as plain text if it is not processed by web server with PHP.
It looks like, you dont understand how PHP works. You need to read some books about web fundamentals.
Eventually you can visit http://thenewboston.org or http://phpacademy.org - they have very good educational videos.
One more advice to consider:
In my personal opinion Dreamwaver is very bad tool for learning PHP. For learning purposes I recommend to use Notepad++ or some other IDE (maybe NetBeans PHP edition). It will help you to understand more.
How to debug php code in dreamweaver cs5?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With