Not able to get input string

software development

#1

I am trying to port an existing website to Dreamhost and I have trouble to get the key php file to work.
In running this:

http://name.dreamhosters.com/chinese/index-test.php?content=worship/ch_schedule.htm

Supposedly the next line should have got the string “worship/ch_schedule.htm” into the variable $input

$input = $HTTP_GET_VARS[‘content’];

But somehow from Dreamhost site it returned with nothing, null.

What went wrong?


#2

$HTTP_GET_VARS no longer exists in current versions of PHP. It was renamed to $_GET a long time ago.

If your script is working the way I think it’s working, make sure to reject values of $input which begin with a slash or period.


#3

Thanks, it works following your instructions!