harsh00008 Posted July 29, 2008 Share Posted July 29, 2008 Hey if i get "id=12" with the $_SERVER["QUERY_STRING"] command how do i assign a variable to the 12 in the result "id=12"? Link to comment https://forums.phpfreaks.com/topic/117154-solved-_serverquery_string-help/ Share on other sites More sharing options...
harsh00008 Posted July 29, 2008 Author Share Posted July 29, 2008 So that i can echo only the "12" part of the result "id=12" by $_SERVER["QUERY_STRING"] command? ??? Link to comment https://forums.phpfreaks.com/topic/117154-solved-_serverquery_string-help/#findComment-602562 Share on other sites More sharing options...
jonsjava Posted July 29, 2008 Share Posted July 29, 2008 are you talking about something like index.php?id=12 ? If so, the answer would be: <?php $id = $_GET['id']; ?> don't forget to sanitize the user input (the GET) before you add it to any query. Link to comment https://forums.phpfreaks.com/topic/117154-solved-_serverquery_string-help/#findComment-602564 Share on other sites More sharing options...
harsh00008 Posted July 29, 2008 Author Share Posted July 29, 2008 Thnx worked like a charm Link to comment https://forums.phpfreaks.com/topic/117154-solved-_serverquery_string-help/#findComment-602573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.