Reply
How to do: blah.php?page=blah
Old 11-03-2009, 09:14 PM How to do: blah.php?page=blah
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
How do I do it so like I have a navigation bar with links.

Like one link is like
blah.php?page=about
for the about page, and it loads

blah.php?p=about
with the about words
(It will basically get the information from like about.php)

blah.php?p=contact
with the homepage words
(It will basically get the information from like contact.php)

I dont know whats it called I think its called like dynamic php navbar.
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-03-2009, 09:29 PM Re: How to do: blah.php?page=blah
orionoreo's Avatar
Ultra Talker

Posts: 261
Name: Jerry
Trades: 0
in blah.php you need

PHP Code:

if (isset($_GET['p'])) {
switch (
$_GET['p']) {
case 
'about':
include(
'about.php');
break;
case 
'contact':
include(
'contact.php');
break;
}

orionoreo is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 09:35 PM Re: How to do: blah.php?page=blah
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
Okay, thanks, also will I be able to use this like without reloading the page?

You should note, however, that having an open include like that is EXTREMELY unsafe. Let's say you want someone to put in:


blah.php?page=about.html

And you have a file called config.php in the same directory, a person could put in:

blah.php?page=config.php

And get all the information from that page. Make sure you sanitize your inputs.
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
Old 11-04-2009, 12:27 AM Re: How to do: blah.php?page=blah
orionoreo's Avatar
Ultra Talker

Posts: 261
Name: Jerry
Trades: 0
no they can't and in this case i don't need to

the switch case has only two options, besides about and contact no other pages can be loaded...


Quote:
Originally Posted by sith717 View Post
Okay, thanks, also will I be able to use this like without reloading the page?

You should note, however, that having an open include like that is EXTREMELY unsafe. Let's say you want someone to put in:


blah.php?page=about.html

And you have a file called config.php in the same directory, a person could put in:

blah.php?page=config.php

And get all the information from that page. Make sure you sanitize your inputs.
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 11-04-2009, 03:06 PM Re: How to do: blah.php?page=blah
Skilled Talker

Posts: 61
Name: John
Trades: 0
Quote:
no they can't and in this case i don't need to

the switch case has only two options, besides about and contact no other pages can be loaded...
I concur, and if you wanted to be vindictive you could always add:

PHP Code:
default:
include(
'something_most_unpleasant.php'); 
That way those naughty ones who do try get a little in return.
Envision_frodo is offline
Reply With Quote
View Public Profile
 
Old 11-04-2009, 03:17 PM Re: How to do: blah.php?page=blah
orionoreo's Avatar
Ultra Talker

Posts: 261
Name: Jerry
Trades: 0
lol that would be fun
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 11-11-2009, 04:51 AM Re: How to do: blah.php?page=blah
Junior Talker

Posts: 4
Trades: 0
get variable with $_GET and redirect the page.
zmoerf is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to do: blah.php?page=blah
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12464 seconds with 13 queries