View Full Version : PHP help -- new layout
Danoz
06-20-2004, 07:11 PM
Hey everybody, I really need help with my new layout.here is the url (http://www.glasko.com/newlayout/)-- you can go ahead and comment on the visuals, but at think point I'm more concerned with the basic coding I need to achieve the final goal. What I'm trying to do is to be able to simply switch the include when I change links. Obviously I've already got this working (minus the <>);
?php include("mainpage.htm"); ?
But how would I get that to change with a simple "$id=page" for a link? I'm assuming it would be an "elseif" command (forgive the limited knowledge. I have a vague understanding of IF and ELSE commands from basic game design.) I've been running through many tutorials, but I can't seem to find the code to make this happen.
Thanks for your help!
<P ID="signature">http://www.spazticplastic.com/bannerbaby.gif (http://www.spazticplastic.com)</P>
juggaleaux
06-20-2004, 07:40 PM
all your links should point like this: a href=nameoftemplate.php?section=poetry
Your dollar signs will go in the code:
if ($section == "poetry") { include("poetry.htm"); };
I'm a little rusty on php, but it's something like that. Basically, you'll only have one template file with the design, and a bunch of basic files that will have the content of each section. In the code where the content section is to be loaded is where you'll throw those if's.
<P ID="signature"><div align=right><a href=http://www.elazulspad.net/j>.</a></div></P>
CEpeep
06-20-2004, 07:41 PM
You could always use iframes, which unless your target audience uses Netscape 4, are a good choice. Then you can simply specify the name of your iframe in the anchor tag.
<P ID="signature"><hr>
"Every gun that is made every warship launched every rocket fired signifies in the final sense a theft from those who hunger and are not fed those who are cold and are not clothed"
Eisenhower</P>
Danoz
06-20-2004, 08:18 PM
Hrm... but where wouldI place that code? After the first include?
<P ID="signature">http://www.spazticplastic.com/bannerbaby.gif (http://www.spazticplastic.com)</P>
CEpeep
06-20-2004, 08:26 PM
> Hrm... but where wouldI place that code? After the first
> include?
>
You want to do that before any of your includes. Be sure to use ?php tags.
<P ID="signature"><hr>
"Every gun that is made every warship launched every rocket fired signifies in the final sense a theft from those who hunger and are not fed those who are cold and are not clothed"
Eisenhower</P>
Ugly Joe
06-20-2004, 11:16 PM
> all your links should point like this: a
> href=nameoftemplate.php?section=poetry
>
> Your dollar signs will go in the code:
>
> if ($section == "poetry") { include("poetry.htm"); };
If that doesn't work, try $_GET['section'] instead of $section. If I recall correctly, some PHP configurations turn off that feature since it can be a potential security risk.
<P ID="signature"></P>
TheRobbit
06-22-2004, 02:10 PM
?php
if (!empty( $_GET['page'] ))
$page = $_GET['page'] ;
else
$page = '';
switch( $page )
{
default:
include 'main.htm';
break;
// begin main menu
case 'portfolio':
include 'portfolio.htm';
break;
(just repeat those three lines)
}
?
This is what I use for my pages
<P ID="signature">your wish,
my fear,
both granted</P>
SwampGas
06-22-2004, 05:45 PM
register_globals was turned off long ago. That won't work...and if it does, you're exploitable.
Learning from w3 won't teach you anything, son.
<P ID="signature"><marquee direction=right scrollamount=10>http://www.zophar.net/personal/swampgas/hsrun.gif</marquee></P>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.