3

I have index.php?stol=XY. Now I want to open gotovo.php with same 'stol' like in index.php. This is my code:

<a href="<?php "gotovo.php?stol=".$_GET['stol'] ?>">Link1</a>

What am I doing wrong?

Karlo Sintic
  • 127
  • 7
  • 2
    You're missing echo/print – Clive Feb 16 '14 at 12:40
  • You're missing an echo but there are a couple of other points to consider too. 1. You should use [`urlencode`][1] to prevent [XSS][2] attacks. 2. You will generate an E_NOTICE if $_GET['stol'] is not defined Try this: Link1 [1]: http://php.net/urlencode [2]: https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29 – Andrew Mackrodt Feb 16 '14 at 12:48
  • Thanks. I know that, but I don't need [urlencode] because $_GET['stol'] will always be defined. – Karlo Sintic Feb 16 '14 at 12:53

1 Answers1

1

try this

<a href="<?= "gotovo.php?stol=".$_GET['stol'] ?>">Link1</a>
ponciste
  • 2,231
  • 14
  • 16