1

if i write this:

echo '<meta http-equiv="refresh" content="0;URL=https://en.wikipedia.org/wiki/.$_GET['w']"/>';

error message: Parse error: syntax error, unexpected 'w' (T_STRING), expecting ',' or ';' in /storage/ssd3/084/1533084/public_html/wikiscript2.php on line 12

if i change 'w' to "w"

i get to wiki page but the title is like this.and ofcourse its a file not available there.

https://en.wikipedia.org/wiki/.$_GET[

what i am doing wrong here.Please help me.

i am trying to send echo meta refresh to the file like this.......echo '<meta http-equiv="refresh" content="0;URL=https://en.wikipedia.org/wiki/.$_GET['w']" />'; it doesnt work this way.

Bilal Ahmed
  • 4,005
  • 3
  • 22
  • 42
Erik
  • 21
  • 4

1 Answers1

0

You need to take your variable outside of the single quotes, like this:

 '<meta http-equiv="refresh" content="0;URL=https://en.wikipedia.org/wiki/'.$_GET['w'].'"/>';
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39