Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
IP LOGGER in SWiSHMax
Category : SWiSHMax | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

Hi!

This is my first tutorial.
This example shows you how to communicate with php and send data (such as IP) to Swish. And after displaying the IP in SwishMax it saves it to a ip.txt which you can open up.

1.create a swishmax movie.
2.place a dynamic text there. Name it "myobj" and check the TARGET checkbutton.
The text's variable name should be "myvar".
3.Make a button and name it "IpGet".
and put this script for the button "IpGet" you just created:

on(release) {
loadVariables("myphp.php",'POST');
}


4.And insert a static text, name it "IpLog".
And in the properties go to FORMATTING of text. Then select RENDER TEXT AS HTML button.
user posted image

And type this in the text field of "IpLog":

CODE
<a href='ip.txt' target='_blank'>Open IP log</a> </font>


5.Then you're done with the Swish part. Save the file now.
Now to the little php part

----------------------------------------------------
1.Open notepad/dreamweaver type this:

CODE
<?

$ip = $REMOTE_ADDR;

echo "&myvar=$ip";

$filename = 'IP.txt';









$fp = fopen( 'ip.txt', 'a+' ) or exit( 'plz check the permizzions.umust Chmod 777' );



fwrite( $fp, $ip."n");



fclose( $fp );

?>




2.save the file as "myphp.php" and put in same folder as the swish file we just created.

That was all now you upload it to a webhost WITH PHP support or it won't work. U may need to CHMOD 777 on the files. Not sure.

Okay. Now I've to explain everything or I could have ripped the source?
1. Ipget button sends message to our php file using the POST method.
2.Php responds back to flash with "echo "&myvar=$ip"
3.Php sends IP address of the viewer to swish, swish takes it and put it up in text field "myobj".
4.After sending IP to swish, Php automatically saves the ip to IP.txt. It will create the txt file automatically, so don't worry. And $fp = fopen( 'ip.txt', 'a+' ) says that it should go to the end of file continue and don't overwrite previous saved IP addresses.
5.The text we typed in text "Iplog" is actually a html code. In Html "<a href='ip.txt' target='_blank'>Open IP log</a> </font>" means make a text OPEN IP log and when u click on it, it should open IP.TXT.

View the IPLogger


All rights reserved - swish-db.com