Questions tagged [php-include]

The `include()` function in PHP includes code from other PHP files and copies them into the file that uses the include statement.

The include() function in PHP includes code from other PHP files and copies them into the file that uses the include statement.

It is identical to the require() function, except that whilst the include function will emit a warning (E_WARNING) when no file is found, the require function will throw a fatal error (E_COMPILE_ERROR), which will cause the script to abort.

Each time a file is included through the include function, the file will be read and executed. To include a PHP script just once, you can use the include_once() function.

252 questions
-1
votes
2 answers

See the location from /includes

I have upload my site to my server, but he can't find the folder /includes/header.php. Can I echo the location where he looks to the file. The only error I see now is: Warning: include(/includes/header.php) [function.include]: failed to open…
Thom
  • 591
  • 4
  • 12
  • 30
-1
votes
1 answer

Not getting variable values from 1 domain to another using include

I am trying to get the value of a variable from one domain to another using php include , but it is not working. firstdomain.com/test1.php seconddomain.com/test2.php
Sunil
  • 9
-1
votes
2 answers

Is it wrong to use 'include' for redirecting user to another PHP file?

I have created a HTML login form which checks for email and password authentication and then redirects to the user account. My PHP code is as below:
user3428959
-1
votes
1 answer

How to include a file from the base domain into a third level domain with php?

I need to include a url with php from my base domain www.site.it in some pages from a third level domain (www.cms.site.it). I know that include external files is possible by enable the php.ini commandsa allow_url_include and allow_url_fopen, but…
Samuel
  • 43
  • 7
-2
votes
1 answer

include php file in echo html code

I cant get this syntax to work, already tried modifying it many time. ".$item['stockid'].""; ?>
-2
votes
3 answers

PHP Header Include (nav bar) not showing up

CLARIFICATION: Being that I've never used PHP, it was unclear how to format the PHP file, so that when you include it in the index, then header(nav bar) would show up. No posts explained why I had to change my index.html to index.php to make it…
blackRob4953
  • 1,585
  • 2
  • 12
  • 15
-2
votes
2 answers

How to desgin a website in php and use header, footer and other common pages effectively

Now a days I am designing a website in php and I want to add more than 5 pages which should have same styles for ex- All the pages should have same header, footer, left side bar, right sidebar etc. I know that I can do this using include() method…
RajSharma
  • 1,941
  • 3
  • 21
  • 34
-2
votes
1 answer

Wordpress and PHP includes

If I was looking to use my own HTML for a certain page on my wordpress theme, how can I go about it? Please advise where code should go If I can use raw HTML or PHP INCLUDES.
-2
votes
2 answers

Is it secure to use include() to connect to server and database?

Is it secure to use a PHP file with connection parameters, and include that file to the page? example: include("connect.php"); connect.php: $con=mysqli_connect('localhost','root','','database') or die(mysqli_connect_error($con)."- In line:…
sisae
  • 13
  • 2
-2
votes
1 answer

Showing php variable from a different page onto an html page

I have a my navbar script on a file called navbar.php. I include this file at the top of all other pages of my website. What I am trying to do now is to customize the navbar with the name of whoever is logged in. Let's say I have a php file named…
applemavs
  • 503
  • 3
  • 9
  • 22
-3
votes
1 answer

Implement script within included php file

I am in the process of loading paragraphs from php files, which I then include on my site using the include_once method. The first paragraph loads as soon as the page loads. The problem is: when I try to implement js (jQuery) on certain elements…
ar002
  • 9
  • 2
-3
votes
3 answers

How to achieve "compile-time includes" in PHP?

PHP's include and require functions occur at runtime. Consider this script, page1.php:
Pacerier
  • 86,231
  • 106
  • 366
  • 634
1 2 3
16
17