I have URL in this from: locahhost/index1.php?option=com_lsh&view=lsh&event_id=xxxxx&tv_id=xxx&tid=xxxx&channel=x
when the user click this link, the file index1.php
should process this the URL then produce
new URL in this form localhost/static/popups/xxxxxxxxxxx.html wher xxxxxxxxxxxxx is the
event_id, tv_id, tid and chanel.
to do this I am using parse url function in the file index1.php
as following :
<?php
$url = 'http://localhost/index1.php?option=com_lsh&view=lsh&event_id=&tv_id=&tid=&channel=';
$parsed = parse_url( $url );
parse_str( $parsed['query'], $data );
$newurl = 'http://localhost.eu/static/popups/'.$data['event_id'].$data['tv_id'].$data['tid'].$data['channel'].'.html';
header("Location: $newurl");
?>
but its not working i think this is due to something wrong in $url = 'http://localhost/index1.php?option=com_lsh&view=lsh&event_id=&tv_id=&tid=&channel=';
what is wrong with this? also i want it when for example tv_id not present in the url it put instead 0 in the newurl