Scoutnet vzw

We connect scouts!
Het is momenteel 28 Mrt 2024 16:12

Alle tijden zijn UTC + 1 uur




Plaats een nieuw onderwerp Reageren op dit onderwerp  [ 1 bericht ] 
Auteur Bericht
BerichtGeplaatst: 30 Sep 2008 16:02 
Offline
 
 

Geregistreerd: 02 Sep 2008 20:36
Berichten: 17
Woonplaats: La Hulpe
Hi everybody

The idea is the following :
When an alias address mail (ZZZ@MYDOMAIN.be) receives an email, it launches automatically a PHP script wich makes it possible to spare the rough message by finding the headings and the content and to store all this inframtion in a mySQL database.

With the help of scounet, we could make so that alias (ZZZ@MYDOMAIN.be), instead of forwarding towards another email address, opens a PHP script placed at the root.
e.g. : /spinternet.be/users/MYDOMAIN/public_html/script.php (Thanks Jooris)

I would like to open the mail I receive trough my script "script.php" (placed where you know)

This is the code
"
<?php

// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);

require("connect.php");
// Just to open correctly the mySQL databases

$sql = "INSERT INTO mails (Contenu)
VALUES ('$email')";
// we put information into field text 'Contenu' of a base 'mails'
mysql_query($sql) or die('Erreur SQL!'.$sql.'<br>'.mysql_error());

?>
"

As you can see, I try to open (via the fopen command) the file
"php://stdin"... and to put it into a variable.
I can check that the reception of a mail launches well the script "script.php"
but it doens't work... In fact, the script cannot open the file "php://stdin"... I guess it doesn't find it !
So my question is :
Are there the correct path and the correct name ?

Thx for your help !

Sahi

_________________
lh661.be & saintnicolaslahulpe.org Webmaster
Staff d'Unité GCB 16èBW - St-Exupéry


Omhoog
 Profiel  
 
Berichten weergeven van de afgelopen:  Sorteer op  
Plaats een nieuw onderwerp Reageren op dit onderwerp  [ 1 bericht ] 

Alle tijden zijn UTC + 1 uur


Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers en 9 gasten


U mag geen nieuwe onderwerpen plaatsen in dit forum
U mag geen reacties plaatsen op onderwerpen in dit forum
U mag uw berichten niet wijzigen in dit forum
U mag uw berichten niet verwijderen in dit forum
U mag geen bijlagen plaatsen in dit forum

Zoeken naar:
Ga naar:  
Powered by phpBB® Forum Software © phpBB Group
Vertaald door phpBBservice.nl.