Author Topic: Using XML with PHP  (Read 1392 times)

0 Members and 1 Guest are viewing this topic.

Offline m0l0ko

  • Peasant
  • *
  • Posts: 129
  • Cookies: -4
    • View Profile
Using XML with PHP
« on: July 01, 2012, 06:45:47 pm »
I need to log information about users on my site, such as their IP, OS, location etc. and the links that they click within the site. Usually I'd store all this info in a MySQL databse but I'm using a free web hosting site which doesn't have MySQL database access. I'm wondering what the next best way to do this would be. Would an XML document be the way to go?

Offline Ragehottie

  • Knight
  • **
  • Posts: 313
  • Cookies: -9
  • Hack to learn, not learn to hack.
    • View Profile
Re: Using XML with PHP
« Reply #1 on: July 01, 2012, 07:55:54 pm »
000webhost.com

Free hosting with 5(I think) MySQL databases
:D
Blog: rexmckinnon.tumblr.com

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Using XML with PHP
« Reply #2 on: July 01, 2012, 10:00:44 pm »
And what's wrong with google analytics? they show in-depth info of what you want... you can just see a chart how they navigate your site...

Offline r23k

  • NULL
  • Posts: 3
  • Cookies: 0
  • After all, we're all alike.
    • View Profile
Re: Using XML with PHP
« Reply #3 on: September 04, 2013, 02:27:58 am »
Code: [Select]
<?php

$ip 
12356;
$sistema linux;

$manipulador_arq fopen("information.xml","w+"); 


@
fwrite($manipulador_arq,"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>
\n<information>\n<settings
    />\n
    <List>\n");



$xml = "<\n ip = \"$ip\"\n sistema = \"$sistema\"\n/>\n";


@fwrite($manipulador_arq,$xml);


@fwrite($manipulador_arq,"</List>\n</information>");
@fclose($manipulador_arq);


?>

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: Using XML with PHP
« Reply #4 on: September 04, 2013, 05:17:42 pm »
And what's wrong with google analytics? they show in-depth info of what you want... you can just see a chart how they navigate your site...
Well, for example in The Netherlands you would have to ask a user to put non essential cookies on their computers (so php_sessionid is allowed but a analytics cookie not).
~Factionwars