-
PHP/flash issue
I have built a form in flash which points at a php file and places the info in an mysql database on my site. When testing on my server it all works nicely.
However when the swf collecting the info was placed on the clients server it no longer fed the info into the database....
The code on the submit button in the swf is pointing at the php script on my server (which is php enabled) but sitting on the clients server(which is not PHP enabled).
What I'm trying to find out is if it makes any diference in this instance that they are not enabled for php - since the php script is actually on my server?
All that is happening is the client server is firing off data collected by the swf at a PHP file - not actually processing it
Or if there is any way round this. The client server does have some server side processing capacity... just not php!!!
Apologies if I'm being naive - but have had to go to pop up HTML forms to collect the data and they don't look anywhere near as good as my flash form did!
Any help appreciated
Thanks
m
ps here is the code on the submit button
on (release){
if (checkboxfemale.selected == true) {
Gender = "Female";
}
if (checkboxmale.selected == true) {
Gender = "Male";
}
if ((!Email.length || Email.indexOf("@") == -1) || Email.indexOf(".") == -1) {
EmailStatus = "Please enter a valid E-mail address";
} else if (!FirstName.length) {
EmailStatus = "Please enter your first name before sending";
} else if (!SurName.length) {
EmailStatus = "Please enter your surname before sending";
} else {
loadVariablesNum("http://www.markwaterfield.com/MailPHP10c.php", "0","Get");
EmailStatus = "Sending... ";
}
}
-
Senior Member
Usually, the PHP code will reference to a local database, you may be able to bypass it by contacting your client server administrator and asking for a direct link to their mySQL database.
-
Thanks for getting back so quickly.
The client hasn't got the mysql database - I was going to collect their data for them in my mysql database. However, as I say, with the swf sitting on their server and the PHP script on mine, the info doesn't get their - even though I have an absolute link to the php file on my server...
-
Senior Member
Well, in that instance you could try to trick the file, by which I mean put the .swf file on your server, and reference it in an absolute link from their server.
See if that helps out.
-
Nice idea - I like your style!
-
Senior Member
Flash can be tricky, so one much trick it back, LOL.
-
Flashmatics
to reference a php file on another server you need to put a cross-domain file policy (named crossdomain.xml) in place on your php server for e.g place the corssdomain.xml file in the root of your server and it should have the following:
Code:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.domainwithyourflashfile.com" />
</cross-domain-policy>
-
So in order to to reference the php file on my server they would have to place the cross domain xml file in the root of their server, right? And it doesn't matter that their server isn't PHP enabled?
btw thanks for the help
-
Senior Member
I"m not sure about that stuff, but I think it would need to go on your server with the PHP file, and then the swf could sit on your client's server.
-
Flashmatics
yep!! you need to place it on the server where the php file sits..not where the flash file sits...
-
Thanks I will give it a go...
BTW
can you list multiple domains in the file?
m
-
seems to work
seems to work
thanks for all the help
m
-
Flashmatics
no problem!! yes u can specify mutilple domains:
Code:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.domainwithyourflashfile.com" />
<allow-access-from domain="www.anotherdomain.com" />
</cross-domain-policy>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|