Log in

View Full Version : PHP scripting help (URGENT)



benslayton
02-03-2007, 12:41 AM
<?php
if ($_GET['file'])
{
highlight_file($_SERVER['SCRIPT_FILENAME']);
exit();
}
?>

How do i make it where i input the filename into the source instead of the page i am on?

Edit>
when i go to server.com/source.php?file=filename.php
This is how I want it not like when i go to server.com/source.php?file=1 and it shows the current page.

benslayton
02-03-2007, 01:15 AM
guys I really need help. This is really important.

Twey
02-03-2007, 01:40 AM
Um... highlight_file($_GET['file'])? I'm not entirely sure what you're asking.

NXArmada
02-05-2007, 06:47 PM
The PHP.net website has a great tool hidden at the bottom of there site that allows you to see the PHP source. Like this for examples shows the Source of there homepage index.php

http://www.php.net/source.php?url=/index.php

The following page shows you the source code for source.php mentioned in the url scheme of the above address.

http://www.php.net/source.php?url=/source.php

Perhaps theres something there that can help you understand what you are trying to do.

blm126
02-05-2007, 07:54 PM
Well...I think this is a really bad idea, but here you go


<?php
if ($_GET['file'])
{
highlight_file($_GET['file']);
exit();
}
?>

I take no responsibility if you use this code. It is very,very dangerous.