HTML Functions - common functions for extracting data from HTML
Located in Program_Root/HTML_Functions.php (line 9)
Get form action by index
Get action of form tag $index, where index 1 is the first form tag. Example:
1 $html = '<form name="aForm" action="http://www.domain.com/submit.php">
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>';
5 echo $html_func->get_form_action_by_index($html, 1);
6
Get input name by index
Get name of input tag $index, where index 1 is the first input tag. Example:
1 $html = '<form>
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>';
5 echo $html_func->get_input_name_by_index($html, 2);
6
Get input name and value by index
Get name and value of input tag $index, where index 1 is the first input tag. Example:
Or, if there's more than 1 form...
1 $html = '<form>
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>';
5 echo $html_func->get_input_name_value($html, 2);
6
1 $html = '<form name="form1">
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>
5 <form name="form2">
6 <input type="hidden" name="age" value="20" />
7 <input type="hidden" name="sex" value="m" />
8 </form>';
9 echo $html_func->get_input_name_value($html, 1, 2);
10
Get input value by index
Get value of input tag $index, where index 1 is the first input tag. Example:
1 $html = '<form>
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>';
5 echo $html_func->get_input_name_by_index($html, 2);
6
Get input value by index
Get value of input tag $index, where index 1 is the first input tag. Example:
1 $html = '<form>
2 <input type="hidden" name="firstname" value="John" />
3 <input type="hidden" name="surname" value="Smith" />
4 </form>';
5 echo $html_func->get_input_name_by_index($html, 2);
6
Get input value
Get value of input tag whose name attribute value is $input_name Example:
1 $html = '<form>
2 <input type="hidden" name="surname" value="Smith" />
3 </form>';
4 echo $html_func->get_input_value_by_name($html, 'surname');
5
Get link url
Returns URL string for link named $link_name Example:
1 $html = '<a href="http://www.domain.com/bla/bla.html">Great Site</a>';
2 echo $html_functions->get_link_url($html, 'Great Site');
3
Get string after
Returns string found just after $text_before (after removing space and quotes)
Start element handler to find form action values
Start element handler to find input values by index
Start element handler to find input value
Documention generated on Sat, 19 Jul 2003 03:43:19 +0100 by phpDocumentor 1.2.0