Julia
01-27-2005, 04:53 PM
Day 1 in starting to learn to integrate Flash and PHP so starting with the tutorial 89: Introduction to Flash and PHP.
Have eventually managed to get the php elements installed on my machine (PC running XP) and working despite the best efforts of my firewall to put a stop to that and now turn back to the tutorial looking forward to making progress.....
I have the flash file with an input box, instance years and a button instance myBtn as requested and this code on the first frame. I am working in MX.
//=================================
// INIT
//=================================
path = "../php/"; //declare path to php files
lvOut = new LoadVars(); //create lv object
//=================================
// BTN CODE
//=================================
myBtn.onRelease = function(){
//assign user-input value to lv property called years
lvOut.years = years.text;
//send to a blank window
lvOut.send(path + "dogyears.php","_blank");
};
I also have a dogyears.php in a separate directory called php with this code:
<?
$calculation= $_POST['years']*7;
echo $calculation;
?>
Now when I go via localhost you are supposed to input a number in the box in Flash and on pressing the button you get another html window generated displaying that number multiplied by 7.
However, instead I get the Error Message 405:
Method Not Allowed
The requested method POST is not allowed for the URL /public/htdocs/nwjv/php/dogyears.php.
Can anyone throw some light on where I am going wrong? I have been through the tutorial a number of times and am sure that I am following the same methods!! Please accept apologies if this is very simple and stupid- this is day 1!!!
Have eventually managed to get the php elements installed on my machine (PC running XP) and working despite the best efforts of my firewall to put a stop to that and now turn back to the tutorial looking forward to making progress.....
I have the flash file with an input box, instance years and a button instance myBtn as requested and this code on the first frame. I am working in MX.
//=================================
// INIT
//=================================
path = "../php/"; //declare path to php files
lvOut = new LoadVars(); //create lv object
//=================================
// BTN CODE
//=================================
myBtn.onRelease = function(){
//assign user-input value to lv property called years
lvOut.years = years.text;
//send to a blank window
lvOut.send(path + "dogyears.php","_blank");
};
I also have a dogyears.php in a separate directory called php with this code:
<?
$calculation= $_POST['years']*7;
echo $calculation;
?>
Now when I go via localhost you are supposed to input a number in the box in Flash and on pressing the button you get another html window generated displaying that number multiplied by 7.
However, instead I get the Error Message 405:
Method Not Allowed
The requested method POST is not allowed for the URL /public/htdocs/nwjv/php/dogyears.php.
Can anyone throw some light on where I am going wrong? I have been through the tutorial a number of times and am sure that I am following the same methods!! Please accept apologies if this is very simple and stupid- this is day 1!!!