dario Posted April 17, 2014 Share Posted April 17, 2014 when i dont use the include function the file works as i want only i dont have any functions then, that is why i really need to include my functions file and my register.inc. i have never used include before so please help me i need to get it before tuesday because its for a school assignment. when I do use the include the file only shows his code in the browser. sorry for my english im a dutch student grtz Dario register.php register.inc.php functions.php Quote Link to comment https://forums.phpfreaks.com/topic/287843-when-using-include-the-php-code-does-not-execute/ Share on other sites More sharing options...
dario Posted April 17, 2014 Author Share Posted April 17, 2014 i also followed this tutorial to make my register/login code http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL Quote Link to comment https://forums.phpfreaks.com/topic/287843-when-using-include-the-php-code-does-not-execute/#findComment-1476487 Share on other sites More sharing options...
Solution Ch0cu3r Posted April 17, 2014 Solution Share Posted April 17, 2014 (edited) Looking at the code, you are using includes correctly. The problem that can arise is that PHP cant find the files you are trying to include and so it will either log an error in the servers error log or display an error message, when I do use the include the file only shows his code in the browser. But this to me sounds like you are not running your .php files correctly. I have a feeling you are loading the php files directly into your browser (eg the address bar looks like file://path/to/file.php). If this is true then this not the correct way to run PHP code on your computer. To run PHP code on your computer you need to download PHP and and configue it with a http server. There are packages available you can download and install to allow you to do this. Most popular being WAMP - For Windows Only XAMPP - For Mac, Linux and Windows MAMP - For Mac Only Once you have installed the package for your platform you store the PHP files in the packages document root folder and then to run th php files you goto http://localhost Edited April 17, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/287843-when-using-include-the-php-code-does-not-execute/#findComment-1476488 Share on other sites More sharing options...
dario Posted April 17, 2014 Author Share Posted April 17, 2014 i have WAMP already running but i have the feeling this isnt working properly. Thank You very much if I have another question i will surely use this website again! Quote Link to comment https://forums.phpfreaks.com/topic/287843-when-using-include-the-php-code-does-not-execute/#findComment-1476490 Share on other sites More sharing options...
Ch0cu3r Posted April 17, 2014 Share Posted April 17, 2014 have WAMP already running Then your php files should then be stored in C:/wamp/www . You then open http://localhost to run them but i have the feeling this isnt working properly If i remember correctly, if WAMP is running there should a green wamp taskbar icon in the taskbar. If it is red or yellow then it is not running or has an encountered an error. Quote Link to comment https://forums.phpfreaks.com/topic/287843-when-using-include-the-php-code-does-not-execute/#findComment-1476491 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.