unemployment Posted June 28, 2011 Share Posted June 28, 2011 How do I tell php to check if GET['with'] exists and if it does how can I also get the data after = sign? Example URL: mysite.com/messaging.php?action=start&with=username Link to comment https://forums.phpfreaks.com/topic/240614-help-with-get/ Share on other sites More sharing options...
Maq Posted June 28, 2011 Share Posted June 28, 2011 isset $_GET['with'] Link to comment https://forums.phpfreaks.com/topic/240614-help-with-get/#findComment-1235873 Share on other sites More sharing options...
ScotDiddle Posted June 28, 2011 Share Posted June 28, 2011 unemployment, Try this: if isset($_GET) { $incomingGetParm = $_GET; $debug = FALSE; if ($debug) { $parm = $incomingGetParm; echo "<pre><h3 style=\"color: #205E75;\">\ $incomingGetParm \n"; var_dump($parm); echo "</pre></h3> \n"; } foreach ($incomingGetParm as $getIDX => $gottenItem) { $getID = $getIDX; // This is the part before the equal sign $getParmValue = $gottenItem; // This is the part after the equal sign } } Scot L. Diddle, Richmond VA Link to comment https://forums.phpfreaks.com/topic/240614-help-with-get/#findComment-1235882 Share on other sites More sharing options...
fugix Posted June 28, 2011 Share Posted June 28, 2011 since $_GET is an associative array, you can also use array_key_exists() there are several ways to do what you want Link to comment https://forums.phpfreaks.com/topic/240614-help-with-get/#findComment-1235893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.