i am trying to execute my php code, instead it just blows it back at my screen. page should be black to execute the code at the background.
I've let other poeple use this same code worked for them.
i am trying to execute my php code, instead it just blows it back at my screen. page should be black to execute the code at the background.
I've let other poeple use this same code worked for them.
After setting xampp on your local pc, you've created a local server with apache, mysql, php stack. So when you write any php code, you need to execute/interpret it through your local server.
For example you need to use localhost/phpmailer_test/index.php
not file:///C:/xampp/htdocs/phpmailer_test/index.php
. If it was a .html
file then you can use the file path to execute it but for server side language like php, python and so called server side languages you've to execute your code base through a server.
Seems like you are accessing your file through the file system, which means you are using your browser as something like a text editor. In order to have the php file executed on opening there are several things that you must do:
localhost
or 127.0.0.1
.In your case you are using XAMPP, so the htdocs
folder should be the 'root' of your local server, then you will be able to access any folder within there by entering the path after htdocs
. In your case it should be localhost/phpmailer test/index.php
.