introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.
-->

PHP does't work with AS3



Posted by: maxx48
February 23, 2010 11:05AM
When I try to send a form using Flash and AS3, PHP sender doesn't work. Of course it works when I use a webhosting server. Can anybody help me?
Posted by: Thierry
February 23, 2010 11:07PM
"doesn't work" does not mean something. Give code example and errors.
Posted by: maxx48
February 24, 2010 08:44AM
My sender PHP code:

<?php
...
...

if(@mail($to, $subject, $message, $headers))
{
echo "Done";
}
else
{
echo "Not sent";
}
?>

It returns "Not sent" to the form dialog and the form is of course not sent. However It works properly from a website with PHP.
The simple code:

<?php
...
...
mail($to, $subject, $message, $headers);
?>

does not send anything.
It happens using an AS form or a PHP form.
Posted by: Amour
February 24, 2010 09:37AM
Which SMTP did you used into php.ini ?

You must set it ;)
Posted by: maxx48
February 25, 2010 04:28PM
Here is my php.ini:
...
[mail function]
; For Win32 only.
; [php.net]
SMTP = mail.nogueras.cat
; [php.net]
smtp_port = 25
...

I just have tried to send directly an e-mail from a PHP sender and it returns this error:

Warning: mail() [function.mail]: SMTP server response: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) in K:\Documents\Web\Practica\sendmail1.php on line 10

The sendmail1.php code:
<?php

$to="maxx4848@gmail.com";
$subject="Formulario de contacto";
$message="Esto es una prueba a ver si funciona el PHP directamente";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: Des de EasyPHP" . "\r\n";

mail($to, $subject, $message, $headers);

?>
Posted by: Amour
February 25, 2010 07:22PM
Maybe the SMTP need an authentification ?

With a classical email client, as Outlook or Thunderbird, that SMTP need any authentification ?
Posted by: maxx48
February 26, 2010 06:56PM
The authentification is set in AUTH LOGIN
Posted by: Amour
February 26, 2010 08:00PM
I don't understand... where is that AUTH LOGIN ?
Posted by: maxx48
February 27, 2010 09:29AM
I will ask to my provider for the warning message. Maybe it is their fault. I will post again a message when I have an answer.
Thanks a lot.
Posted by: maxx48
March 08, 2010 06:46PM
Finaly I have edited the httpd.conf file so:

...
Listen 127.0.0.1:90
...
...
ServerName localhost:90
...

It seems that it was a trouble with port 80. I don't know if it is right, but it works now fine.

Thanks a lot.
Posted by: Amour
March 08, 2010 06:47PM
Maybe another software that use 80 port ?

You can check that with TCPView ;)
Posted by: maxx48
March 08, 2010 07:10PM
No software using port 80 according to TCPView. Apache returned an error unless I closed inetinfo.exe. But then the "mail" function didn't work.
Posted by: Thierry
March 08, 2010 07:13PM
> Apache returned an error unless I closed inetinfo.exe

inetinfo is an http server ! TCPView should viex it...

Change Apache port to make cohabitation.
Posted by: China
May 12, 2010 05:12AM
actionscript 3 code:
var url:URLRequest = new URLRequest("[localhost];);


/////test.php code//////

$flashData = $_POST['message'];
echo "this is flash say:$flashData";
mysql_connect("localhost","root","root");
mysql_select_db("flashphp");
$query="INSERT INTO xml (id, ch) VALUES (NULL, 'three')";
mysql_query($query) or die("not insert into xml");

/////////you should insert the $_POST data into database.OK///////////////


also

firefox URL with: [localhost] or [localhost]


httpd.conf
#Listen 12.34.56.78:80
Listen 80