-
Вебмастеру
(
http://forum.oszone.net/forumdisplay.php?f=22)
Значит есть скрипт PHP отображения реального времени и даты. Есть сайт, который висит у хостера. Подскажите, как запустить то этот скрипт, т.е. чтобы в конечном результате на сайте отображалась дата?
Вот тело скрипта:
Код:
<?php
// melbdate.php3
// rename file extension from .txt to .php3
// Script copyright (C) 2000 Dean Kennedy (dean@terrabyte.dc.com.au)
// Version 1.0 * 23 October 2000
// Free to use, modify and copy so long as you leave my name in comments
// Distributed under the terms of the GNU General Public License (GPL).
// Because it is licensed free of charge, there is NO WARRANTY, it is
// provided AS IS. The author can not be held liable for any damage that
// might arise from the use of this software. Use it at your own risk.
// http://www.gnu.org/copyleft/gpl.html
// To adjust the format of the date, see the list of variables at the
// official PHP site (php.net): http://www.php.net/manual/function.date.php
//
// If your local time is *behind* the server time, then change the "+" to
// a "-" in the $melbdate line
//
// Keep in mind that you'll have to update the $hourdiff variable within the
// script when your *local* daylight saving time/standard time changes, if
// it is a different setting to the server daylight saving/standard time
// Variable for hours
$hourdiff = "15"; // hours difference between server time and local time
// If you don't know how many hours, then "uncomment" the three lines
// below by deleting "// " to see what the server time is (remember to
// put the comments "// " back when you've finished checking:
// $serverdate = date("l, d F Y h:i a");
// print ("$serverdate");
// print (" &nbsp; <p>");
// Nothing needs to be changed below here unless you want to change
// the format of the date (see above for URL of options) or your local
// time is behind the server time
$timeadjust = ($hourdiff * 60 * 60);
$melbdate = date("l, d F Y h:i a",time() + $timeadjust);
print ("$melbdate");
?>
Его в код надо вставлять в таком же виде?
[s]Исправлено: Prisoner, 2:18 12-10-2004[/s]
|
Guest
а Вы поняли, что скрипт корректирует Вашу дату по
Цитата:
$hourdiff = "15"; // hours difference between server time and local time
|
при этом вводя поправку
Цитата:
$timeadjust = ($hourdiff * 60 * 60);
|
Вам действительно такая поправка нужна? (По Вашему IP не скажешь, но может, конечно, *сервер у Вас там находится?)
|
Да честно говоря не понял...
Но с этим разберусь!
Меня то интересует вопрос как запустить скрипт (гостевая книга или дата)? Т.е. Что надо сделать?
|
XCodeR |
11-10-2004 14:18 212381 |
юзать Flash.... кажись самое легкое..... а вообщето для даты и времени прекрасно подходит JavaScript....
|
Да нет! Я имею ввиду, к примеру, есть скрипт и надо сделать так, чтобы он работал на благо! Т.е. куда надо запихать сам текст скрипта, что там изменить и т.п.
|
XCodeR |
11-10-2004 16:53 212383 |
пропиши в то место, где нужно вывести дату....
include "<путь к срипту>"
|
Нужно, чтоб хостер разрешал запускать скрипты...
|
Guest
Если хостер разрешает гонять php, то глянь какие расширения файлов обрабатываюся как php...
Дык, SSI и PHP разные вещи
|
Prisoner |
13-10-2004 06:55 212387 |
Вот так, если быть точным -
Код:
<?
include_once('data.php');
?>
Если скрипт лежит в одном каталоге с html-файлом из которого вызывается и скрипт этот носит гордое название data.php.
|
archy, а ты про какие файлы то говоришь? Чет я не пойму...
|
Время: 07:08.
© OSzone.net 2001-