caio
ho uno script che mi deve mandare x email alla gente un certo testo:
il mio problema e' che nell'email non mi passa il $self_url, dichiarato nel file vars.php ( incluso include($DOCUMENT_ROOT . '/vars.php'); all'inizio di questo file)Codice PHP:
{
srand((double)microtime()*1000000);
$ac = rand(1000, 10000);
$name = trim($name);
$email = trim($email1);
$sitename = trim($sitename);
$name = addslashes($name);
$sitename = addslashes($sitename);
$res = mysql_query("select value from adminprops where field='inibon'");
$inibon = mysql_result($res, 0, "value");
if (!isset($ref) || !is_numeric($ref)) {$ref=0;}
$date = date("Y-m-d H:i:s");
$res = mysql_query("insert into user (name, email, passwd, ref, acctype, credits, joindate, minmax, lastaccess, ac) values ('$name', '$email', '$passwd', $ref, 1, $inibon, '$date', 1, '$date', $ac)");
$usrid = mysql_insert_id();
$res = mysql_query("insert into site (usrid, name, url, lang, state, credits) values ($usrid, '$sitename', '$url', '$lang', 'Waiting', 0)");
$surpres = mysql_query("update adminprops set value=value-$inibon where field='surplu'");
$res = mysql_query("select value from admin where field='email'");
$admail = mysql_result($res, 0, "value");
mail($email, "Grazie per esserti registrato a $title!", "$name, grazie per la registrazione!\n\n Il tuo $title login è: $email\nLa tua $title password è: $passwd\n\nPer attivare il tuo account devi aprire questo link:\n[B]$self_url[/B]" . "activate.php?ac=$ac&i=$usrid\nCliccalo o fai copia-incolla nel tuo browser.\n\nIl tuo refer link è:\nhttp://$siteurl?ref=$usrid\nRiceverai 0.1 crediti ogni volta che il tuo affiliato vedrà un sito!\n\n$title Admin\nhttp://$siteurl/\n$admail", "From: \"$title Admin\" <$admail>");
echo("<p align=center class=\"big\">Grazie per la registrazione!</p>");
echo("<p align=center>Il link di attivazione è stato spedito a $email.</p>");
}
ho notato che non mi passa anche altre variabili (dichiarate nel file $adminmail e altra...)
che devo mettere a posto?