|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Newbie question
Hey, I just have a little question for you guys.
Alright I have a little Html/CSS design I made, fairly basic but the thing is if I want to make a change to the layout I don't want to have to actually go back and make the change to all 10-20 or so pages. Can I have a code that'll have the template of the pages and I can change that and from there it'll change it on the rest of the pages? oh, and on a side note I recently purchased Core PHP programming by Leon Atkinson, good buy? Any other books you'd suggest? . o 0(punctuation based on imagination) 0 o . |
|
#2
|
|||
|
|||
|
RE: Newbie question
You want to use your css sheets with the php? You can do that no problem.
|
|
#3
|
|||
|
|||
|
RE: Newbie question
I wrote a script that did that a long time ago, not sure where it is though, i'll keep and eye out though.
The script had one template file, then you just added the data you wanted into .txt files. For example headlines.txt, then using the script, index.php you call it like: index.php?id=headlines Anyway, ill try and find the script, i know its somewhere. The below code is a snippet that will do something similar and can be developed to use templates. <? $ext = ".php"; $id = "".$page."".$ext.""; if (file_exists($id)) { include($id); } else { echo "error: page doesn't exist"; } ?> this would be used like: filename.php?page=whatever that would include the page whatever.php obviously. |
|
#4
|
|||
|
|||
|
RE: Newbie question
Awesome, I found something similar, worked great...
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Newbie question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|