Add exams from exam100 to exam150
This commit is contained in:
31
exam123/srcphp5.php
Normal file
31
exam123/srcphp5.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
//Database Hit counter for php 5.0 doesnt work now, because of new version of php. myslql_result() doesnt exists...
|
||||
|
||||
require '/var/www/nikola/practice/exam110/connect.inc.php';
|
||||
|
||||
$user_ip = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
function ip_exists($ip)
|
||||
{
|
||||
global $user_ip; // Sa global omogucavamo da koristimo vrednost promenljive u funkciji
|
||||
echo $user_ip;
|
||||
}
|
||||
|
||||
function update_count()
|
||||
{
|
||||
global $con;
|
||||
$query = "SELECT `count` FROM `hits_count` ";
|
||||
if ($query_run = mysqli_query($con, $query)) {
|
||||
if (mysqli_num_rows($query_run) > 0) {
|
||||
// $count = mysql_result($query_run, 0,'count');
|
||||
// $count_inc = $count + 1;
|
||||
|
||||
// $query_update = "UPDATE `hits_count` SET `count` = '$count_inc'";
|
||||
// if ($query_update_run = mysqli_query($con, $query_update)) {
|
||||
echo 'OK';
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
update_count();
|
||||
Reference in New Issue
Block a user