[Solved] undefined index: postevent….solved it but that created other problems [closed]


Situation before:

$citylink_view = "view=$targetview&postevent=$_GET[postevent]";

which is the same as:

$citylink_view = "view=$targetview&postevent=" . $_GET['postevent'];

Which can be written as:

$foo = $_GET['postevent'];
$citylink_view = "view=$targetview&postevent=" $foo;

You wrote:

$posteventview = $_GET['postevent'];
$citylink_view = "view=$targetview&".$posteventview;

Can you spot the difference?

Aside, you are possible vulnerable to XSS. Sanitize the input and urlencode. Use filter_* functions, e.g.:

$posteventview = filter_input(INPUT_GET, "postevent");
$citylink_view = "view=$targetview&postevent=" . urlencode($posteventview);

0

solved undefined index: postevent….solved it but that created other problems [closed]