|
<script language="JavaScript" type="text/javascript">
setTimeout("location.href = 'redirect_here.html'",10000); // milliseconds, so 10 seconds = 10000ms
</script>or<meta http-equiv="refresh" content="10; url=redirect_here.html">burada nasıl çekileceğini çok güzel anlatmış.
MirroR :Pardon mesajı geç gördüm.
Anladım o zaman ben de şöyle sorayım Bunlar şuanda database'ine aktarılmış durumda mı ? ve ya şuana kadar scriptsel olarak bir işlem yaptın mı ?
ID - AI[br]
Olen[br][br]
Olduren[br]
Lokasyon[br]
Tarih/Saat[br]Veritabanını oluşturduktan sonra @death'di sanırım, bu triggerin altında göndermek istediğin değerleri veritabanına post ediceksin.setTimeout();aracılığı ile yenileyebilirsin, bunu yaparken jQuery html write incelemeni öneririm gayet rahat bir şekilde anlattığım şekilde yapabilirsin.
MYSQL=1 // 1 açık 0 kapalı
MySqlHost=111.111.111.111 // web sitenizin paylaşılan ip adresi. Web sitenizin bağlı olduğu cpanel, plesk gibi panellerden bakılabilir.
MySqlUser=user // veritabanınızn bağlı olduğu mysql kullanıcı adı
MySqlPassword=pass // " " mysql kullanıcı şifresi
MySqlDatabase=db // database ismi// yukarıdaki işlemleri gerçekleştirdikten sonra alt kısımdaki kod parçacığının console'nuza göndereceği mesaj ile bağlı olup olmadığını anlmak icin.[FUNCTION f_mysql_test]
db.connect
if (<db.connected>)
serv.log #log veritabani basarili.
else
serv.log #log veritabani basarisiz.
endif
db.closeEğer bağlantı işlemi gerçekleşmiş ise aşağıdaki işlem ile sphere üzerinden f_table_online_durum komutu ile databese içerisine online diye bir tablo oluşturuyoruz.[function f_table_online_durum]
db.connect
db.execute "create table if not exists online (durum int)"
db.closeDaha sonra bu tablo içerisine sürekli olarak online durumunun aktarımını aşağıdaki kod ile güncelleyebiliriz.on=@login
db.connect
db.execute "update online set durum='<serv.clients>'"
db.closeSunucunun kapanma durumunda online sayısı asılı kalacağı için sphere_serv_triggers.scp içerisinde f_onserver_exit komutunun altına durum='0' yaparak online sayısını sıfırlıyoruz.[function f_onserver_exit]
db.connect
db.execute "update online set durum='0'"
db.closeYukarıdaki işlemleri tamamladığınızda sphere üzerinde yapılacak tüm işlemler bitti demektir. Sıra geldi php koduna..<html>
<head>
<title>sphere_info</title>
</head>
<body>
<?php
//fill in your mysql information here
$hostname = "localhost"; // web sitenin bulunduğu dizin
$username = "root"; // mysql kullanıcı adı
$password = "password"; // şifresi
$database = "database_name"; // database ismi
//the tablename demo was used for this tutorial. change this to the actual name of the table.
$table = "online"; // tablo ismi
//connects to mysql and selects the corresponding database.
mysql_connect($hostname,$username,$password);
mysql_select_db($database);
//selects all rows from the provided table name.
$query = "select * from $table";
$result = mysql_query($query);
//this if makes sure there is information in the table. if there isn't, there will be no output.
if (mysql_num_rows($result) > 0)
{
//this creates a variable named $query_data and fills it with the information from the first row.
//using a while statement, this will repeat for each row the table contains.
while ($query_data = mysql_fetch_array($result))
{
//we create new variables for each different column in the row.
$durum = $query_data['durum'];
//this is where you can format your output using html.
$echo = "oyuncu sayısı $durum"; // açılan sayfada online oyuncu sayısı xx diye gösterilecek yazı
//this displays the actual output.
echo $echo;
}
}
?>
</body>
</html>
|
|
| Konu | Kategori | Son cevap | Son yazan | Mesaj | Görüntüleme | |
|---|---|---|---|---|---|---|
|
|
Lootnpc içeriğini göstermek
Son cevap: 18-04 22:25 · Son yazan: MirroR · Mesaj: 11 · Görüntü: 4940
|
NPC Script Yardımı | 18-04 22:25 | 11 | 4940 | |
|
|
İtemi oyunculara farklı göstermek
Son cevap: 06-06 16:56 · Son yazan: Athynas · Mesaj: 12 · Görüntü: 4952
|
Script Yardımı | 06-06 16:56 | 12 | 4952 | |
|
|
Etkinlikteki kişi sayısını göstermek
Son cevap: 01-02 22:46 · Son yazan: mahsuni · Mesaj: 5 · Görüntü: 2521
|
DIALOG Script Yardımı | 01-02 22:46 | 5 | 2521 | |
|
|
Neden Çalışmıyor ? MySql
Son cevap: 08-01 23:39 · Son yazan: xwerswoodx · Mesaj: 2 · Görüntü: 2680
|
Script Yardımı | 08-01 23:39 | 2 | 2680 | |
|
|
Gerçek Hasarı Göstermek
Son cevap: 11-12 21:49 · Son yazan: Michaell · Mesaj: 11 · Görüntü: 5201
|
Script Yardımı | 11-12 21:49 | 11 | 5201 |