| Author | Post |
|---|
qurb Member
| Joined: | Wed Jun 21st, 2006 |
| Location: | |
| Posts: | 1 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 22nd, 2006 12:07 am |
|
i need some help to find out hoe i can get my nav bar to work.....
ok i have a homepage.... in php
and i have a nav bar in that and one of the links is http://example.com/homepage.php?page=community
and now i dont know how to get that to open my page
http://example.com/community.php
how do i do that?
|
joshimitsu Member

| Joined: | Wed Jun 8th, 2005 |
| Location: | England |
| Posts: | 305 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Jun 22nd, 2006 05:19 pm |
|
<?php
$site = $_GET['page'];
switch($site) {
case 'community':
include "community.php";
break;
default
?>
|
pixle_dude Member

| Joined: | Wed Jun 14th, 2006 |
| Location: | Sydeny, Australia |
| Posts: | 152 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri Sep 22nd, 2006 01:14 pm |
|
joshimitsu wrote: <?php
$site = $_GET['page'];
switch($site) {
case 'community':
include "community.php";
break;
default
?>
Hi i had a little error when i ran the script...
Parse error: syntax error, unexpected $end in /home/m/mecoke/www/test/page/index.php on line 22
Explain?
Oh dose this have to be in the header of the PHP document
|
kyle Member
| Joined: | Thu Jul 20th, 2006 |
| Location: | Canada |
| Posts: | 4 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri Sep 29th, 2006 01:06 pm |
|
Well.. thats really .. confusing. Heres a REALLY simple one.
<?
// This is a little bit of PHP
$p = $_GET['page'];
if ($p) {
include($p.".php");
}else{
include("news.php"); //Pur Page You Want To Show Up If There Is No $p
}
?> |
Thanks to my friend, he made this code. Amazing job Logan!
Poseted by me but all credit goes to Logan.
|
azoundria Member
| Joined: | Thu Sep 28th, 2006 |
| Location: | |
| Posts: | 20 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri Sep 29th, 2006 07:05 pm |
|
Sinc you might want to use a form to submit variables to the page, it's best to use $_REQUEST to get from both GET and POST.
$p = $_REQUEST['page'];
|
kyle Member
| Joined: | Thu Jul 20th, 2006 |
| Location: | Canada |
| Posts: | 4 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri Sep 29th, 2006 07:08 pm |
|
It works.. im not compaining 
|
pixle_dude Member

| Joined: | Wed Jun 14th, 2006 |
| Location: | Sydeny, Australia |
| Posts: | 152 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Sat Sep 30th, 2006 06:18 am |
|
kyle wrote: Well.. thats really .. confusing. Heres a REALLY simple one.
<?
// This is a little bit of PHP
$p = $_GET['page'];
if ($p) {
include($p.".php");
}else{
include("news.php"); //Pur Page You Want To Show Up If There Is No $p
}
?> |
Thanks to my friend, he made this code. Amazing job Logan!
Poseted by me but all credit goes to Logan.
I don't get this one is where it says : include($p.".php");
".php" is ment to be your page right?
|
GemX Member
| Joined: | Fri May 25th, 2007 |
| Location: | |
| Posts: | 9 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Fri May 25th, 2007 09:11 pm |
|
Two types
1.
<?php
$getMe = $_GET['page'];
if(isset($getMe))
{
if($getMe == 'comunity')
{
include('comunity.php');
}
}
else
{
die('Value for page is blank man! :)');
}
?> |
2. example if url query is = 2 ?page=community, script will load comunity.php file
if ?page=somefile, script will load somefile.php if exists if not it will die and tell you that this file cannot be included bcoz it doesnt exist. to disable error reporting check commented line at start of php code
<?php
// error_reporting(0);
$page = $_GET['page'];
if($page)
{
include($page.'.php'));
}
else
{
die('Value for page is blank man! :)');
}
?> |
Or you can use switch like entered above.
|
jkewlo Member
|
Posted: Sun Nov 11th, 2007 11:10 pm |
|
hey this is what im trying to do
<a href="<? echo "$self?page=addnews" ?>">ADD NEWS</a><br />
<a href="<? echo "$self?page=modify" ?>">MODIFY NEWS</a><br />
<a href="<? echo "$self?page=delete" ?>">DELETE NEWS</a><br />
<a href="<? echo "$self?page=editban" ?>">EDIT/BAN USERS</a> |
are my links as u can see i have set page to page= and there names
now the code that u gave him below.
how do i get it to work
do i make a file with
addnews
modify
delete
editban
?????????
what do i do please someone help me!
|
TomWhitney Member

| Joined: | Fri Dec 30th, 2005 |
| Location: | Phoenix, Arizona USA |
| Posts: | 99 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Tue Nov 13th, 2007 08:29 pm |
|
If you are using this line
Then you need to create these files
addnews.php
modify.php
delete.php
editban.php
The contents of the included file will be treated as if you concatenated it to the file with the include statement. Any PHP in the included file will be run.
Phoenix Arizona Computer Consultants
|
jkewlo Member
|
Posted: Wed Nov 14th, 2007 02:11 am |
|
ahhh ok. so the includes dont need the <html> <body> etc... cuz it will cause it to multiply the page a thousand times as i see so it will need just the content of the page and nothing more?
and the main page would be admin.php and then it would call
admin.php?page=addnews etc... ok i gotcha thanks!
|
resource004 Member
| Joined: | Fri Apr 4th, 2008 |
| Location: | |
| Posts: | 65 |
| Status: |
Offline
|
| Mana: |     |
|
Posted: Thu Apr 24th, 2008 07:56 am |
|
Hi Friends,
Do you have any problem in web designing and development or do you want any kind of help in PHP/MYSQL or you need reliable and cheap web hosting or have any problem in E-commerce solutions then go to this site http://www.pakandu.com/contactus.php ,
It is a company of web designing and development and it have a great web designers, developers and Programmers.
When I got in any problem of web designing /development and Programming or I need reliable web hosting or facing any problem in E-commerce Solutions then I just go to this site and ask them the solution of my problem and they always provide me best solution for my problem.
So do you have any above problems then contact them without any hesitation.
Regards,
Resource
|
 Current time is 07:52 pm | |
|