Janice Posted September 11, 2006 Share Posted September 11, 2006 I am very glad to be a member in this forum. I hope I would find a solution for my need here :)I know nothing about flash, so please dont mistake me if this is a dumb question :)Well I have a flash template. I use a link there for signup (signup.php)It opens to a new page - http://sitename.com/signup.php.Signup form contains details like -username :state:country: ....these details are sent to my mail when someone signup. What I need is.. I wish to add a referral system. Something like http://sitename.com/?ref=*somenumbers*So when someone uses this referral URL and click the signup link, I need this option in signup form Referrerd by *123* and this referral detail asusual sent to my email when someone signup along with the signup form details (name, state, country ... and Referred by *123*)I dont want to use database here because I am not sure how to handle databases. The index flash page I will use is index.phpI would be reallllllllll flad if someone help me with this with a detailed code.Advance thanks...Janice Link to comment Share on other sites More sharing options...
reportingsjr Posted September 11, 2006 Share Posted September 11, 2006 if(isset($_GET['ref'])){//do whatever to add the referal to registering} Link to comment Share on other sites More sharing options...
justsomeguy Posted September 12, 2006 Share Posted September 12, 2006 You will need access to the Flash source file of the form, that would be the .fla file, not just the .swf file. The swf gets exported from the fla. You will need to edit the fla to get the referer ID from the querystring and add it to the data that gets sent to your PHP page.I'm not sure how much you know about Flash, but pretty much everything is considered a movie. In order to get Flash to send variables to your PHP page, the way you have to do it is to create a new movie clip, and assign all of the data as properties of the movie clip. The actionscript to do that looks something like this: this.createEmptyMovieClip("dataSubmit",1);dataSubmit.username = "..."; // ("name" is a Flash keyword, so you can't use that I don't think)dataSubmit.state = "...";dataSubmit.country = "..."; You will have to get the ref from the URL and parse it yourself. This code will work if there is only 1 variable in the querystring (ref, and nothing else), or if ref is the last variable in the URL: myURL = this._url;myPos = myURL.lastIndexOf("?");myParam = myURL.substring(myPos,myURL.length - 1);myPos = myParam.lastIndexOf("=");ref = myParam.substring(myPos,myParam.length - 1); And then you add ref to the data submitting movie clip and use loadVariables to submit it: dataSubmit.ref = ref;dataSubmit.loadVariables("http://yoursite.com/submit.php", "POST"); On the PHP page, you get the value of ref out of $_POST the same way you get everything else. Link to comment Share on other sites More sharing options...
Janice Posted September 12, 2006 Author Share Posted September 12, 2006 Thanks much for your reply. I bought this flash template Readymade. They gave me the .fla file too though.I dunno much about flash. Since it is a readymade template, I can edit the content of the flash template. I didnt know I have to edit flash source file to get this action to be done. The output is a single flash page (index.html or php) and I have added a link in that flash page that goes to signup.php (which is not a flash page and it is a different HTML page, no relation between index flash page and signup form page)So, no other way I can add a ref like I said before other than this? CODEif(isset($_GET['ref'])){//do whatever to add the referal to registering}I dont know this. I would be very happy if you give me more details. Where and how to add this code? Link to comment Share on other sites More sharing options...
reportingsjr Posted September 12, 2006 Share Posted September 12, 2006 Oh yes, forgot about the flash part. I sent janice an email, so she may need more help with the flash.. Good luck with that here! Link to comment Share on other sites More sharing options...
justsomeguy Posted September 12, 2006 Share Posted September 12, 2006 If you don't have the Flash software installed to edit the FLA, you can send me a PM and I'll give you an email address to send the FLA to and I'll make the change for you, it's not really a big deal and I have the software installed. Link to comment Share on other sites More sharing options...
Janice Posted September 15, 2006 Author Share Posted September 15, 2006 Thanks alot for your timely help justsomeguy. Hard to find people who help alot :)Cheers! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now