PHP Template Question
- Started
- Last post
- 6 Responses
- lind
Let’s say your website is completely composed of webpage.php?page=contentXYZ
If somebody deleted
“?page=contentXYZ” from the URL, they’ll see nothing except for the header and footer.Essentially, webpage.php looks something like this:
How do you make it so that webpage.php will be the same as webpage.php?page=intro ?
Thnx in advance :)
- lind0
That's weird, I guess this forum doesn't display PHP code.
What I meant to say is that:
Essentially, webpage.php looks something like this:(Not the correct syntax but you get the idea)
- lind0
Aargh...I can't believe it. I guess this forum doesn't even display faked PHP code I just posted.
Anyhow, somebody help me, please.
- hulja0
that all depends on how the code is set up.
if someone smart set up a php template where the content would be included via a string, the would have a default value in case the string is not given.that's how i did
www.diphthong.com/asiainc
which is entirely db driven.
- lind0
Thnx for the response Hulja.
I don't know db. Since I'm not able to post any PHP codes at NT, I know I didn't really articulate my problems that well.
Anyhow I checked your link and notice that the content changes depending on the numbers used after index.php?aid=
EX:
http://www.diphthong.com/asiainc…
http://www.diphthong.com/asiainc…
http://www.diphthong.com/asiainc…But my question is how can you PHP code index.php so that when the URL is just http://www.diphthong.com/asiainc… there would be content from aid=1. Currently, I see no content when you just have http://www.diphthong.com/asiainc…
- ThisTheThat0
if(!page) { page = contentX
YZ; }
- unknown0
i dont know php. but i know how to steal a good one when i see it.
there should be a default page on the code...
if variable = nothing, then use nononno.
that's the logic. explain it in code! :)