Ninjakreborn Posted January 26, 2011 Share Posted January 26, 2011 [regex] if (preg_match_all('/<input type\=\"radio\"(.*?)\/>/is', $data, $matches)) { echo '<pre>'; print_r($matches); echo '</pre>'; }else { exit; } [/regex] 9"><b>Semester</b></font><img src="http://www.smc.edu/gif/nul-s.gif" alt="Warning, selecting a semester will automatically reload this page."></span></label></td> <td colspan="10" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="2576597448717081150" /><fieldset id="P1_SEMNAME" class="radio_group"><table summary="" class="radiogroup"><tr> <td nowrap="nowrap"><input type="radio" name="p_v01" value="Winter2011" onclick="doSubmit('P1_SEMNAME')" id="P1_SEMNAME_0" /> <label for="P1_SEMNAME_0">Winter2011 </label></td><td nowrap="nowrap"><input type="radio" name="p_v01" value="Spring 2011" checked="checked" onclick="doSubmit('P1_SEMNAME')" id="P1_SEMNAME_1" /> <label for="P1_SEMNAME_1">Spring 2011 </label></td></tr></table></fieldset> </td></tr><tr><td nowrap="nowrap" align="right"><label for="P1_CLASSTYPE"><span class="t12OptionalLabel"><font color="#003399"><b>Class Type</b></font><img src="http://www.smc.edu/gif/nul-s.gif" alt="Warning, selecting a class type will automatically reload this page."></span></label></td> I want to return everything that is a radio button. This does not work. Any advice. I have modified this from Regex I was using to get everything in a select option list (which works fine), it's just this modified version to get radio results, does not work. I may want to restrict it to only ones with a certain name after this, but right now I just want to get the basic working. Any advice? Quote Link to comment https://forums.phpfreaks.com/topic/225746-get-input-data-from-html/ Share on other sites More sharing options...
.josh Posted January 26, 2011 Share Posted January 26, 2011 c/ping that code and example content works fine for me, are you using the right variable for the subject? I see you have $data...is that the right variable? If so, then your problem is still somewhere else, that regex is fine, based on the example content you listed. Quote Link to comment https://forums.phpfreaks.com/topic/225746-get-input-data-from-html/#findComment-1165533 Share on other sites More sharing options...
Ninjakreborn Posted January 26, 2011 Author Share Posted January 26, 2011 Hmm your right. It would help if I had the right URL in there. I had copied/pasted the wrong URL into my script. That has never happened before. Quote Link to comment https://forums.phpfreaks.com/topic/225746-get-input-data-from-html/#findComment-1165651 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.