http://www.shiver7.com/tutorials/97/
A Http://domain.com/index.php?page=blabla
Started by
Once
, May 05 2005 02:59 AM
25 replies to this topic
#21
Posted 09 May 2005 - 04:22 PM
#22
Posted 09 May 2005 - 05:28 PM
There are many was to do it, but I highly recomment the one by dark.
#23
Posted 10 May 2005 - 12:04 AM
o.k I did the one by dark......but IT DIDN'T WORK!!!!!
mabey its something wrong with dreamweaver........my host suports php......so can someone make me up a page (just the index with the script on it......and a test layout)
if so it will help greatly......only if it works
mabey its something wrong with dreamweaver........my host suports php......so can someone make me up a page (just the index with the script on it......and a test layout)
if so it will help greatly......only if it works
#24
Posted 10 May 2005 - 12:52 AM
FORGET IT.......I FIXED IT! Yeah!!!!
here is the one I used:
<HTML>
<head>
<title>Tutorials</title>
</head>
<body>
<?php
// Include the navigation:
Include("nav.php");
// Include the content:
$page = $HTTP_GET_VARS["page"];
Include("content/".$page.".html");
?>
</body>
</HTML>
here is the one I used:
<HTML>
<head>
<title>Tutorials</title>
</head>
<body>
<?php
// Include the navigation:
Include("nav.php");
// Include the content:
$page = $HTTP_GET_VARS["page"];
Include("content/".$page.".html");
?>
</body>
</HTML>
#25
Posted 22 May 2005 - 03:23 AM
$id =""; // default if (isset($_GET['page'])) $id = $_GET['page']; if (($id == "") or ($id =="main")) { echo"blahblah1"; } if (($id == "a")) { echo"BlaHBlah2"; }
thats wut i use... and works fine.
even creating functions work great with this
include("functions.php"); $id =""; // default if (isset($_GET['page'])) $id = $_GET['page']; if (($id == "") or ($id =="main")) { func1(); } if (($id == "a")) { func2(); }
to create a function in the php page such as functions.php just go
function func1() { echo"blah"; } function func2() { echo"blahblah"; }
now if you want sumtin like
index.php?page=downloads&type=bots
main page:
include("functions.php"); $id =""; // default if (isset($_GET['page'])) $id = $_GET['page']; if (($id == "") or ($id =="main")) { func1(); } if (($id == "a")) { func2(); if (($id == "downloads")) { downloads(); }
functions page:
$dl =""; // default $result = @mysql_query("SELECT * FROM downloads WHERE type=$dl"); $row = array($result); extract($row); if (isset($_GET['type'])) $dl = $_GET['type']; if (($dl == "")) { header("Refresh:0 URL=index.php"); } if (($dl == "replays")) { dispreplays(); } if (($dl == "all")) { dispreplays(); echo("<BR>"); dispbot(); echo("<BR>"); dispmap(); echo("<BR>"); dispss(); echo("<BR>"); dispmisc(); } if (($dl == "bot")) { dispbot(); } if (($dl == "screenshots")) { dispss(); } if (($dl == "misc")) { dispmisc(); } }
this would be useful in a database driven site hence all the
$result = @mysql_query("SELECT * FROM downloads WHERE type=$dl"); $row = array($result); extract($row);
if you wanted to do index.php?page=profile&user=user
go
$result = @mysql_query("SELECT * FROM members WHERE username = \"$user\""); $row = mysql_fetch_array($result); extract($row);
so if index.php?page=profile&user=Admin
it would give out all the details that you specify that you want to be shown.
there are so many ways that only the scripter can decide
#26
Posted 23 May 2005 - 10:54 AM
So what exactly do you want? A members area, Login? I couldn't really understand from your posts...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users