Jump to content

fallenone1884

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fallenone1884's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok got it, just use an [code]elseif[/code] :) works great
  2. Sorry for being unclear, Im looking to do something like this main.php?p=apage the directory of this page named /pages/ that works with this code seeing, that [color=brown]file_exists('./pages/' . $p . '.php') and $file = './pages/' . $p . '.php';[/color] are calling for the pages directory. what i want to do is do the same thing main.php?p=anotherpage the directory of anotherpage named /anotherdir/ when i try to do this, nothing comes up, because im assuming, anotherpage is not in the pages directory. I dont know, i just started all this last night, so trying to figure it out, sorry if im not relaying the information right. My question is there a way to add the second directory so that when i do main.pgp?p= it looks in both the pages directories and the anotherdir directory, not just pages.
  3. Ok i have this code, im not sure entirley how it works, but know it works for what i am doing, including different pages inside my main.php page. My question is there anyway to make it pull from two directory's instead of just /pages/ i think its making it so only one directory is available for the function for security. So in keeping with security but opening the call for more then one directory, is it possible? and how do i go about doing it. I can clarify if asked, i stumble accross my own thoughts alot.. Thanks oh heres the code [code]<p align="center">   <?php $p = $_GET['p']; if ( !empty($p) && file_exists('./pages/' . $p . '.php') && stristr( $p, '.' ) == False ) {    $file = './pages/' . $p . '.php'; } else {    $file = './pages/welcome.php'; } include $file;[/code]
  4. This is the coding i would like to use and is what i mean by the get function [code]$p = $_GET["page"];[/code] im not using cookies or sessions and as i said, it will load the php pages that reside in the same dir. as the code below, well i beleive it will load any directory as long as i type it that way [code]www.myhost.com/index.php?page=pages/hello/mine/gold[/code] like above but its not loading the images ect along with the content, as i can see the image paths are getting lost or rather being changed to the url of the path of this script so instead of myhost.com/forum/pictures its making it myhost.com/pictures and then none of the links work in the forum, because i am assuming, they are no longer relative to the current path [code]<?php require "fcbanner.php"; require "menu.php"; ?> <?php $p = $_GET["page"]; if (strpos($p,"..")) {     die("Bad page request"); } if (!$p) $p = "main2"; $content_file=$_SERVER["DOCUMENT_ROOT"]."/".$p.".php"; if (!file_exists($content_file)) {     header("Location: {$_SERVER["PHP_SELF"]}");     exit(); } // Syntax: $variable = (condition) ? value_if_true : value_if_false; $title = ($p) ? "$p - Fated Chaos" : "Main page - Fated Chaos"; include("header.php"); include($content_file); include("footer.php"); ?> <?php include("http://www.fatedchaos.com/Forum/index.php"); include("http://www.fatedchaos.com/counter/phpcounter.php"); include("webring.php"); include("copyright.php"); ?>[/code]
  5. Im trying to update my site using php, so learning as i go with simple functions and scripts, i have a question regarding a URL variable get command (think thats what its called) The majority of the code works fine with no problems, issues i am having are when i try and get from another directory, or when calling on a php script like phpbb2. right now i have my page seperated into two frames, one which i use for the link menu and banner image and the "body" frame which i direct all my links to. I would like to keep this setup, but want to get rid of the frames, most of the url variable get functions work correctly. its just when i try and get something that resides in another directory, or as i said above something like phpbb2. i tried a work around for the forum issue with phpbb2 making a forum.php file and doing an include in that file and using the url variable to call that www.myhost.com/index.php?page=forum and it will pull the page up, and place it in the body, but the style is gone, aas well as any images ect... I dont know if ive been clear or just rambled, let me know, i would like to see this work, or some idea's on how to handle this situation. Thanks
×
×
  • 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.