0

Based on my coding when I click the "view" it will show a new page and display some data related to that user ID. After encoding the URL how would I be able to get the ID from this?

<a href="view_user.php?id=<?php echo base64_encode($row['user_id']); ?>"> View </a>
4

1 回答 1

0

Are you sure you want to base64 encode the URL and not urlencode it?

The other way (if you legitimately need to use it - I can't think of a reason why you'd want to though) is that base64_encode has a reverse function, base64_decode, which you could use on the page load to decode the id in the URL.

For numeric ID's from a database table though, you don't need to urlencode it, that function is mainly for dealing with strings, it encodes all non alpha numeric characters.

If you give some more background, we could probably help some more if we're off the mark with suggestions.

于 2013-08-11T11:16:19.137 回答