DATA !!

Wszystko o językach skryptowych takich jak PHP i Perl, serwerach WWW, CGI, bazach danych i języku SQL.
MisieK
Posty: 18
Rejestracja: 28 lip 2005, 09:26:19
Lokalizacja: Włocławek
Płeć: Niewybrana
User Agent: Internet Explorer Windows 1024x768
Kontakt:

DATA !!

Post autor: MisieK »

Witam,
Oto skrypt:

Kod: Zaznacz cały

<?
/*

annotate.php3 

This is a module that can be placed on any php3 page to allow users to add
their comments. The comments are stored in a file in the current directory,
whose name is constructed by adding ".comment" to the calling page's name,
and merged into the calling page dynamically. &#40;The calling page is not
modified.&#41;

I wrote this because I wanted a simple way to add this functionality to my
pages without requiring that mySQL be available.

In the message input, blank lines are converted to paragraph tags. No other
conversions are applied. If you don't want your users to be able to input
html, uncomment the "strip_tags" line.

Note that the directory must be writable by the web server.

Put this module in some convenient location and then embed it in your pages
like so:

require&#40;"/some/full/path/annotate.php3"&#41;;
or, relative to the docroot:
require&#40;$DOCUMENT_ROOT . "/relativepath/php3"&#41;;

Steve Yelvington <steve@yelvington.com>

*/
if &#40;$message&#41;
    &#123;
    /* uncomment the next two lines to strip out html from input */
    /* $name = strip_tags&#40;$name&#41;; */
    /* $message = strip_tags&#40;$message&#41;; */
    $message = ereg_replace&#40;"\r\n\r\n", "\n<P>", $message&#41;;
    $date = date&#40;"l, F j Y, h:i a"&#41;;
    $message = "<B>$name </B> -- $date<P> $message <BR><HR>";
    $fp = fopen &#40;basename&#40;$PHP_SELF&#41; . ".comment", "a"&#41;;
    fwrite &#40;$fp, $message&#41;;
    fclose &#40;$fp&#41;;
    &#125;
@readfile&#40;basename&#40;&#40;$PHP_SELF . ".comment"&#41;&#41;&#41;;
?>
Gdzie i co zmienić tak aby pokazywało się tak: 27-08-2005 22:13 a nie tak: Saturday, August 6 2005, 04:29 pm

Pozdrawiam,

MisieK[/b]
Clothes off, face down, x up, c'mon... G-Unit :)
porni
Posty: 1354
Rejestracja: 08 lip 2005, 18:33:05
Płeć: Niewybrana
User Agent: Firefox Windows

Post autor: porni »

Kod: Zaznacz cały

 $date = date&#40;"l, F j Y, h:i a"&#41;; 
A składnie php znasz chociaż?
MisieK
Posty: 18
Rejestracja: 28 lip 2005, 09:26:19
Lokalizacja: Włocławek
Płeć: Niewybrana
User Agent: Internet Explorer Windows
Kontakt:

Post autor: MisieK »

Już se poradziem ! Dobra dzięki...
Clothes off, face down, x up, c'mon... G-Unit :)
ODPOWIEDZ