jbrill Posted July 4, 2007 Share Posted July 4, 2007 I have the url http://www.mydomain.com/admin/admin_modjob.php?idr=3&table=jobs I would like a link on the page that goes to http://www.mydomain.com/admin/printquote.php?idr=3&table=jobs how do i go about doing that? is it a $_GET funtion? Quote Link to comment https://forums.phpfreaks.com/topic/58474-how-do-i-get-a-variable-form-the-url-and-use-it-in-a-link-noob-question/ Share on other sites More sharing options...
john010117 Posted July 4, 2007 Share Posted July 4, 2007 Yes, it's a $_GET[''] function. <?php $idr = $_GET['idr']; $table = $_GET['table']; echo '<a href="printquote.php?idr=' . $idr . '&table=' . $table . ">link</a>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/58474-how-do-i-get-a-variable-form-the-url-and-use-it-in-a-link-noob-question/#findComment-289968 Share on other sites More sharing options...
jbrill Posted July 4, 2007 Author Share Posted July 4, 2007 that didnt seem to work.... got this error: Parse error: syntax error, unexpected T_VARIABLE in /home/morow/public_html/admin/admin_modjob.php on line 110 Quote Link to comment https://forums.phpfreaks.com/topic/58474-how-do-i-get-a-variable-form-the-url-and-use-it-in-a-link-noob-question/#findComment-289970 Share on other sites More sharing options...
john010117 Posted July 4, 2007 Share Posted July 4, 2007 <?php $idr = $_GET['idr']; $table = $_GET['table']; echo '<a href="printquote.php?idr=' . $idr . '&table=' . $table . '">link</a>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/58474-how-do-i-get-a-variable-form-the-url-and-use-it-in-a-link-noob-question/#findComment-289971 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.