Jump to content

Get input data from html


Ninjakreborn

Recommended Posts

[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?

Link to comment
https://forums.phpfreaks.com/topic/225746-get-input-data-from-html/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.