This is a discussion on "Passing Variables to a require_once() Page" within the PHP Forum section. This forum, and the thread "Passing Variables to a require_once() Page are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Passing Variables to a require_once() Page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hi, I have a page that I want to add to all the pages on my site (the navigation), I am using require_once() to add the navigation html page to the pages, this is working beautifully. But how do I send a variable to the page in the require_once() function? For example:
|
|
|
|
|||
|
Re: Passing Variables to a require_once() Page
u mean $_POST['name'] ?
|
|
|||
|
Re: Passing Variables to a require_once() Page
you should be able to put $var = $_POST['name']; in the require_once file and then use it on the page that has the included file.
|
|
|||
|
Re: Passing Variables to a require_once() Page
The require_once() function is only needed when you are pulling in a file of functions and you code is such that this command could execute more than once. If you just need to pull in a common html file, such as the navigation for a site, then you should be using the
Any php code within this file can pick up any variables set by other snippets of php elsewhere in the host file. |
![]() |
| Tags |
| passing, variables, require_once, page |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing variables from PHP to Flash | tox0tes | Flash & Multimedia Forum | 4 | Dec 29th, 2007 06:46 |
| Passing Flash variables between frames | lostnights | Flash & Multimedia Forum | 0 | Jan 22nd, 2007 17:09 |
| Passing variables from Flash to PHP | LostProphet | Flash & Multimedia Forum | 6 | Aug 31st, 2006 14:05 |
| passing post variables | benbacardi | PHP Forum | 5 | Jul 5th, 2005 22:13 |
| PLEASE HELP - Passing Variables in Querystring | just_the_basix | Classic ASP | 40 | Sep 3rd, 2004 10:46 |