|
PHP и HTML
|
|||
---|---|---|---|
#18+
Всем привет как можно посмотреть скрипт написанный в .PHP как вывести его в IE помгите пожалуйста вот мой скрипт на гостевую книгу как мне сделать чтобы он работал бальшое спасибо <?php error_reporting(0); include("option.php"); include("design.php"); unset($admin); session_register('admin'); if (empty($admin) || PASSWORD != $admin) $admin = false; // удаление записи if ($admin && isset($_GET['del'])) { $notes = file(GEST_DB); $flag = false; $deleted = urldecode($_GET['del']); $count_notes = count($notes); for ($i=0; $i<$count_notes; $i++) $notes[$i] = trim($notes[$i]); for ($i=0; $i<$count_notes; $i++) if (ereg("^".$deleted, $notes[$i])) { unset($notes[$i]); $flag = true; break; } if ($flag) { $fopt = fopen(GEST_DB, 'w'); if ($fopt) { fwrite($fopt, implode("\n", $notes)); fclose($fopt); } } } ?> <?php if (isset($_POST['body'])) $body = eregi_replace("\n", " ", nl2br(htmlspecialchars($_POST['body']))); if (isset($_POST['name'])) $name = htmlspecialchars(substr(trim($_POST['name']), 0, 40)); if (isset($_POST['mail'])) { $mail = htmlspecialchars(substr(trim($_POST['mail']), 0, 40)); eregi("^.+@(.+\.)+.+$", $mail, $mails); $mail = $mails[0]; } if (isset($body)) { if (empty($name) && isset($mail)) { eregi("^.+@", $mail, $names); $name = substr($names[0], 0, strlen($names[0])-1); } elseif (empty($name)) $name = noname; if (empty($mail)) $mail = ''; save_note(date('G:i d:m:Y')."<==>".$name."<==>".$mail."<==>".$body); } if (file_exists(GEST_DB)) { $notes = file(GEST_DB); $count_notes = count($notes); $on_page = notes_on_page; $mlim = nav_pages; $count_pages = ceil($count_notes/$on_page); if (isset($_GET['start']) && ereg("^[0-9]{1,3}$", $_GET['start'])) $start = $_GET['start']-1; else $start = 0; if ($start > $count_pages) $start = 0; $first = $count_notes - ($start * $on_page); $last = $count_notes - ($start * $on_page) - $on_page; } head(); ?> <script type="text/javascript"> <!-- function goTo(where) { document.location.replace(where); return false; } //--> </script> <p class="offer"><a href="#new" onClick="return goTo('#new');">Оставить запись</a></p> <div class="form"> <table border="0" cellspacing="0" cellpadding="5"> <tr><td> </td></tr> <?php if (file_exists(GEST_DB)) for ($i=$first; $i>$last; $i--) if (isset($notes[$i-1])) print_note($notes[$i-1]); ?> </table> <div class="pages"> <nobr> <?php unset($notes); if (isset($count_pages) && $count_pages > 1) { $before = $start; $after = $count_pages - $start - 1; if ($before > $mlim) $before = $mlim; if ($after > $mlim) $after = $mlim; $mstart = $start - $before; $mfinish = $start + $after+1; for ($i=$mstart; $i<$mfinish; $i++) { if ($i == $start) echo $i+1; else echo "<a href=\"".$_SERVER['SCRIPT_NAME']."?start=".($i+1)."\">".($i+1)."</a>"; if ($i != $mfinish-1) echo " | \n"; } } else echo " "; ?> </nobr> </div> <?php print_form();?> </div> <?php if ($admin) :?> <script type="text/javascript"> <!-- function openwin(adress) { window.open(adress, "correct"); } //--> </script> <?php endif;?> <?php foot();?> <?php function print_form() {?> <form action="<? echo $_SERVER['SCRIPT_NAME'];?>" method="post" name="record" id="record"> <a name="new"></a> <table border="0" cellspacing="0" cellpadding="4"> <thead></thead> <tbody> <tr><td>Имя : <input type="text" name="name" id="r_name" size="15" maxlength="40" class="text"></td> <td align="right">E-mail : <input type="text" name="mail" id="r_mail" size="18" maxlength="40" class="text"></td> </tr> <tr><td colspan="2"> <textarea cols="50" rows="8" name="body" id="r_body" class="text"> </textarea></td></tr> <tr><td colspan="2" align="right"><input type="submit" value="Сделать запись"></td></tr> </tbody> <tfoot></tfoot> </table> </form> <p class="offer"><a href=#top onClick="scrollTo(0,0); return false;" onFocus="this.blur();">наверх</a><br><br></p> <table width="90%"> <tr><td align="right"><a href="http://www.sunwebart.com/service/">Создание сайтов</a> <a href="http://www.sunwebart.com/">веб дизайн студией SunWebart</a></td></tr> </table> <?php }?> <?php function save_note($data_str) { $result = false; if (!file_exists(GEST_DB)) { $fopt = fopen(GEST_DB, 'w'); chmod(GEST_DB, 0733); if ($fopt) { $result = fwrite($fopt, $data_str); fclose($fopt); } } else { $notes = file(GEST_DB); for ($i=0; $i<count($notes); $i++) $notes[$i] = trim($notes[$i])."\n"; $notes[] = $data_str; $fopt = fopen(GEST_DB, 'w'); if ($fopt) { $result = fwrite($fopt, implode("", $notes)); fclose($fopt); } } return $result; } function print_note($note) { global $admin,$start; $record = explode("<==>", trim($note)); echo "<tr><td>\n"; echo "\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"note\">\n"; echo "\t<tr><td>".$record[3]."</td></tr>\n"; echo "\t<tr><td align=\"right\">"; if ($admin) { if ($start) $query_str = "del=".urlencode($record[0])."&start=".($start+1); else $query_str = "del=".urlencode($record[0]); echo "<a href=\"".$_SERVER['SCRIPT_NAME']."?".$query_str; echo "\">Удалить</a> "; echo "<a href=\"javascript:openwin('"; echo "correct.php"."?correct=".urlencode($record[0])."');"; echo "\">Править</a> "; } if ($record[2]!='') echo "<a href=\"mailto:".$record[2]."\">"; echo $record[1]; if ($record[2]!='') echo "</a>"; echo ', '.$record[0]."</td></tr>\n"; echo "\t</table>\n"; echo "</td></tr>\n"; } ?> ... |
|||
:
Нравится:
Не нравится:
|
|||
12.05.2004, 08:01 |
|
PHP и HTML
|
|||
---|---|---|---|
#18+
VELIK в сети куча гостевых, найди что-нибудь другое. Эта напсана не очень (я имею ввиду качество кода). А вообще там копирайты есть в коде : Код: plaintext
спроси у них, как ее запустить. Скорее всего просто закачать на сервер (главное чтобы хостер ПХП поддерживал). И наверное в option.php какие-то настройки поменять ... |
|||
:
Нравится:
Не нравится:
|
|||
12.05.2004, 14:08 |
|
PHP и HTML
|
|||
---|---|---|---|
#18+
это проще простого! не надо там было ничего переименовывать! 1) покупаешь комп - делаешь из него сервак. 2) заливаешь свой скрипт туда. 3) покупаешь второй комп (не обязательно такой же) 4) стучишься на "сервак" с этого компа. 5) обнаруживаешь, что у тебя все равно ничего не получается 6) покупаешь книжку ПХП для чайников 7) понимаешь (надеюсь, успешно), как работает ПХП ... |
|||
:
Нравится:
Не нравится:
|
|||
19.05.2004, 16:00 |
|
|
start [/forum/topic.php?fid=23&fpage=510&tid=1479724]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
41ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
48ms |
get tp. blocked users: |
1ms |
others: | 342ms |
total: | 480ms |
0 / 0 |