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! 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']; } ?> 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> 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 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 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
Archived
This topic is now archived and is closed to further replies.