Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php] błąd w klasie
Forum PHP.pl > Forum > Przedszkole
e-milnet
wyskakuje mi bład:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'


  1. class Object_web_1
  2. {
  3.  
  4. private $body;
  5. private $logo;
  6. public $site_name;
  7. public $footer;
  8. public $web_width=1200;
  9. public $web_txt_width=1000;
  10. public $style;
  11. public $menu;
  12. public $left_column;
  13. public $right_column;
  14. public $status;
  15. public $contents;
  16. public $haed;
  17.  
  18. function __set($name, $value)
  19. {
  20. $this->$name = $value;
  21. }
  22. public function Add_logo($url)
  23. {
  24. $this->head .="\t<link rel=\"Shortcut icon\" href=\"".$url."\" />\n";
  25. $this->logo ="<br><img width=\"150\" src=\"".$url."\"><br><br>";
  26. }
  27. public function Add_title($title)
  28. {
  29. $this->head .="\t<title>".$this->site_name." - ".$title."</title>\n";
  30. }
  31. public function Add_keywords($text)
  32. {
  33. $this->head .="\t<meta name=\"keywords\" content=\"".$text."\"\n";
  34. }
  35. public function Add_Style($object, $selector , $value)
  36. {
  37. $this->style .="\t\t\t ".$object." {".$selector.":".$value."}\n";
  38. }
  39. public function Add_Styles($object, $styl)
  40. {
  41. $this->style .="\t\t\t ".$object."\n";
  42. $this->style .="\t\t\t {\n";
  43. if(gettype($styl)=="array")
  44. {
  45. foreach($style as $selector => $value)
  46. {
  47. $this->style .="\t\t\t\t ".$selector.":".$value.";\n";
  48. }
  49. }
  50. else $this->style .="\n".$style."\n";
  51. $this->style .="\t\t\t }\n";
  52. }
  53. public function Add_Stylesif($url)
  54. {
  55. $this->head .="\t<link rel=\"Stylesheet\" type=\"text/css\" href=\"".$url."\" />\n";
  56. }
  57. public function Add_left_window($txt)
  58. {
  59. $this->left_column .="\t\t\t\t<div id=\"left_window\">\n";
  60. $this->left_column .="\t\t\t\t\t".$txt."\n";
  61. $this->left_column .="\t\t\t\t</div>\n";
  62. }
  63. public function Add_right_window($txt)
  64. {
  65. $this->right_column .="\t\t\t\t<div id=\"left_window\">\n";
  66. $this->right_column .="\t\t\t\t\t".$txt."\n";
  67. $this->right_column .="\t\t\t\t</div>\n";
  68. }
  69. public function Add_textbox($txt)
  70. {
  71. $this->contents .="\t\t\t\t<div id=\"textbox\">\n";
  72. $this->contents .="\t\t\t\t\t".$txt."\n";
  73. $this->contents .="\t\t\t\t</div>\n";
  74. }
  75.  
  76. public function Start()
  77. {
  78. $this->head .="\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >\n";
  79.  
  80. $this->body .="\t<center><table id=\"all\" width=\"".$this->web_width."\">\n";
  81. $this->body .="\t\t<tr id=\"line_1\">\n";
  82. $this->body .="\t\t\t<td id=\"logo\"><center>".$this->logo."</center></td>\n";
  83. $this->body .="\t\t\t<td id=\"site_name\" width=\"".$this->web_txt_width."\"><center><h1>".$this->site_name."</h1></center></td>\n";
  84. $this->body .="\t\t\t<td id=\"status\"><center>".$this->status."</center></td>\n";
  85. $this->body .="\t\t</tr>\n";
  86. $this->body .="\t\t<tr id=\"line_2\">\n";
  87. $this->body .="\t\t\t<td colspan=\"3\" id=\"menu\">".$this->menu."</td>\n";
  88. $this->body .="\t\t</tr>\n";
  89. $this->body .="\t\t<tr id=\"line_3\">\n";
  90. $this->body .="\t\t\t<td valign=\"top\" id=\"left_column\">\n".$this->left_column."\t\t\t</td>\n";
  91. $this->body .="\t\t\t<td valign=\"top\" id=\"contents\">\n".$this->contents."\t\t\t</td>\n";
  92. $this->body .="\t\t\t<td valign=\"top\" id=\"right_column\">\n".$this->right_column."\t\t\t</td>\n";
  93. $this->body .="\t\t</tr>\n";
  94. $this->body .="\t\t<tr id=\"line_4\">\n";
  95. $this->body .="\t\t\t<td colspan=\"3\" id=\"footer\">".$this->footer."</td>\n";
  96. $this->body .="\t\t</tr>\n";
  97. $this->body .="\t</table></center>\n";
  98.  
  99.  
  100. $style ="\t<style>\n".$this->style."\t</style>\n";
  101. $head ="<head>\n".$this->head.$style."</head>\n\n\n\n";
  102. $body ="<body>\n".$this->body."</body>\n";
  103. $start ="<html>\n".$head.$body."</html>\n";
  104. echo $start;
  105. }
  106. }


Czy mógł by mi ktoś go znaleźć ?
nospor
Klasa jest napisana na php5 a ty odpalasz to na php4
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.