Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]
Send this topic | Print
Topic: HELP!!!  (Read 3006 times)
« on: September 19, 2005, 06:12:16 PM »
neowizard Offline
Newbie

View Profile
*
Posts: 3



how do i make my index.php have like links  that go to some thing like index.php?go=watever and that it goes to a page? do i use php include? or please give me some examples
Report to moderator   Logged

 
« Reply #1 on: September 20, 2005, 08:42:48 PM »
CravenBW
Guest

Yes that would require you to use PHP includes. You can visit http://us2.php.net/include/ for more info.
Report to moderator   Logged
« Reply #2 on: September 21, 2005, 01:27:49 PM »
EliteDuelist Offline
Newbie

View Profile
*
Posts: 23



Use something like this:

Code:
<?php

if (!$page)

include (
"filenametodefault.php");

else if (
$page == home2)

include (
"home2.php");

?>


Keep adding else if statements in there for each different page and set your links like this :
Code:
<a href="?page=Pagenamehere">Name of page</a>
Report to moderator   Logged
« Reply #3 on: September 21, 2005, 05:33:15 PM »
neowizard Offline
Newbie

View Profile
*
Posts: 3



ok I put that in the page but it's not working
Report to moderator   Logged
« Reply #4 on: October 04, 2005, 10:46:04 PM »
dragoneye_xp Offline
Newbie

View Profile WWW
*
Posts: 26



Perhaps this will help.  I spent a little bit of time working on it, but I tried it out and it works.  You will just have to modify parts of it to your liking.  I tried to comment a little bit to help you out.

Code:
<?php

//Dragoneye_XP's Auto-Redirection Script (v1.0).
//This script should usually go at the beginning of the page.

if(!empty($_GET['go'])){

$thelink $_GET['go'];
if(file_exists($thelink)){
include $thelink//Example:  If /pages/mypage.htm exists, then get and display it.
}else{
if(preg_match("/[\w]:\/\//",substr($thelink,0,8))==true){ //If we find a URL in the link (http://www.gooogle.com, etc)...

//Print the page to redirect you to the link.
//WARNING:  DO NOT CHANGE THE LINE BELOW!
print <<<Redirect_To_Page

<!-- Redirect Page HTML -->
<html><head><META HTTP-EQUIV=Refresh CONTENT="5; URL=$thelink">

<title>Redirecting...</title>

</head><body><div align="center"><table border="1" style="border-collapse: collapse"><tr><td style="color: #000000; border: 3px outset #CCCCCC; background-color: #CCCCCC"><p align="center">

<b>You will be redirected to &quot;<font color="#800000">$thelink</font>&quot; <br>
in about five seconds.<br>
<font size="2">(if nothing happens, <a href="$thelink">click here</a>.)</font></b>

</td></tr><tr><td style="color: #000000; border: 1px outset #999999; background-color: #999999"><p align="center">

<a href="javascript:history.back()">&lt;&lt; Cancel</a>

</td></tr></table></div></body></html>
<!-- END Redirect Page HTML -->

Redirect_To_Page;
exit;
//WARNING:  DO NOT CHANGE THE TWO LINES ABOVE THIS!

}else{
print <<<Page_Not_Found

<!-- Page Not Found HTML -->
<html><head><title>Error: Page Not Found</title></head><body><div align="center"><table border="1" id="table1" style="border-collapse: collapse"><tr><td style="color: #000000; border: 3px outset #CCCCCC; background-color: #CCCCCC"><p align="center">

    <b>Sorry, I could not find any page named "<font color="#900000">$thelink</font>".</b>

</td></tr><tr><td style="color: #000000; border: 1px outset #999999; background-color: #999999"><p align="center">

    <a href="javascript:history.back()">&lt;&lt; Go Back</a>

</td></tr></table></div></body></html>
<!-- END Page Not Found HTML -->

Page_Not_Found;
exit;
//WARNING:  DO NOT CHANGE THE TWO LINES ABOVE THIS!
}
}
}

?>
Report to moderator   Logged
 
Pages: [1]
Send this topic | Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC