1

Let's say I have the following URL: pic.php?t=1&p=23
When I try phpThumb.php?src=/pic.php?t=1&p=23, I get Forbidden parameter: p.
Anyone knows if there's a way around it?

Lior
  • 5,454
  • 8
  • 30
  • 38

3 Answers3

2

You need to URLEncode that ampersand if you are trying to pass p=23 to pic.php. Try replacing the & with %26.

What you are effectively doing there is passing p=23 as a parameter to phpThumb.php, which obviously it doesn't like...

What you probably want to do is 'phpThumb.php?src='.urlencode('/pic.php?t=1&p=23');

Read this and this.

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
0

urlencode() the URL before passing it to phpThumb.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

You can URL encode the ampersand to make it part of the content of the parameter in the querystring. This way, the whole /pic.php?t=1&p=23 gets passed as the src.

phpThumb.php?src=/pic.php?t=1%26p=23

The %26 is the encoded version of the &.

Use urlencode().

Pindatjuh
  • 10,550
  • 1
  • 41
  • 68