Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-11-2004, 10:08 PM   #1
atomskreymx
Registered User
 
atomskreymx's Avatar
 
Join Date: Oct 2004
Posts: 16
Default how to link Action Script to a remote PHP

Hello.

I had a trouble to use some PHP script in a free server, and because of that I set up a PHP server in my personal computer to test the php script. It worked, and because of that I wonder if I can host my site in a free server, but link my flash document to the working PHP script that I have hosted in my computer.

The PHP is a send mail. I have a SWF file that receives 3 variables, send to the PHP and then the PHP sends it by email to my address.

The working version of those files is hosted in:

http://200.77.161.60/mail/email.swf

What I want is to put the email.swf file in another webhost and that my action script only use the PHP file hosted in http://200.77.161.60/mail/email.php

The action script that haves the reference to the PHP is:

//send form function
function enviarMail() {
envio_lv.asunto = asunto_txt.text;
envio_lv.email = email_txt.text;
envio_lv.cuerpo = cuerpo_txt.text;
envio_lv.sendAndLoad("email.php", recibir_lv, "POST");
}

What I tried is to modify it to make a reference for the working PHP so I did this

function enviarMail() {
envio_lv.asunto = asunto_txt.text;
envio_lv.email = email_txt.text;
envio_lv.cuerpo = cuerpo_txt.text;
envio_lv.sendAndLoad("http://200.77.161.60/mail/email.php", recibir_lv, "POST");
}

But it doesn’t work. Can someone help me with this, please? Thanks in advance.
atomskreymx is offline   Reply With Quote
Old 11-13-2004, 05:48 AM   #2
Dark_Element
Lolen
 
Dark_Element's Avatar
 
Join Date: Aug 2004
Location: Australia->Gold Coast
Posts: 413
Default

.... i'd say its that your host has safe mode turned on or disabled the mail(); function... or simply your code works only for the version of PHP that you have on your computer and not your host.

if you have any of the following hosts its ur host's problem:
-Host ultra
-100 Webspace

anything else i'd suggest you consult your good'ol phpinfo(); function

Also if the swf file and the php file are on two different domains you need a cross domain policy file (consult your AS manual)
Dark_Element is offline   Reply With Quote
Old 11-16-2004, 06:01 AM   #3
ibizconsultants
Registered User
 
Join Date: Aug 2004
Posts: 24
Default

Hi there,

Correct this

function enviarMail() {
envio_lv.asunto = asunto_txt.text;
envio_lv.email = email_txt.text;
envio_lv.cuerpo = cuerpo_txt.text;
envio_lv.sendAndLoad("http://200.77.161.60/mail/email.php", recibir_lv, "POST");
}

TO

function enviarMail() {
var envio_lv as LoadVars;
envio_lv.asunto = asunto_txt.text;
envio_lv.email = email_txt.text;
envio_lv.cuerpo = cuerpo_txt.text;
envio_lv.sendAndLoad("http://200.77.161.60/mail/email.php", recibir_lv, "POST");
}

Further, going by what Dark_Element suggested which could be true. Why dont you write a small PHP script to send you a test mail. This way you will understand whether or not its a problem with the server or its a problem with your SWF not passing the variables to your PHP Script.

Hope this helps.
ibizconsultants is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:44 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.