# Shared object on server side?

**URL:** https://forum.kirupa.com/t/shared-object-on-server-side/185805
**Category:** Uncategorized
**Created:** [April 16, 2006, 6:56pm UTC](https://forum.kirupa.com/t/shared-object-on-server-side/185805 "2006-04-16T18:56:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![engghost](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@engghost](https://forum.kirupa.com/u/engghost)
#### Post date: [April 16, 2006, 6:56pm UTC](https://forum.kirupa.com/t/shared-object-on-server-side/185805/1 "2006-04-16T18:56:39Z")

</div>

**[SIZE=4]hi every body , i just have known about shared object class , it is really so usefull, [/SIZE]**  
**[SIZE=4]the problem is that : flash movie cannot save info. on the internet ,- it save it just on PC -[/SIZE]**  
**[SIZE=4][/SIZE]**  
**[SIZE=4]e.g. if i wonna make some movie in my site that add No. “1” when any visitor open my site ( as a visitors counter) , i cannot do that with shared object class , [/SIZE]**  
**[SIZE=4][/SIZE]**  
**[SIZE=4]so, please help me in doing that :drool: [/SIZE]**

---

<div class="post-metadata">

### Author: ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)
#### Post date: [April 16, 2006, 11:32pm UTC](https://forum.kirupa.com/t/shared-object-on-server-side/185805/2 "2006-04-16T23:32:05Z")

</div>

You can do that with some simple server-side script as PHP… for only visitors counter there is no need for databases and stuff… just increase a value writen in a text file.

For getting the number of visitors to flash use loadVariables… something like loadVariables(“count.php”, this);  
It will be later accessible in visitsNumber variable

then create count.txt on the server and count.php sould look something like here

```php
<?

$filename = "count.txt";

$handle = fopen($filename, "r+");
$visitors_count = fread($handle, filesize($filename)) + 1;
fwrite($handle, $visitors_count);
echo "visitsNumber=\"$visitors_count\"";

?>

```

---

<div class="post-metadata">

### Author: ![engghost](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@engghost](https://forum.kirupa.com/u/engghost)
#### Post date: [April 19, 2006, 7:14pm UTC](https://forum.kirupa.com/t/shared-object-on-server-side/185805/3 "2006-04-19T19:14:57Z")

</div>

thanks a lot Mathew for ur reply

bu tas i thought , flash cannot do it alone, what abity:wasted:

thanks a lot again
