Jump to content

[SOLVED] Id browsing PHP script help needed


stealthx

Recommended Posts

Hi. I've encountered a problem while i was trying the id browsing script. Meaning index.php?p=1 and index.php?p=2, etc.

 

I would like on p=2 a new page to appear. Ex. 2.php to appear on p=2, but what i get is 2.php stacking ABOVE my index.php

 

My script is below, took it from another site (Pages.php)

<?php
$page=$_GET['p'];
switch($page){
case 'sroinfo':
echo include('serverinfo.php');
break;
case 'downloads':
echo include('downloads.php');
break;
case 'register':
echo include('register.php');
break;
case 'srostaff':
echo include('staff.php');
break;
case 'donate':
echo include('donate.php');
break;
case 'forums':
echo include('forum.php');
break;
case 'others':
echo include('others.php');
default:
echo include("index.php")';
break;
}
?>

 

I did a <?php include("pages.php"); ?>    on my index.php

 

My index.php code is below

 

<HEAD>
<TITLE>SeraphRO.com • Where Fun Never Ends!</TITLE>
<META content="New Server! All new classes, maps, skills, monsters, dungeons,quests. Custom wings, headgears, weapons, quests and many more! Powered by lagless dedicated server." name=description>
<META content="seraph, seraphro, anime, sro, private server, custom wings, homunculus, quest, ro database, game server, ragnarok online, top list, game, game toplist, game news, game sites, gaming sites, links, 100, 200" name=keywords>
<META content=index,follow name=robots>
<link rel="shortcut icon" href="favicon.ico" >
<LINK href="style.css" type=text/css rel=stylesheet>
<script language="javascript" src="mo1.js"></script>
<script language="javascript" src="mo2.js"></script>
<script language="javascript" src="nrc.js"></script>
<?php include("bans.php"); ?>
<?php include("server_status.php"); ?>    
<?php include("pages.php"); ?>     
</HEAD>







<table align="center" width="800" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <TD>
<table id="Table_01" width="800" height="243" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="2" rowspan="2">
		<img src="img/header_01.gif" width="217" height="156" alt=""></td>
	<td rowspan="2">
		<img src="img/header_02.gif" width="135" height="156" alt=""></td>
	<td colspan="2">
		<img src="img/header_03.gif" width="448" height="136" alt=""></td>
</tr>
<tr>
	<td>
		<img src="img/header_04.gif" width="172" height="20" alt=""></td>
	<td rowspan="3">
		<img src="img/header_05.gif" width="276" height="106" alt=""></td>
</tr>
<tr>
	<td rowspan="2">
		<img src="img/header_06.gif" width="204" height="86" alt=""></td>
	<td colspan="3">
		<img src="img/header_07.gif" width="320" height="30" alt=""></td>
</tr>
<tr>
	<td colspan="3">
		<img src="img/header_08.gif" width="320" height="56" alt=""></td>
</tr>
<tr>
	<td>
		<img src="img/spacer.gif" width="204" height="1" alt=""></td>
	<td>
		<img src="img/spacer.gif" width="13" height="1" alt=""></td>
	<td>
		<img src="img/spacer.gif" width="135" height="1" alt=""></td>
	<td>
		<img src="img/spacer.gif" width="172" height="1" alt=""></td>
	<td>
		<img src="img/spacer.gif" width="276" height="1" alt=""></td>
</tr>
</table>
</TD></TR>
</TABLE>
<TABLE height=27 cellSpacing=0 cellPadding=0 width=800 align=center border=0>
  <TBODY>
  <TR>
    <TD width=800 height=27><img height=27 src="img/bar_left.gif" width=3><a href="?p=idx" onMouseOver="on('home')" onMouseOut="off()"><img name="home" height=27 src="img/nav/home.gif" width=73 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=sroinfo" onMouseOver="on('serverinfo')" onMouseOut="off()"><img name="serverinfo" height=27 src="img/nav/server_info.gif" width=113 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=downloads" onMouseOver="on('downloads')" onMouseOut="off()"><img name="downloads" height=27 src="img/nav/downloads.gif" width=111 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=register" onMouseOver="on('register')" onMouseOut="off()"><img name="register" height=27 src="img/nav/register.gif" width=96 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=srostaff" onMouseOver="on('staff')" onMouseOut="off()"><img name="staff" height=27 src="img/nav/sro_staff.gif" width=135 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=donate" onMouseOver="on('donate')" onMouseOut="off()"><img name="donate" height=27 src="img/nav/donate.gif" width=86 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=forums" onMouseOver="on('forum')" onMouseOut="off()"><img name="forum" height=27 src="img/nav/forum.gif" width=86 border=0></a><img height=27 src="img/bar_middle.gif" width=2><a href="?p=others.php" onMouseOver="on('other')" onMouseOut="off()"><img name="other" height=27 src="img/nav/others.gif" width=80 border=0></a><img height=27 src="img/bar_right.gif" width=3></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 width=800 align=center border=0>
  <TBODY>
  <TR>
    <TD class=sub_menu width=800 
    background=img/bg2.gif>Welcome to SeraphRO.com - A Ragnarok Online Private Server. Feel free to browse around and we hope you enjoy your stay..</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=800 align=center border=0>
  <TBODY>
  <TR>
    <TD class=page_body width=800>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD class=text_grey vAlign=top width=590>
          
          
<? require("funcs.php"); 
$res = getlastposts($numposts);
/*

debug_array($res);

*/
?>

<?
for($i=0; $i<count($res); $i++) {
?>
<table width="600" align="center" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="16" height="16" align="left" valign="top"><img src="img/cat_top_ls.gif" width="16" height="16" alt=" " border="0" /></td>
    <td width="100%" valign="middle" class="tcat">


		<div align="top">

<a target="_blank" href="<?=getposturl($res[$i][pst_postid]) ?>"><?=$res[$i][tpc_title] ?></a>
    <br><? if ($res[$i][pst_postsub]!=$res[$i][tpc_title] && $res[$i][pst_postsub]!="") { print "<b>Subject</b>: <a href=\"" . getposturl($res[$i][pst_postid]) . "\">" . $res[$i][pst_postsub] . "</a>"; } ?>
    </div>




</td>
     <td width="16" height="16" align="right" valign="top"><img src="img/cat_top_rs.gif" width="16" height="16" alt=" " border="0" /></td>
  </tr>
</table>

<table width="600" align="center" border="0" cellpadding="0" cellspacing="0" class="divider">
  <tr> <td width="600" align="center" class="divider">
<div align="left"></div></td> </tr></table>

  <?
  if ($avatarsupport==1) {
  ?>
  <td width="600"><?=get_post_text($GLOBALS['numchar'], $res[$i][pst_posttxt], $res[$i][pst_postid]) ?></td>
  <td width="600" align="right"><img src="<?=getavatar($res[$i][usr_avatar], $res[$i][usr_avtype]) ?>" alt="<?=$res[$i][usr_username] ?>s avatar" border="0"></td>
  <?
  } else {
  ?>
  
<table width="600" align="center" border="0" cellpadding="0" cellspacing="0" class="midrow">
  <tr><td width="600" align="center" class="midrow">			
	<div align="left">

 » <?=fmt_date($res[$i][pst_posttime], datefmt) ?> by <a target="_blank" href="<?=getprofileurl($res[$i][usr_userid]) ?>"><?=$res[$i][usr_username] ?></a></div>
<br/>
<div align="left" class="midrow2">
<?=get_post_text($GLOBALS['numchar'], $res[$i][pst_posttxt], $res[$i][pst_postid]) ?></div><br/><br/></td></tr></table>


	<table width="600" height="28" align="center" border="0" cellpadding="0" cellspacing="0" class="btm">
  <tr><td width="600" height="28" align="center" class="btm">			
	<div align="left" class="btm_txt">

<a target="_blank" href="<?=gettopicurl($res[$i][pst_postid]) ?>"><?=$res[$i][tpc_replies] ?> Comments</a>

  	</div></td></tr></table><br/>

  <?
  }
  ?>




<?
}
?>
          
          
          
          
          
          </TD>
          <TD width=10></TD>
          <TD vAlign=top width=180>
            <TABLE cellSpacing=0 cellPadding=0 width=180 border=0>
              <TBODY>
              <TR>
<table width="180" height="99" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="2">
		<img src="img/stats_01.gif" width="180" height="23" alt=""></td>
</tr>
<tr>
	<td rowspan="7">
		<img src="img/left.gif" width="97" height="70" alt=""></td>
	<td>
		<img src="img/right2.gif" width="83" height="13" alt=""></td>
</tr>
<tr>
	<td>
		<?php echo $server_status; ?></td>
</tr>
<tr>
	<td>
		<img src="img/right1.gif" width="83" height="15" alt=""></td>
</tr>
<tr>
	<td>
		<?php echo $server_status; ?></td>
</tr>
<tr>
	<td>
		<img src="img/right1.gif" width="83" height="15" alt=""></td>
</tr>
<tr>
	<td>
		<?php echo $server_status; ?></td>
</tr>
<tr>
	<td>
		<img src="img/right3.gif" width="83" height="12" alt=""></td>
</tr>
<tr>
	<td colspan="2">
		<img src="img/under.gif" width="180" height="6" alt=""></td>
</tr>
</table>
                      
                      
    <!-- [ Google Ads Module START ] -->
    <table width="180" border="0" cellspacing="0" cellpadding="0">
    </table>
    <!-- [ Google Ads Module END ] -->
  </tr>
</table>
</table>
</table>







<table>
<TABLE height=30 cellSpacing=0 cellPadding=0 width=800 align=center border=0>
    <TD class=footer vAlign=top align=middle width=800 
    background=img/footer.gif 
    height=30><img height=2 
      src="img/spacer.gif"><BR>Copyright © 2007 SeraphRO.Com :: All rights reserved :: Graphics Coypyright Gravity Co Ltd. :: Design Copyright Stealth</TD></TABLE><BR                   
class=text_grey>

Link to comment
Share on other sites

You load "yoururl.com/index.php" and then determine what other page to include. So index.php gets loaded by default, and then, depending on the value of your input variables, you include another page in that page.

 

I guess what you need would be index.php have the contents of pages.php and a the contents of index.php in a included page like index_include.php.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.