--- nfo/php/libs/com.newsblob.phphtmllib/test/test9.php 2003/01/30 03:29:41 1.1.1.1
+++ nfo/php/libs/com.newsblob.phphtmllib/test/test9.php 2003/09/19 22:49:58 1.2
@@ -14,7 +14,7 @@
* to the wrapper DIVtag
* @return DIVtag object.
*/
-function babw_nl2br($raw_string, $class=NULL) {
+function my_nl2br($raw_string, $class=NULL) {
$attributes = array();
if ($class) {
@@ -27,7 +27,7 @@
$lines = explode( chr(13), $raw_string);
$index=0;
while( $lines[$index] ) {
- $div->push( $lines[$index], html_br() );
+ $div->add( $lines[$index], html_br() );
$index++;
}
return $div;
@@ -38,24 +38,24 @@
$form = new FORMtag(array("name"=> "testform",
"method" => "POST",
- "action" => $PHP_SELF));
+ "action" => $_SERVER["PHP_SELF"]));
-$textarea = form_textarea("text", "this is a long ass test" );
+$textarea = form_textarea("text", "this is a lame test" );
$textarea->set_tag_attributes( array("cols" => "60",
"rows" => "40") );
-$form->push( html_br(), $textarea, html_br() );
+$form->add( html_br(), $textarea, html_br() );
-$form->push( form_submit("what", "Submit") );
-$form->push( form_submit("debug", "Debug") );
+$form->add( form_submit("what", "Submit") );
+$form->add( form_submit("debug", "Debug") );
-$page->push( $form, html_br(), html_br() );
+$page->add( $form, html_br(), html_br() );
-if ($REQUEST_METHOD == "POST") {
+if ($_SERVER["REQUEST_METHOD"] == "POST") {
//Ok lets process the input.
- $div = babw_nl2br( $HTTP_POST_VARS["text"] );
- $page->push( $div );
+ $div = my_nl2br( $_POST["text"] );
+ $page->add( $div );
}
print $page->render();