Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 720 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP question - security

Thread title: PHP question - security
Closed Thread  
Page 5 of 5 < 1 2 3 4 5
    Thread tools Search this thread Display Modes  
02-23-2007, 05:29 PM
#41
RaZoR^ is offline RaZoR^
RaZoR^'s Avatar
Status: Member
Join date: Feb 2006
Location:
Expertise:
Software:
 
Posts: 191
iTrader: 1 / 100%
 

RaZoR^ is on a distinguished road

  Old

Well, they can;t just open a PHP file and read its contents. Why are you giving them your config.php file? I don't quite understand that part.

02-23-2007, 06:01 PM
#42
Alex Eyre is offline Alex Eyre
Alex Eyre's Avatar
Status: Designer
Join date: Aug 2006
Location: Manchester
Expertise:
Software:
 
Posts: 1,132
iTrader: 5 / 100%
 

Alex Eyre is on a distinguished road

Send a message via MSN to Alex Eyre

  Old

ok well i need a file (php) or anything theat will add +1 to the hits count (mysql) every time the page is loaded.

So i was thinking, PHP script on site >POSTS> external script?

an include() can be got as discussed earlier in thread.
Alex.

02-23-2007, 07:45 PM
#43
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

<?php
include("config.php");
session_start();
if(!isset($_SESSION['hits'])){
$select = mysql_query("SELECT * FROM `table` WHERE ID = '1'");
$query = mysql_fetch_assoc($select);
$_SESSION['hits'] = $query['hits'];
$_SESSION['hits']++;
mysql_query("UPDATE `table` SET hits = ".$_SESSION['hits']." WHERE ID = '1'");
}
?>

Put that into each page and it will count unique hits beautifully .

Closed Thread  
Page 5 of 5 < 1 2 3 4 5


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed