php-include

Why does my PHP appear to be commented out when I view it in the browser? <!--?php include(“header.php”); ?-->

时光毁灭记忆、已成空白 提交于 2019-12-18 09:08:14
问题 I am building a html page but want to break the header out so I dont have to keep changing all the files. I am attempting to add a php.include file and save the pages out as .php files. For some reason the header.php file is not showing in my file when i view it. here is my code. Is this the correct way?? <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Chartego | Creating Socially Inflential People with great images and videos</title> <meta http-equiv="content-type"

PHP not passing variable

偶尔善良 提交于 2019-12-13 01:15:55
问题 I've encountered a rather weird problem that has me completely stumped. I'm trying to pass a PHP variable from one file to another, then plug that variable into a search function within the Flickr API. To put in context, it's pulling a variable ($location) containing the location of a weather forecast. $location (located in scraper.php), which is defined by user input, goes into the search function. The function sends a request to the Flickr API, which returns an image url. as it goes:

PHP website template include code

五迷三道 提交于 2019-12-12 06:01:42
问题 I am trying to have this code on my index.php page so that all I have to do is write short files with nothing but html in them to serve as separate pages of the site. For example: Instead of having the index, about, and contact pages all have the same code for the template, i want to have JUST the index page have the website template, and have a link to about and contact on the main page navigation such as <a href="index.php?id=about.html">About</a> <a href="index.php?id=contact.html">Contact

make php form-generated variable available in two php files

我怕爱的太早我们不能终老 提交于 2019-12-12 01:15:40
问题 I have a form, Form_hour.php , that is loaded into the browser, and allows a user to select an hour. The form sends the variable $hour , via action="get" , to the file View_A.php which uses $hour to query a database, and then loads View_A.php into the browser window, showing data for the selected hour. In View_A, there is a button allowing the user to switch to View_B. The idea is that when the user clicks on View_B, the file View_B.php loads in the browser. View_B.php , like View_A.php ,

PHP Dynamic Include Help on Index.php?

99封情书 提交于 2019-12-11 18:35:54
问题 I need someone to let me know a solution to this issue. I am trying to create an include on my index.php file so when a user clicks a link on my navbar the content on the index.php changes. The code below works great, except when I go to index.php, because it is not part of the array, it calls main.php twice, instead of once. I know this is because of the last portion that says: else { include('main.php'); } However, I need a solution to this because I am not good with php. Here is my full

PHPUnit cannot find source code

白昼怎懂夜的黑 提交于 2019-12-11 08:25:25
问题 I have a PHP project, with the following project structure. php_test_app src Vegetable.php tests StackTest.php VegetableTest.php The code of these files is shown below. I use PDT and PTI in Eclipse. PHPUnit in Eclipse recognizes that VegetableTest.php belongs to Vegetable.php , because you can toggle between them using the toggle button. I first try to run the test code by selecting the tests directory in the PHP Explorer and click Run Selected PHPUnit Test . It runs both tests, both the

PHP include semantics

孤人 提交于 2019-12-10 20:15:37
问题 I am trying to work out how to interpret PHP's include construct, e.g. whether it is textual inclusion, when it is evaluated etc. As usual, the documentation is rather informal and vague. Based on experimentation, it seems to be syntactic sugar. Specifically, the construct include 'Baz.php' is an expression which can be replaced with eval('?>' . file_get_contents('Baz.php', FILE_USE_INCLUDE_PATH)) Is this correct? Is this substitution true in the general case, or just in my tests? Edit: as

Php Error - Unexpected require_once expecting function

雨燕双飞 提交于 2019-12-08 07:37:14
问题 I'm currently trying to fetch the medoo framework so that I can begin easily retrieving data from my MySQL database... and for some reason it doesn't work! here's the code of my signin.php file <?php function loginUserAccount($loginname, $password){ // Include Medoo (configured) require_once 'medoo.min.php'; // Initialize $database = new medoo(); $email = $database->get('MM_Users', 'Email', [ 'ID' => 1 ]); return $email; } ?> And the error: Parse error: syntax error, unexpected 'require_once'

include(): Failed to open stream: No such file or directory

[亡魂溺海] 提交于 2019-12-04 02:59:25
问题 This might just come as a very silly question, but i am really frustrated of this not working. I have a home file (home.php) which has contains <? include ("/production/fetch_order.php"); ?> . As it can be seen i am trying to access a file from home.php. The file is named as fetch_order.php which is in the production folder. My path is correct, the spellings are absolutely correct too. However i end up with this error: Warning: include(/production/fetch_order.php) [function.include]: failed

include(): Failed to open stream: No such file or directory

梦想与她 提交于 2019-12-01 15:36:58
This might just come as a very silly question, but i am really frustrated of this not working. I have a home file (home.php) which has contains <? include ("/production/fetch_order.php"); ?> . As it can be seen i am trying to access a file from home.php. The file is named as fetch_order.php which is in the production folder. My path is correct, the spellings are absolutely correct too. However i end up with this error: Warning: include(/production/fetch_order.php) [function.include]: failed to open stream: No such file or directory in /path/to/home.php on line 119 Warning: include() [function