2Youth
02-02-2005, 08:39 PM
Hi everyone,
I am a new member in the forum but I have been using the archives a lot to find answers... But now I cannot find a good solution for this.
I am using sendAndLoad to send a question to php which queries a database and returns a string variable to flash (eg. echo "&my_var=".$my_var). This works fine in IE explorer but (as it is known) is very glitchy in Mozilla/Netscape/Safari.
I have tried using sendAndLoad specifying "POST", and "GET", with the same results: In Mozilla Firefox, and an older Mozilla (build ID 2005011116) the variables are sent and returned only the first time the browser is opened, or if the browser cache is cleared mmanually. On subsequent reloads, not only is the variable not recieved, but my whole flash movie seems to freeze up so I cant even print an error message.
I also tried not specifying the method at all ( eg. my_sentvar.sendAndLoad("myphpform.php", my_returnedvar) ) and, since I have heard that some browsers will default the method to "GET" and others to "POST", I included an if statement in my php when requesting the variable:
$question = $_POST['question'];
if(!$question){$question = $_GET['question'];}
not sure if this is a total noob thing to do, but it gives me interesting results:
In Mozilla Firefox, my variables are successfully sent and loaded approx. 6 out of 7 times ( the other time it freezes, and just says "waiting for www.whatever.com"). However, in the older version of Mozilla (which I think is similar to Safari), I still only get results the first time the browser is loaded.
Sorry for the long-winded explanation, without posting any code, but I am pretty sure this is a browser compatibility or caching problem. I have tried sending a Math.random() dummy var with my data (doesnt work), and have tried both "GET and "POST" (doesnt work).
Does anyone know a good fix for this? maybe a header to tell php what kind of data to expect (noob?!) or a header to prevent caching, or something, anything?
Thanx in advance,
2Youth
ps. I will post my code if it will help...
I am a new member in the forum but I have been using the archives a lot to find answers... But now I cannot find a good solution for this.
I am using sendAndLoad to send a question to php which queries a database and returns a string variable to flash (eg. echo "&my_var=".$my_var). This works fine in IE explorer but (as it is known) is very glitchy in Mozilla/Netscape/Safari.
I have tried using sendAndLoad specifying "POST", and "GET", with the same results: In Mozilla Firefox, and an older Mozilla (build ID 2005011116) the variables are sent and returned only the first time the browser is opened, or if the browser cache is cleared mmanually. On subsequent reloads, not only is the variable not recieved, but my whole flash movie seems to freeze up so I cant even print an error message.
I also tried not specifying the method at all ( eg. my_sentvar.sendAndLoad("myphpform.php", my_returnedvar) ) and, since I have heard that some browsers will default the method to "GET" and others to "POST", I included an if statement in my php when requesting the variable:
$question = $_POST['question'];
if(!$question){$question = $_GET['question'];}
not sure if this is a total noob thing to do, but it gives me interesting results:
In Mozilla Firefox, my variables are successfully sent and loaded approx. 6 out of 7 times ( the other time it freezes, and just says "waiting for www.whatever.com"). However, in the older version of Mozilla (which I think is similar to Safari), I still only get results the first time the browser is loaded.
Sorry for the long-winded explanation, without posting any code, but I am pretty sure this is a browser compatibility or caching problem. I have tried sending a Math.random() dummy var with my data (doesnt work), and have tried both "GET and "POST" (doesnt work).
Does anyone know a good fix for this? maybe a header to tell php what kind of data to expect (noob?!) or a header to prevent caching, or something, anything?
Thanx in advance,
2Youth
ps. I will post my code if it will help...