Thundarfoot Posted February 3, 2008 Share Posted February 3, 2008 I am a noob, building a script. I would like to be able to use the url line to assign a variable. Can anyone show an example of how to make $cn get its numerical value from the url line? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/89185-solved-variable-gets-value-from-url-how/ Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 <?php if (isset($_GET['cn'])) { $cn = $_GET['cn']; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/89185-solved-variable-gets-value-from-url-how/#findComment-456659 Share on other sites More sharing options...
Thundarfoot Posted February 3, 2008 Author Share Posted February 3, 2008 forgive my ignorance, but how would I type the url to pass that value? mypage.php<variable> Quote Link to comment https://forums.phpfreaks.com/topic/89185-solved-variable-gets-value-from-url-how/#findComment-457032 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 http://site.com/page.php?cn=foo Quote Link to comment https://forums.phpfreaks.com/topic/89185-solved-variable-gets-value-from-url-how/#findComment-457034 Share on other sites More sharing options...
Thundarfoot Posted February 3, 2008 Author Share Posted February 3, 2008 many thanks Quote Link to comment https://forums.phpfreaks.com/topic/89185-solved-variable-gets-value-from-url-how/#findComment-457037 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.