I have a simple php connection to my database, I think i did most of the process right, but when I hit the submit button it just renders my actual php file on my screen.
Asked
Active
Viewed 44 times
-2
-
4Use PDO or MySQLi, the regular msyql_* functions are deprecated, also use prepared statements. – angelcool.net Nov 07 '15 at 18:56
-
5Also **paste code** not an image into your question – RiggsFolly Nov 07 '15 at 18:57
-
3Do not use MySQL functions to communicate with your DB try to use PDOs. Do you have PHP and MySQL enabled on your Web server ? – Cyprien Aubry Nov 07 '15 at 18:58
-
2paste your code instead of image – stackers Nov 07 '15 at 19:00
-
1Also paste server config... thi is a server problem – Simone Nigro Nov 07 '15 at 19:03
-
1Possible duplicate of [PHP code is not being executed (I can see it on source code of page)](http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-i-can-see-it-on-source-code-of-page) – Simone Nigro Nov 07 '15 at 19:08
-
1half a meg of picture storage for that nonsense – Drew Nov 07 '15 at 19:50
-
sorry drew, won't happen again, can'y image if you were the one paying for it! – rc_dz Nov 08 '15 at 04:09
1 Answers
2
Make sure you are using a web server that supports PHP
. It is rendering the code because PHP
is not processing your code and renders it as text.
Try using another web server or install PHP
on your current setup.
Also use MySQLi
or PDO
for your database part (it's safer and mysql_*
is deprecated).

chris85
- 23,846
- 7
- 34
- 51

Marnix Bouhuis
- 430
- 1
- 6
- 15