hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : Need php help
Reply

Forum Jump

Need php help

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-04-2003, 08:36 PM
Hosting Ave Hosting Ave is offline
Registered 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.



Sponsored Links
  #2  
Old 09-04-2003, 08:45 PM
w3needs w3needs is offline
WHT 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

  #3  
Old 09-04-2003, 08:51 PM
Hosting Ave Hosting Ave is offline
Registered User
 
Join Date: Dec 2002
Posts: 2
I'm not talking about for a database.

Sponsored Links
  #4  
Old 09-05-2003, 12:11 AM
Lain Lain is offline
Junior Guru
 
Join Date: Oct 2001
Location: Maryland
Posts: 215

__________________
It makes no difference which one of us you vote for. Either way, your planet is doomed... DOOMED!

  #5  
Old 09-05-2003, 12:52 AM
w3needs w3needs is offline
WHT 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.

  #6  
Old 09-05-2003, 01:12 AM
WStevens WStevens is offline
Newbie
 
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');
}
?>
I believe this should do the trick. Put this into your template, where main.php is the index's content, and then all other pages are saved as page.php.

-Will


Last edited by WStevens; 09-05-2003 at 01:20 AM.
  #7  
Old 09-05-2003, 05:11 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
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");

  #8  
Old 09-05-2003, 09:08 AM
w3needs w3needs is offline
WHT 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

Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?