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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello, i've pretty much forgoten everything i knew about php since i havent used it in years. i know this is simple but i was woundering if someone could help me out.. heres what im trying to do
myurl.com/index.php?id=gallery
now when this is entered the page i need it to include a seperate php file into my template heres the code ive tried
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by seeker2921 on Mon Sep 04, 2006 12:18 pm, edited 1 time in total.
i tried setting $id=($_get['id'])} in attempt to correct it earlyer. didnt work, see the first half of the code works fine. its when i add the id in the url it mess' up.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
thanks feyd, i went there and found a useful post. i tried this code
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i tired it, no luck. I then tried this code it did fine the first part but when i added the main.php?id=gallery it gave me this error message
Warning: main($links): failed to open stream: No such file or directory in /home/stephen/public_html/main.php on line 160
Warning: main($links): failed to open stream: No such file or directory in /home/stephen/public_html/main.php on line 160
Warning: main(): Failed opening '$links' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/stephen/public_html/main.php on line 160
Single quote strings are string literals. They do not parse any variables inside of them. In this particular case, you don't need quotes at all. However, apparently $links is an array.