PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hey guys wondering if you could help me with this...
I have a php file that generates a title bar when you give it a variable (title_bar.php?id=car)
I'm trying to include this file in another php file...so i used
Now it works but the picture does not work so i'm guessing theres a file path issue...not a big deal. But how do i send the car variable into the php file? when i try this i get an error saying file does not exist. I also tried to use include in the echo statement of the main page with no success. Any ideas?
if title_bar.php is in a different directory, you'll need to tell php where to find it. Either using absolute paths (/home/server/yourdomain/public_html/includes/title_bar.php), relative paths (../includes/title_bar.php), or alter the include_path (php.ini or dynamic) settings: set_include_path()/get_include_path()
feyd wrote:if title_bar.php is in a different directory, you'll need to tell php where to find it. Either using absolute paths (/home/server/yourdomain/public_html/includes/title_bar.php), relative paths (../includes/title_bar.php), or alter the include_path (php.ini or dynamic) settings: set_include_path()/get_include_path()
yes it works, but when i try to use title_bar.php?id=car it does not work, thank you
On a side note, if that works, you have register globals on, which generally is very much not a good thing. You may either want to talk to your host about turning it off, or be very careful how you write scripts to make sure they do not rely on the feature.
Always remember to initialize variables before reading from them...