user2024172 user2024172 - 2 months ago 13
HTML Question

Get value form url php through anothe page

i am post the value to the net page via url like this.

<a class="btn btn-info" href="index.php?page=edit_fuel_record.php &trans_id = <?php echo $row['id']; ?>">
<i class="glyphicon glyphicon-edit icon-white"></i>

on the other page i am trying to retrieve the value. yes i can see it on the url, but i can't retrieve it in code. here is how i am trying to retrieve it
echo "The ID is"."".$_GET[trans_id];
Its giving me null

if i post values this way

<p align="center"><a href="ReportBySite_csv.php?date1=<?php echo $_POST['date1'];?>&date2=<?php echo $_POST['date2'];?>&siteid=<?php echo $_POST['siteid'];?>">Download CSV</a></p>

its working fine.

the difference is if i go through the index page i can't use the value posted.

Jon Jon

Remove space from the url. there is extra space after 'trans_id'