note 112153 added to language.oop5

From: Date: Fri, 10 May 2013 09:51:55 +0000
Subject: note 112153 added to language.oop5
Groups: php.notes 
Request: Send a blank email to php-notes+get-194764@lists.php.net to get a copy of this message
<?php /** * Description of bshtml class for HTML attribute,elements * @author Md.Hafizur Rahman */ interface intf_html { public function form_open($form_data=array()); public function form_close(); public function input($input_data=array()); public function datalist($attr=array(),$value=array()); public function image($attr_list=array()); public function redirect($time,$url); } class bshtml implements intf_html { var $form_attribute; var $input_attribute; var $datalist_attribute; var $datalist_value; var $datalist_string; var $image_attribute; public function form_open($form_data=array()) { $this->form_attribute; foreach ($form_data as $key => $value) { $this->form_attribute.= $key."='".$value."' "; } return "<form ".$this->form_attribute." />"; } public function form_close() { return "</form>"; } public function input($input_data=array()) { $this->input_attribute=''; foreach ($input_data as $key => $value) { $this->input_attribute.= $key."='".$value."' "; } return "<input ".$this->input_attribute." />"; } public function datalist($attr=array(),$value=array()) { $this->datalist_string=''; $this->datalist_attribute=''; $this->datalist_value=''; $dln=date('mhs'); foreach ($attr as $key => $aval) { $this->datalist_attribute.= $key."='".$aval."' "; } foreach ($value as $val) { $this->datalist_value.= "<option value='".$val."'>"; } $this->datalist_string.="<INPUT list='".$dln."' ".$this->datalist_attribute.">"; $this->datalist_string.="<datalist id='".$dln."'>"; $this->datalist_string.=$this->datalist_value; $this->datalist_string.="</datalist>"; return $this->datalist_string; } public function image($attr_list=array()) { $this->image_attribute=''; foreach ($attr_list as $key => $value) { $this->image_attribute.= $key."='".$value."' "; } return "<img ".$this->image_attribute." />"; } public function redirect($time,$url) { return "<META HTTP-EQUIV='REFRESH' CONTENT='".$time."; URL=".$url."'>"; } } $obj=new bshtml(); echo $obj->form_open(array('Method'=>'POST','Action'=>'#')); echo $obj->input(array('TYPE'=>'TEXT','NAME'=>'USERID')); echo $obj->input(array('TYPE'=>'PASSWORD','NAME'=>'PASS')); echo $obj->input(array('TYPE'=>'Submit','NAME'=>'submit','Value'=>'Login')); echo $obj->form_close(); ?> ---- Server IP: 69.147.83.199 Probable Submitter: 180.149.31.208 ---- Manual Page -- http://php.net/manual/en/language.oop5.php Edit -- https://master.php.net/note/edit/112153 Del: integrated -- https://master.php.net/note/delete/112153/integrated Del: useless -- https://master.php.net/note/delete/112153/useless Del: bad code -- https://master.php.net/note/delete/112153/bad+code Del: spam -- https://master.php.net/note/delete/112153/spam Del: non-english -- https://master.php.net/note/delete/112153/non-english Del: in docs -- https://master.php.net/note/delete/112153/in+docs Del: other reasons-- https://master.php.net/note/delete/112153 Reject -- https://master.php.net/note/reject/112153 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194764) next »