Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,831 members, 7,802,662 topics. Date: Friday, 19 April 2024 at 06:27 PM

My Php Code Does Not Execute But Displays Code On Browser, - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / My Php Code Does Not Execute But Displays Code On Browser, (3128 Views)

I Can't Solve This Error On My Php Page... / My Php Code Does Not Execute But Displays Code On Browser, / PHP Code To Insert And Retrieve Images From Mysql Server (2) (3) (4)

(1) (Reply) (Go Down)

My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 12:22pm On Jun 30, 2016
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx
Re: My Php Code Does Not Execute But Displays Code On Browser, by elfico(m): 12:31pm On Jun 30, 2016
Capacchino:
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx


You are likely not running the code on the server.
If you are using xampp, verify that the php file is saved under c:\xampp\apache\htdocs
Re: My Php Code Does Not Execute But Displays Code On Browser, by damlax: 12:32pm On Jun 30, 2016
Are you using lamp or other software or else it won't show on your browser because browsers defaultly read only HTML , CSS
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 12:39pm On Jun 30, 2016
Am using wamp server as my local server, and my Php fil is stored c:/wampserver/www/filename
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 12:41pm On Jun 30, 2016
elfico:



You are likely not running the code on the server.
If you are using xampp, verify that the php file is saved under c:\xampp\apache\htdocs

I am using wamp server and my Php file is on c:/wampserver/www/filename.php
Re: My Php Code Does Not Execute But Displays Code On Browser, by elfico(m): 12:51pm On Jun 30, 2016
Capacchino:


I am using wamp server and my Php file is on c:/wampserver/www/filename.php
check for the folder called htdocs in C:\wampserver\ or C:\wampserver\apache.
Then move your project there.
Are you using an IDE for your coding?
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 12:58pm On Jun 30, 2016
elfico:
check for the folder called htdocs in C:\wampserver\ or C:\wampserver\apache.
Then move your project there.
Are you using an IDE for your coding?

OK. I will try it.. I'm using notepad++

I av moved file to htdocs, its not executing still, code is showing on my browser
Re: My Php Code Does Not Execute But Displays Code On Browser, by hollyfat(m): 2:38pm On Jun 30, 2016
Capacchino:
Greetings experts,
I am a php beginner. I observed that whatever code I write does not execute on the browser, but the browser displays back whatever I have coded instead of the output. Don't rilly know my way around d problem, I need ur suggestions, pls.. Tnx

Hope you are using localhost to access your code
Re: My Php Code Does Not Execute But Displays Code On Browser, by Vstuffs(m): 3:32pm On Jun 30, 2016
Try accessing your code like this
Localhost /filename.php
Save the file inside your htdocs folder in your wamp directory
And make sure your Apache is working
Re: My Php Code Does Not Execute But Displays Code On Browser, by Dlastofmykind(m): 4:49pm On Jun 30, 2016
I hope the file is saved as .php and not as .html?
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 4:55pm On Jun 30, 2016
hollyfat:


Hope you are using localhost to access your code
Yes I am
Re: My Php Code Does Not Execute But Displays Code On Browser, by hollyfat(m): 5:09pm On Jun 30, 2016
Capacchino:
Yes I am
try using http://127.0.0.1
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 5:32pm On Jun 30, 2016
Dlastofmykind:
I hope the file is saved as .php and not as .html?
Yes it s saved as. php
Re: My Php Code Does Not Execute But Displays Code On Browser, by ekeroyal(m): 7:38pm On Jun 30, 2016
I have a few questions to ask you OP



1. Is this your first PHP script?



2. If the first answer is no, are other scripts working well?



3. What browser(s) are you using?



4. Did you embed your PHP code in html or just plain PHP code?


Try pasting your code here, if you don't mind.
Re: My Php Code Does Not Execute But Displays Code On Browser, by Capacchino: 10:25pm On Jun 30, 2016
Its has been resolved, i just uninstalled and reinstalled wamp server, den I saved on my www folder.. Den used d localhost/foldername/filename.php on d browser...
Tnx for all ur suggestions and opinions, i am grateful

(1) (Reply)

Between Salesforce And AWS / My New Complete English Classic Android App / Download Spynote RAT V6.5 And Hack Android Devices Remotely

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.