Is there a problem with ereg_replace, as to where it doesn't like doing replacements of a variable more than once, or on one line? I have the following code;
The template file contains this line;
<a href="signup.php?action=email_new&email=:::email:::&username=:::username:::&password=::
assword:::">
The output of the template reading this line, is the same (i.e no changed tags)
Any tags above it, change fine :-/
Anyone got any ideas?
Cheers
Andy
Code:
global $email_user_signup, $admin_email;
if ($email_user_signup) {
$subject = "Advert Addition...";
$message = "Someone has just add a new advert. The details are; \n\nUsername:$_username\n\nPassword:$_password\n\n\n\nEmail: $_email\n\n\n\nDescription: $_description\n\nTitle: $_title\n\nURL: $_url\n\nIf there is anything you don't think is reight here, please be sure to go in via the admin panel, and do a search for this advert, and edit/delete it as is appropriate...";
mail("$admin_email", $subject, $message,
"From: $admin_email\r\n"
."Reply-To: $admin_email\r\n");
}
$input = file("user-signup-done.html");
// now print line by line, changing tags we need from thsere...
foreach ($input as $line) {
$line = ereg_replace(":::email:::", $_email , $line);
$line = ereg_replace(":::url:::", $_url , $line);
$line = ereg_replace(":::title:::" , $_title , $line);
$line = ereg_replace(":::description:::", $_description , $line);
$line = ereg_replace(":::username:::", $_username , $line);
$line = ereg_replace(":::password:::", $_password , $line);
echo $line;
}
The template file contains this line;
<a href="signup.php?action=email_new&email=:::email:::&username=:::username:::&password=::
The output of the template reading this line, is the same (i.e no changed tags)
Any tags above it, change fine :-/
Anyone got any ideas?
Cheers
Andy