|
 |
|
อยากทราบวิธี เอาเวลา มาแสดง พร้อมกับ บรรทัดที่เราเรียกมาแสดงอะครับ |
|
 |
|
|
 |
 |
|
อยากทราบวิธี เอาเวลา มาแสดง พร้อมกับ บรรทัดที่เราเรียกมาแสดงอะครับ ยกตัวอย่างในบอร์ดนี้ก็ได้ ครับ คือ ด้านหลังของ Topic ก็จะมี เวลา + จำนวนผู้เข้าชม อยากรู้ว่า จะเขียนCode ยังไงดีครับผมลองใช้
Code (PHP)
<?php
<?
function displaydate_time($x) {
$thai_m=array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฏาคม","สิงหาคม","กันยายน","ตุลาคม","พฤสจิกายน","ธันวาคม");
$date_array=explode("-",$x);
$y=$date_array[0];
$m=$date_array[1]-1;
$d=$date_array[2];
$m=$thai_m[$m];
$y=$y+543;
$displaydate="$d $m $y ";
return $displaydate;
}
function checkemail($checkemail) {
if (ereg ( "^[^@ ]+@ ( [a-zA-Z0-9\-]+\.) + ([a-zA-Z0-9\-] {2}
| net | com | gov | mil | org | edu | int )$",$chechmail) ) {
return true;
} else {
return false ;
}
}
?>
?>
แต่ก็ยัง งง อยู่ว่า จะเอาไปใส่ไว้ หน้าไหน save.php หรือ หน้าที่ แสดง อะครับ งง ???
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-06-28 15:17:19 |
By :
markvocal |
View :
877 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เห้ออออออออ ..... ได้แล้วอะครับ ผมใช้
<input name="today_date" type="text" id="today_date" value="<?php
echo date("Y-m-d H:i:s");
?>" />
อันนี้แทนอะครับ แล้วในหน้า save.php ก็สั่งให้บันทึกลง DB ได้เลย ... แต่ตอนนี้ .......
อยากได้ ตัวอย่าง code โชว์ 10 กระทู้ ไว้หน้าเว็บอะครับ ...   
|
 |
 |
 |
 |
Date :
2009-06-28 15:51:40 |
By :
markvocal |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
select * from topics order by last_update desc limit 0,10;
|
 |
 |
 |
 |
Date :
2009-06-28 15:59:42 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาไปใส่อย่างไรหรอครับ ยังไม่ค่อยเข้าใจเลยอะครับ 
|
 |
 |
 |
 |
Date :
2009-06-28 18:34:21 |
By :
markvocal |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|