Page 1 of 1

[SOLVED] URL Question

Posted: Tue May 17, 2005 12:51 pm
by Sphen001
Hi,

I have a question about URL's. Right now, I'm wondering if it's possible to add some stuff onto the end of a filename. An example:

I have this code, which includes a file.

Code: Select all

<?php
require ('./index.php');
?>
I was wondering if it's possible to add some data to the end of it, so that the URL that would appear would be:

Code: Select all

http://www.site.tld/index.php?blah=1
The blah=1 is what I want to add via the require function.

The goal for this is that I run a site which includes a specific page into the index. I have a blacklist approach, and I want it so that if someone goes to a URL that calls a page that doesn't exist, I want to load the main page, with the extra data on the end of the URL, so that I can run some error routines.

Thanks for any help :D

Sphen001

Posted: Tue May 17, 2005 1:03 pm
by Burrito
with require or include you can not append a url var.

what you could do however is set your url vars on your "main" page like such:

Code: Select all

$_GET['var1'] = 1;
include('blah.php');
then on blah.php you can reference your url var that you set on the "main" page.