Att - Jubba Can you help on this please?

Hi Jubba if you look at the post below, I have been told that you might be the person that could help me!

Thanks

kevhttp://www.kirupaforum.com/showthread.php?s=&threadid=14073

I moved this to the SSScripting forum.

  1. Do you know any PHP?

  2. Do you have access to a mySQL database?

  3. Does your host support PHP/mySQL database?

If you are unsure contact your host. If it does then its just a matter of loading and sending variables to a database.

Hi, jubba

  1. Do you know any PHP?

I have used PHP in the past for creating simple mail forms etc!

  1. Do you have access to a mySQL database?

Yes I have access to one on my server! I have never used one before though, but I guess now is the time to start!

  1. Does your host support PHP/mySQL database?

Yes and Yes

So how to I start?

Kev

I actually found script using a google search:

I installed it quick and it worked. What you will have to do is upload all the files to your server and read the install.txt

The only difference is that you will have to send the variables from Flash to the PHP script.

Try the following link:

Here is a bunch more links doing for the same thing.

Great thanks for the links! Just So I am heading in the right direction I will explain exactly want I am doing and want to accomplish!

Here is the script which is within a MC


stop();
linkArray = new Array();
urlArray = new Array();
btnArray = new Array();
i=0;
while (this["link"+i] != undefined){
        var currentURL = this["url" + i];
        var currentLink = this["link"+i];
		var currentbtn = this["btn"+i];
        urlArray.push(currentURL);
        linkArray.push(currentLink);
		btnArray.push(currentBtn);
        i++;
}

/****************************************/
for(i=0;i<btnArray.length;i++){ //loop
	orig.duplicateMovieClip("orig"+i,i); //duplicate orig mc
	this["orig" + i]._y = (i*orig._height); //set y positions for buttons
	this["orig" + i].linkName = linkArray*; //set button text
	this["orig" + i].URL = urlArray*; //set URL value INSIDE OF individual movieclips
	this["orig" + i].btn = btnArray*; // set total number of buttons to duplicate
	this["orig" + i].clickCount=0;

}

This allows me to load, add and updates in links straight from a text file! each one of the links has a clickcount. I need to save each clickcount to a text file (or whatever). So I am hoping using PHP will do the trick!

So when any link is click the clickcount will go up by one and I want to save these and reload them, so everyone using the site can see how many times a certain link has been clicked!

Also, this mc will be dupliacted many times (with a different name of course). All in all there will be unlimited links using around 20 of the above mc’s loading in the info from seperate text files!

If you visit my site - site

You can see what I am trying to setup - although the links in this version are just normal buttons!

Hope this is clear!

Thanks

Kev

Well I think the best way to do that would be to use a database, because a text file isn’t that dynamic. Meaning that if multiple people press the link at the same time then it will not take effect…

My suggestion:

Set up a database using your Control Panel for your website. Add a user to the database (again using the CP) I’m not sure how to do this… each host has a different method.

Then I am not really sure where to go. I owuld have to think about and I would actually have to see your file. My guess would be that when you press a button you would send out variables to a PHP script and then the PHP script would read which button you pressed and then update the database for that button accordingly.

I mean that is the theory…

I’m heading out now, I won’t be able to do any work for a couple of days. School and clients are taking up all of my free time. Any other time is spent here… :frowning: Oh well… try out some of those files that are in that link. Search around and you should be able to figure out how to send the variables from flash to the PHP script and then all you need to do is update the database with a simple query, but that is also included in those files… minor adjustments…

cheers (good luck),
Jubs :hair:

Ok thanks Jubba - I have set up my database (well in fact all you do is create one give it a name and access privileges ans let the php do the rest!) I’ll have a good old try at this over the next few days! I’ll post my results here then!

If I get this working, maybe it would be good to create a tut for this!

Take care

kev

Hi Jubba, I am having trouble!

The script works well, but it seems i have to enter each link into the database manually for it to work! Beacuse my links to the site are loaded in from a .txt file, this means i have to edit two files - the .txt file and the database! -

Want i want is to just add a new link into one file and have it all update it self! maybe i will have to look at loading the link.txt file through php somehow or directly into the database! but I have no idea where to start!

if you got any ideas let me know!

Just noticed this post - http://www.kirupaforum.com/showthread.php?s=&threadid=10150&highlight=send+variables+to+php

Could the same thing work for me?

Thanks

kev