samoht Posted June 10, 2008 Share Posted June 10, 2008 hello all, I was wondering how to check a certain portion of my url with php. my url may be something like: index.php?option=com_content&view=article&id=17:special-offers&Itemid=11&form=thanks what I want to check is just the value of "form" - and I am not sure where it is going to show up in the query string - so I don't want to just strip the last characters etc. can I do something like: if ($_SERVER[REQUEST_URI](form) == "thanks") { ?? Thanks Link to comment https://forums.phpfreaks.com/topic/109602-check-a-certain-portion-of-url/ Share on other sites More sharing options...
Minase Posted June 10, 2008 Share Posted June 10, 2008 if i undestood corect you want to check the value of form right? and if it has your expected value echo something $test = $_GET['form']; if ($test == "thanks") { something; } Link to comment https://forums.phpfreaks.com/topic/109602-check-a-certain-portion-of-url/#findComment-562191 Share on other sites More sharing options...
hamza Posted June 11, 2008 Share Posted June 11, 2008 if you just want to strip the the value of the form valriable then you have to get the form variable value by using super global function and that is $_GET['name of the variable that you want to strip'] after getting just play with it or replace it strip it . that's it what else you need :'( :-\ :-X ??? Link to comment https://forums.phpfreaks.com/topic/109602-check-a-certain-portion-of-url/#findComment-563012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.