retrieve variable from URL – $_GET
-
Hi,
complete newbee here ??
I need to get a variable from the url – Read all the posts here but was unable to get anything to work.
I am trying to set up a simple re-direct based on user capabilities. It’s all working with the exception of the variable I need out of the url called “entry”. IE entry=908 in this case.
Here is the url: https://my-url/projects-edit/?frm_action=edit&entry=908
Here is my code on the page:
<?php if ( current_user_can(‘read_post’, 122) ) { ?>
<div>/projects-edit/?nentry=<?php ($_GET[‘entry’] ?>)” target=”_self”>Back to Project</div> <?php ; }
else
{ ?> <div>/my-page/” target=”_self”>Back to My Page</div> <?php ;} ?>Any suggestions, keeping it simple, would be greatly appreciated
Thanks!
G
- The topic ‘retrieve variable from URL – $_GET’ is closed to new replies.