Aşağıdaki kodu çalıştırdığım zaman "Parse error: syntax error, unexpected T_STRING in /home/xxx/public_html/usersonline/config.php on line 20" hatasını alıyorum. Nasıl çalıştırabilirim bu kodu?
//Delete User mysql_db_query($database, "DELETE FROM $table WHERE ip='$_SERVER[REMOTE_ADDR]'") or die("Cannot connect to the database"); mysql_db_query($database, "DELETE FROM $table WHERE timestamp<$timeout") or die("Cannot connect to the database");
//Insert User $ip = $_SERVER['REMOTE_ADDR']; $insert = mysql_db_query($database, "INSERT INTO $table VALUES ('$timestamp','$ip','$PHP_SELF')") or die("Cannot connect to the database");
//Fetch Users Online $result = mysql_db_query($database, "SELECT DISTINCT ip FROM $table WHERE file='$PHP_SELF'") or die("Failed!"); $users = mysql_num_rows($result);
// Compare IP's found in the database while ($row = mysql_fetch_array($result)) { $country_query = ' SELECT country2 FROM iptocountry WHERE ipfrom < INET_ATON("'.$row['ip'].'") ORDER BY ipfrom DESC LIMIT 0,1';
//Set country code in array $country_exec = mysql_query($country_query); $ccode_array=mysql_fetch_array($country_exec); $country_code=$ccode_array['country2'];
//Change to lowercase $country_code = strtolower($country_code);
// Cut IP's $line = substr("$row[ip]",0,5);
// Addind xx and <br> $showip = chunk_split($line,30,".xx.xx \n"); echo "<br />\n";
PHP için Zend varken hiç birisi geçemez Zend i cracklisini arayıp bulmalısın ben kendi sayfasında tanıtımını koyuyorum senin icin sloganı bile cok hos : " over 4.5 million PHP developers and 22 million domains use PHP. Only 1 Professional PHP Development Tool:Zend Studio – the Leading PHP IDE
turkcesi : 4.5 milyondan fazla geliştirici ve 22 milyon php domaini.Sadece 1 profesyonel Geliştirme aracı - Zend Studio -
PHP için Zend varken hiç birisi geçemez Zend i cracklisini arayıp bulmalısın ben kendi sayfasında tanıtımını koyuyorum senin icin sloganı bile cok hos : " over 4.5 million PHP developers and 22 million domains use PHP. Only 1 Professional PHP Development Tool:Zend Studio – the Leading PHP IDE
turkcesi : 4.5 milyondan fazla geliştirici ve 22 milyon php domaini.Sadece 1 profesyonel Geliştirme aracı - Zend Studio -
Arkadaşlar wordpress sitem var yönetim panelinin düzenleme kısmında ufak bir değişim yapıyordum.Social links adlı eklentide sitede ingilizce görünüyordu twiiter va facebook'un ismi örneğin; (Follow us ın Twiiter) yazıyodu onu "Bizi Twitter'da takip edin" olarak değiştirdim ve sonra bu hatayı aldım.
Parse error: syntax error, unexpected T_STRING in /home/guncelsi/public_html/wp-content/themes/max-magazine/widgets/widget_social_links.php on line 46
Şimdi ne siteye giriliyor ne yönetim paneline ne yapıcam :(
Arkadaşlar wordpress sitem var yönetim panelinin düzenleme kısmında ufak bir değişim yapıyordum.Social links adlı eklentide sitede ingilizce görünüyordu twiiter va facebook'un ismi örneğin; (Follow us ın Twiiter) yazıyodu onu "Bizi Twitter'da takip edin" olarak değiştirdim ve sonra bu hatayı aldım.
Parse error: syntax error, unexpected T_STRING in /home/guncelsi/public_html/wp-content/themes/max-magazine/widgets/widget_social_links.php on line 46
Şimdi ne siteye giriliyor ne yönetim paneline ne yapıcam :(
"Bizi Twitter'da takip edin" yerine "Bizi Twitter\'da takip edin" şeklinde düzeltme yapın. Eğer çift tırnaklı kısımları sonradan eklediyseniz \"Bizi Twitter'da takip edin\" şeklinde deneyin. Yani ya tek tırnağın öncesine ya da çift tırnakların öncesine slash karakteri eklenecek.
1. kod: config.php
[CODE]<?php
//Database settings
$server = "localhost";
$db_user = "xxx";
$db_pass = "xxx";
$database = "xxx;
$dbh = mysql_connect($server, $db_user, $db_pass);
//don't change settings below
$table = "useronline";
//Connect DB
mysql_connect($server, $db_user, $db_pass);
//Select DB
mysql_select_db($database, $dbh);
?>[/CODE]
2. kod: online.php
[CODE]<?
require("config.php");
//Fetch Time
$timeoutseconds = 300;
$timestamp = time();
$timeout = $timestamp - $timeoutseconds;
//Delete User
mysql_db_query($database, "DELETE FROM $table WHERE ip='$_SERVER[REMOTE_ADDR]'") or die("Cannot connect to the database");
mysql_db_query($database, "DELETE FROM $table WHERE timestamp<$timeout") or die("Cannot connect to the database");
//Insert User
$ip = $_SERVER['REMOTE_ADDR'];
$insert = mysql_db_query($database, "INSERT INTO $table VALUES
('$timestamp','$ip','$PHP_SELF')") or die("Cannot connect to the database");
//Fetch Users Online
$result = mysql_db_query($database, "SELECT DISTINCT ip FROM $table WHERE file='$PHP_SELF'") or die("Failed!");
$users = mysql_num_rows($result);
// Compare IP's found in the database
while ($row = mysql_fetch_array($result)) {
$country_query = '
SELECT country2
FROM iptocountry
WHERE ipfrom < INET_ATON("'.$row['ip'].'")
ORDER BY ipfrom DESC
LIMIT 0,1';
//Set country code in array
$country_exec = mysql_query($country_query);
$ccode_array=mysql_fetch_array($country_exec);
$country_code=$ccode_array['country2'];
//Change to lowercase
$country_code = strtolower($country_code);
// Cut IP's
$line = substr("$row[ip]",0,5);
// Addind xx and <br>
$showip = chunk_split($line,30,".xx.xx \n");
echo "<br />\n";
// spit out the results (ip.xx flag)
echo "<a href='stats.php' style='text-decoration:none'>$showip</a> <a href='stats.php'><img src='flags/$country_code.png' border ='no'></a>\n";
}
echo "<br />\n";
echo "Online $users User(s)\n";
// Close DB
mysql_close($dbh);
?>[/CODE]