Results 1 to 8 of 8
Thread: Need php help
-
09-04-2003, 08:36 PM #1Registered User
- Join Date
- Dec 2002
- Posts
- 2
Need php help
Does anyone know where I can get the php script for doing sub pages. Like you have the main page as main.php and the sub pages as main.php?id=page.
-
09-04-2003, 08:45 PM #2WHT Addict
- Join Date
- Aug 2003
- Location
- PA
- Posts
- 110
Those are arguements that you are referring to. To call them, use the following in the context that you have given:
[php]
<?php
$variable_passed = $_REQUEST['id'];
?>
Usually, the requested page matches a member info insertion into a database. That is the basis of a templated page, as only the information interior is changed dynamically.
Later!
Jim
-
09-04-2003, 08:51 PM #3Registered User
- Join Date
- Dec 2002
- Posts
- 2
I'm not talking about for a database.
-
09-05-2003, 12:11 AM #4Junior Guru
- Join Date
- Oct 2001
- Location
- Maryland
- Posts
- 215
Is this what you're looking for?
http://board.php-princess.net/index.php?act=ST&f=10&t=6It makes no difference which one of us you vote for. Either way, your planet is doomed... DOOMED!
-
09-05-2003, 12:52 AM #5WHT Addict
- Join Date
- Aug 2003
- Location
- PA
- Posts
- 110
Hello...
Databases aside, the method for getting the variable is just about the same as I had stated. I was simply eluding to the fact of what I believed you to be asking.
Indeed, the header(Location:$page); would be what I assume you are looking for as stated by the previous poster.
-
09-05-2003, 01:12 AM #6Newbie
- Join Date
- Aug 2003
- Posts
- 25
Code:<? if(isset($_REQUEST['id'])) { @ $include_id = include("$id"."php"); if (!$include_id) { echo('Sorry, invalid page requested.'); } } else { @include('main.php'); } ?>
-WillLast edited by WStevens; 09-05-2003 at 01:20 AM.
-
09-05-2003, 05:11 AM #7Web Hosting Master
- Join Date
- May 2002
- Location
- UK
- Posts
- 2,997
Aghh.
Please include some filtering of the ID or you are opening up a huge security hole by allowing includes from the query string.
However this line
@ $include_id = include("$id"."php");
would be better written as
@ $include_id = include($id . ".php");
-
09-05-2003, 09:08 AM #8WHT Addict
- Join Date
- Aug 2003
- Location
- PA
- Posts
- 110
Hello...
I didn't even notice he meant an included file.
As for the include problem, the easiest thing for someone to do is to pass a URL in that string
I need new glasses....seems these ones are not letting me read anything correctly
Later