Computer Science Canada help with site. |
Author: | Lazarus [ Sat May 21, 2005 9:19 pm ] |
Post subject: | help with site. |
Hey, I need some help with this site, obviously it has to be moved from freewebs to something that will allow PHP and mysql, I really don't know PHP and would like to learn, but not at the moment. Also any good free forums out there? Right.. What I need help with is that I've made the same layout a good 10 times and I'm getting sick of it, all i want to do is change the text on some pages, which isn't a problem, but say I need to add a link, I need to go to everyone of my pages and change it, it get's annoying. Anyway that PHP can change this? where you only have to change it on the layout, and it will change it all? |
Author: | JackTruong [ Sun May 22, 2005 8:43 pm ] | ||||
Post subject: | |||||
Read up on the include(); function for PHP. Pretty much, what include() does is that is inserts text from the file (parameter passed in include() and... that's it. An example would be:
That would be code to have the title the same.
I have bad explanation skills... --------- Free forums? As in the forum software? phpBB is probably the best free forum out there. I'd stick to my free IPB versions though. |
Author: | Blade [ Mon May 23, 2005 12:46 am ] | ||||
Post subject: | |||||
to elaborate and make it a little more dynamic... he is right, use include(); ... but what hes trying to say is what it does is include another file into your php page. you dont really need mysql for something like this. also, since you're using your layout as your main page, you're already using html and body tags, so they're a little redundant. like he said
basically what $_GET['page'] does is it gets the variable, $page, from the address bar. so to 'include' a page called news.html into your body you'd use the url http://linktoyoursite.com/index.php?page=news assuming you're template/layout page is called index.php to shorten the url, you can also use http://linktoyoursite.com/?page=news i hope this helped and you understood everything, any questions feel free to ask. |
Author: | Lazarus [ Mon May 23, 2005 6:22 pm ] |
Post subject: | |
okay thanks alot I'll add it in there some time this week. |
Author: | wtd [ Mon May 23, 2005 11:55 pm ] |
Post subject: | |
Don't use font tags. You make God cry everytime you use font tags rather than stylesheets. |
Author: | Blade [ Tue May 24, 2005 12:05 am ] |
Post subject: | |
haha yeah i dont personally use them. i was only proving how you're still able to use tags but you dont have to be redundant with <html> and <body> |
Author: | wtd [ Tue May 24, 2005 11:34 pm ] | ||
Post subject: | |||
There's a problem with your code, though:
You do no sanity checking to make sure that the page is one that should be displayed. As it stands, this could be used to display any HTML page on the server. |
Author: | JSBN [ Sun May 29, 2005 2:19 pm ] | ||||||
Post subject: | |||||||
among other things, use css for your styles. it's ALOT easier to keep control of everything, it's what i use with all my sites. If you are looking for info on css, check out the w3 site basically, with css, you have one file that has ALL of the styles you want, and withing your web page you can call individual styles. just import the css file at the top of each .html or .php file and you are set to go! THis is in the css file
This is in the web file:
and this is how you call it
PHP is an AWSOME tool for web design. I suggest learning it if you wish to make your pages dynamic and easy to use. If you wanna learn php fast, try making your own mods for phpBB; you will learn how to read the code and how to write it. |