/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/test/test9.php
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/test/test9.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Thu Jan 30 03:29:41 2003 UTC revision 1.2 by jonen, Fri Sep 19 22:49:58 2003 UTC
# Line 14  include_once("localinc.php"); Line 14  include_once("localinc.php");
14   *                           to the wrapper DIVtag   *                           to the wrapper DIVtag
15   * @return  DIVtag object.   * @return  DIVtag object.
16   */   */
17  function babw_nl2br($raw_string, $class=NULL) {  function my_nl2br($raw_string, $class=NULL) {
18    
19      $attributes = array();      $attributes = array();
20      if ($class) {      if ($class) {
# Line 27  function babw_nl2br($raw_string, $class= Line 27  function babw_nl2br($raw_string, $class=
27      $lines = explode( chr(13), $raw_string);      $lines = explode( chr(13), $raw_string);
28      $index=0;      $index=0;
29      while( $lines[$index] ) {      while( $lines[$index] ) {
30          $div->push( $lines[$index], html_br() );          $div->add( $lines[$index], html_br() );
31          $index++;          $index++;
32      }      }
33      return $div;      return $div;
# Line 38  $page->set_text_debug( $debug ); Line 38  $page->set_text_debug( $debug );
38    
39  $form = new FORMtag(array("name"=> "testform",  $form = new FORMtag(array("name"=> "testform",
40                            "method" => "POST",                            "method" => "POST",
41                            "action" => $PHP_SELF));                            "action" => $_SERVER["PHP_SELF"]));
42    
43    
44  $textarea = form_textarea("text", "this is a long ass test" );  $textarea = form_textarea("text", "this is a lame test" );
45  $textarea->set_tag_attributes( array("cols" => "60",  $textarea->set_tag_attributes( array("cols" => "60",
46                                       "rows" => "40") );                                       "rows" => "40") );
47    
48  $form->push( html_br(), $textarea, html_br() );  $form->add( html_br(), $textarea, html_br() );
49    
50  $form->push( form_submit("what", "Submit") );  $form->add( form_submit("what", "Submit") );
51  $form->push( form_submit("debug", "Debug") );  $form->add( form_submit("debug", "Debug") );
52    
53  $page->push( $form, html_br(), html_br() );  $page->add( $form, html_br(), html_br() );
54    
55  if ($REQUEST_METHOD == "POST") {  if ($_SERVER["REQUEST_METHOD"] == "POST") {
56      //Ok lets process the input.      //Ok lets process the input.
57      $div = babw_nl2br( $HTTP_POST_VARS["text"] );      $div = my_nl2br( $_POST["text"] );
58      $page->push( $div );      $page->add( $div );
59  }  }
60    
61  print $page->render();  print $page->render();

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed