<?php function ShowEntries($page) { include("output.php"); $output = new COutput($page); $output->Output_All(); $action = "show"; } function NewEntry($newname, $newmail, $newurl, $newicq, $newaim, $newtext) { include("input.php"); $input = new CInput(); $input->Formular_Show(0, $newname, $newmail, $newurl, $newicq, $newaim, $newtext); } function WriteEntry($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion = "no", $preview = 0, $write = 0, $random = -1) { include("input.php"); $input = new CInput($emotion); if ($preview != 0 && $write != 0) { $input->Write_Data($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $random); } elseif ($preview != 0) { include("preview.php"); $preview = new CPreview($emotion); $preview->Show_Preview($newname, $newmail, $newicq, $newaim, $newurl, $newtext); } else { $input->Write_Data($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $random); } } #administration in progress? $i++; if ($i > 9) { echo "<HTML><HEAD><TITLE>Guestbook</TITLE><LINK HREF="guestbook.css" REL="stylesheet" TYPE="text/css"></HEAD>"; echo "<FONT SIZE="5" COLOR="E01010">Administration activities in progress.<BR>Please try it later again!</FONT>"; } } if (($act == "") || ($act == "show")) { #show guestbook call_user_func("ShowEntries", $page); } elseif ($act == "new") { #new guestbook entry call_user_func("NewEntry", $newname, $newmail, $newurl, $newicq, $newaim, $newtext); } elseif ($act == "write") { if ($pre == "yes" && $presave == "yes") { #save the preview data call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion, 1, 1, $random); } elseif ($pre == "yes") { #save data with preview call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion, 1); } else { #save data without preview call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion); } } ?>
Wszystko dzia³a poprawnie, ale gdy zrobie tak:
php:
<html><HEAD><meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> <meta http-equiv="Content-Language" content="pl"><TITLE>KzP</TITLE><link rel=stylesheet type=text/css href=style.css></HEAD> <body background=obrazy/bg2.jpg> <center> <table width="900" height="0"> <tr> <td width="900" height="0" colspan="5"><center><?php include ("menu1.php"); ?></center></td> </tr> <tr> <td width="150" height="0" valign="top"><?php include ("menu3.php") ?></td> <td width="750" height="0" valign="top" align="center"><?php function ShowEntries($page) { include("output.php"); $output = new COutput($page); $output->Output_All(); $action = "show"; } function NewEntry($newname, $newmail, $newurl, $newicq, $newaim, $newtext) { include("input.php"); $input = new CInput(); $input->Formular_Show(0, $newname, $newmail, $newurl, $newicq, $newaim, $newtext); } function WriteEntry($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion = "no", $preview = 0, $write = 0, $random = -1) { include("input.php"); $input = new CInput($emotion); if ($preview != 0 && $write != 0) { $input->Write_Data($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $random); } elseif ($preview != 0) { include("preview.php"); $preview = new CPreview($emotion); $preview->Show_Preview($newname, $newmail, $newicq, $newaim, $newurl, $newtext); } else { $input->Write_Data($newname, $newmail, $newicq, $newaim, $newurl, $newtext, $random); } } #administration in progress? $i++; if ($i > 9) { echo "<HTML><HEAD><TITLE>Guestbook</TITLE><LINK HREF="guestbook.css" REL="stylesheet" TYPE="text/css"></HEAD>"; echo "<FONT SIZE="5" COLOR="E01010">Administration activities in progress.<BR>Please try it later again!</FONT>"; } } if (($act == "") || ($act == "show")) { #show guestbook call_user_func("ShowEntries", $page); } elseif ($act == "new") { #new guestbook entry call_user_func("NewEntry", $newname, $newmail, $newurl, $newicq, $newaim, $newtext); } elseif ($act == "write") { if ($pre == "yes" && $presave == "yes") { #save the preview data call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion, 1, 1, $random); } elseif ($pre == "yes") { #save data with preview call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion, 1); } else { #save data without preview call_user_func("WriteEntry", $newname, $newmail, $newicq, $newaim, $newurl, $newtext, $emotion); } } ?></td> </tr> <tr> <td width="0" height="0"></td> <td width="900" height="0"><center><?php include ("menu2.php") ?></center></td> <td width="0" height="0"></td> </tr> </table> </center> </body> </html>
... gdy zapisze wpis to wy¶wietla sam± strone tak jakby nie by³o skryptu. Co zrobiæ, ¿eby skrypt dzia³a³ tak jak bez strony?