dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Can someone help me with a little PHP.....

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    24
    ok, here's what i need to do, it's really simple, except i don't know a lick about PHP...

    i have this page, index.phtml...

    it's my main page that will include the navigation bar..

    and everything else is access throught this page by the

    include (index.phtml?$page) where $page is the variable that tells the location of the page to include (i'm sure you know this)


    anyway, i need a simple if and else command dealie that will make the page to inluclude main.html if ever the $page variable is not supplied..
    ________
    i hope you guys understand what i'm talking about cause i really don't know how to speak PHP...

    and i hope you guys help me
    _
    and yes, i know this is a flash boards but this is the only place i know where to ask

  2. #2
    YH Jelly Llama Jockey defuzz's Avatar
    Join Date
    May 2001
    Posts
    464
    these are flash boards but we have no problem with other problems but we prefer requests like these to be kept to the scripting and backend forum.......


    ANyway.......

    Code:
    if ($page){
    //statements if $page variable exists
    
    }else{
    //statements to do if $page doesn't exist
    include("main.html");
    }
    Hope this does the trick

  3. #3
    Civilian
    Join Date
    Jan 2002
    Location
    In the clouds
    Posts
    3,210
    Moved from the CL.

  4. #4
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    You might want to read some really good threads at http://www.devshed.com when it comes to security, NEVER base your include's on a dynamic variable without checking if the $page is in a array of allowed pages that can be loaded into your site!

    EX: index.phtml?$page=/private/etc/passwd

    Guess what that does???
    phpMyAdmin v 2.1 (I think) made that mistake, made my uni's server open to "whatever" you wanted to see

    NuCleuZ

  5. #5
    YH Jelly Llama Jockey defuzz's Avatar
    Join Date
    May 2001
    Posts
    464
    oooooooo I'd never thought of that.

    Thaks for pointing that out.

  6. #6
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    The thread to read is:
    http://forums.devshed.com/showthread.php?threadid=20525

    Recomended to everyone that are conserned with server side security.

    NuCleuZ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center