RE: [PHP] Defining PHP varibles from URL

2002-05-06 Thread Insomniac Admin
A simple example might be (unoptimised for clarity): http://www.myserver.com/someurl/page.php?file=home v4.1.x $file = $_GET("file"); // Remove case sensitivity $file = strtolower($file); // To stop people including just ANY old file, we are going to use a switch // to validate the

RE: [PHP] Defining PHP varibles from URL

2002-05-06 Thread David Freeman
-Original Message- I don't mean to be a pain but could someone send me a working example? -Original Message- This was replied to already by me and others. Didn't you read the replies? In any event, here's what I wrote last time... -Original Message- $file = ""; //the

Re: [PHP] Defining PHP varibles from URL

2002-05-06 Thread Jason Wong
On Monday 06 May 2002 17:28, [EMAIL PROTECTED] wrote: > I don't mean to be a pain but could someone send me a working example? > > I am what you would probably call a 'newbie' > > For those who don't know here is my previous message Didn't you read the numerous replies to your first posting? --

Re: [PHP] Defining PHP varibles from URL

2002-05-06 Thread 1LT John W. Holmes
I would advise against doing that unless you really know what your doing. Doing it that way will allow anyone to type in any file on your server that PHP has access to and load it, or possibly load a file off of another server. That said, if you have a url like page.php?file=foo.inc Then that

Re: [PHP] Defining PHP varibles from URL

2002-05-06 Thread Pedro Pontes
The way you're doing it now, you're first ERASING whatever value passed from the URL, with $file=""; and then trying to use it... If this ' $file="" ' is some declaration attempt, just drop it, you don't need to declare variables in PHP. Just check if $file has a value and then use it. For ex

Re: [PHP] Defining PHP varibles from URL

2002-05-05 Thread Miguel Cruz
On Sun, 5 May 2002, Teemu Pentinsaari wrote: >>> It could be what I was typing in the url bar. >>> >>> file.php?file=foobar.inc >> >> 1) Try include $_GET['file']; >> >> 2) Let me know where your server is so I can go to >> >>http://your.server/file.php?file=/etc/passwd > > You might want to

RE: [PHP] Defining PHP varibles from URL

2002-05-05 Thread John Holmes
> > file.php?file=inc.foobar.php > - > include("include/$file"); > That doesn't fix anything... file.php?file=../../../etc/passwd Just a matter of a few tries to see how many directories you have to go up... ---John Holmes... -- PHP General Mailing List (http:

Re: [PHP] Defining PHP varibles from URL

2002-05-05 Thread Teemu Pentinsaari
> > It could be what I was typing in the url bar. > > > > file.php?file=foobar.inc > > 1) Try include $_GET['file']; > > 2) Let me know where your server is so I can go to > >http://your.server/file.php?file=/etc/passwd > > miguel You might want to use .php file extension and /include/ direct

RE: [PHP] Defining PHP varibles from URL

2002-05-05 Thread David Freeman
-Original Message- $file = ""; //the above is defined from the url include "$file"; It could be what I was typing in the url bar. file.php?file=foobar.inc -Original Message- Hmm, so you define $file in your url as "foobar.inc" and then, in the page itself you take change $file

Re: [PHP] Defining PHP varibles from URL

2002-05-04 Thread Miguel Cruz
On Sun, 5 May 2002 [EMAIL PROTECTED] wrote: > I can't seem to define a varible from the url entered into a browser. > > I wish to use the following code or something like it. > > > $file = ""; > //the above is defined from the url > include "$file"; > > > It could be what I was typing in the