473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

(BELLmailer.php) PHP inside TPL

I am using BELLMailer.php inside my tpl file, when the page called the BELLMailer.php loads inside my tpl file, but after filling the mailer form and submiting the form the BELLMailer doesnt work and do not shows possible Error messages or success mesage.
BELLmailer.php >> http://www.bellonline.co.uk/web-serv...mailer-script/
Sep 21 '06 #1
2 3378
ronverdonk
4,258 Expert 4TB
You gotta give us some clue as to what it does not do! Did you set any traces on or breaks and did you dump any variables? And what was the result?

A statement like 'it does not work' is not very helpful to anyone who wants to look into it. At least show the tpl code you use, the config file and any other changes you made to that package.

Ronald :cool:
Sep 21 '06 #2
my support.tpl code is:
{include file="header.tpl"}
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr> <td width="10" align="center" valign="top"></td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#EFEFD5"><span class="signupText"><b>Support</b></span></td>
</tr>
<tr><td><div align="justify"><span class="signupText"><br>
If you have any questions or comments, please do not hesitate to contact us. Before sending a message, please review the </span><a href="?a=cust&page=faq" class="linkM"><strong>F.A.Q</strong></a><span class="signupText"> page. Many common questions are answered there. Your inquiry will be received and immediately proceeded. You will receive the answer during 24 hours.</span></div></td>
</tr>
<tr>
<td>{php}include("http://www.fxeasy.biz/BELLmailer.php");{/php}</td>
</tr>
</table>
</td>
<td width="10" align="center" valign="top"></td>
<td width="180" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">{if $userinfo.logged != 1} {include file=login_box.tpl}
{/if} </td>
</tr>
<tr>
<td height="1"></td>
</tr>
<tr>
<td>{include file=news_box.tpl}</td>
</tr>
</table></td>
</tr>
</table>
{include file="footer.tpl"}
---------------------------------------------------------------------
the BELLmail.php contains :

<?php
extract($_POST);

if (!file_exists("config.php"))
{
$host = $_SERVER[HTTP_HOST ];
$path = pathinfo($_SERVER['PHP_SELF']);
$file_path = $path['dirname'];
print "<h1>BELLonline PHP mailer script</h1>
<h2>There is a problem with your PHP mailer script installation</h2>
<p>The config.php file seems to be missing!</p>
<p>For this script to work, you need to upload the config.php file that came with the download of the BELLonline <a href=\"http://www.bellonline.co.uk/web-services/free/scripts/php-mailer-script/\">PHP mailer script</a>.</p>
<p>The file must be in the following directory of your website:</p>
<p>$host<span style=\"font-weight: bold; font-size: 150%;\">$file_path/</span></p>
<p>If you need help installing the script, then feel free to email me at <a href=\"&#x6d;&#x61;ilt&#x6f;:&#x67;&#x61;v&#x69;n@ b&#x65;&#x6c;&#x6c;&#x6f;n&#x6c;ine.&#x63;o.&#x75; &#x6b;\">&#x67;&#x61;v&#x69;n@b&#x65;&#x6c;&#x6c;& #x6f;n&#x6c;ine.&#x63;o.&#x75;&#x6b;</a></p>";
exit;}
include "config.php";
if ($sendto_email == "changeme@example.com")
{print "<h1>BELLonline PHP mailer script</h1>
<h2>Installation nearly complete!</h2>
<p>Thank you for downloading the <a href=\"http://www.bellonline.co.uk/web-services/free/scripts/php-mailer-script/\" title=\"free PHP mailer script\">free PHP mailer script</a> from <a href=\"http://www.bellonline.co.uk\">BELLonline web services</a>. </p>
<p>To start using the script, open config.php in a text editor and change the <b>$sendto_email</b> variable to your email address.</p>
<p>If you did not get a config.php file with this script, then go to the <a href=\"http://www.bellonline.co.uk/web-services/free/scripts/php-mailer-script/\">PHP mailer script page</a> and download the full script.</p>
<p>If you need help installing the script, then feel free to email me at <a href=\"&#x6d;&#x61;ilt&#x6f;:&#x67;&#x61;v&#x69;n@ b&#x65;&#x6c;&#x6c;&#x6f;n&#x6c;ine.&#x63;o.&#x75; &#x6b;\">&#x67;&#x61;v&#x69;n@b&#x65;&#x6c;&#x6c;& #x6f;n&#x6c;ine.&#x63;o.&#x75;&#x6b;</a></p>";
exit;}
if (empty ($senders_name))
{$error = "1";
$info_error .= $lang_noname . "<br>"; }
if (empty ($senders_email))
{$error = "1";
$info_error .= $lang_noemail . "<br>"; }
if (empty ($mail_subject))
{$error = "1";
$info_error .= $lang_nosubject . "<br>";}
if (empty ($mail_message))
{$error = "1";
$info_error .= $lang_nomessage . "<br>";}
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $senders_email))
{$error = "1";
$info_error .= $lang_invalidemail . "<br>";}
if ($showlink != "no")
{$link = "<br><span style=\"font-size: 10px;\">Powered by <a href=\"http://www.bellonline.co.uk/web-services/free/scripts/php-mailer-script/\" title=\"free PHP mailer script\">BELLonline PHP mailer script</a></span>";}
if ($error == "1")
{$info_notice = "<span style=\"color: " . $error_colour . "; font-weight: bold;\">" . $lang_error . "</span><br>";
if (empty ($submit))
{$info_error = "";
$info_notice = $lang_notice;}
function Random()
{$chars = "ABCDEFGHJKLMNPQRSTUVWZYZ23456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 4)
{$num = rand() % 32;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;}
return $pass;}
$random_code = Random();
$mail_message = stripslashes($mail_message);

print "<form name=\"BELLonline_email\" method=\"post\" style=\"margin: 0;\" action=\"\">
<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"$title_align\" valign=\"top\">
<td colspan=\"2\">&nbsp;</td>
</tr>
<tr align=\"left\" valign=\"top\">
<td colspan=\"2\"><span class=\"signupText\">$info_notice$info_error</span></td>
</tr>
<tr valign=\"top\">
<td align=\"left\" style=\"$form_css\"><span class=\"signupText\">$lang_name</span></td>
<td align=\"left\"><input name=\"senders_name\" type=\"text\" class=\"inpts\" id=\"senders_name\" style=\"width: $input_width;\" value=\"$senders_name\" maxlength=\"32\"></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"left\"><span class=\"signupText\">$lang_youremail</span></td>
<td align=\"left\"><input name=\"senders_email\" type=\"text\" class=\"inpts\" id=\"senders_email\" style=\"width: $input_width;\" value=\"$senders_email\" maxlength=\"64\"></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"left\"><span class=\"signupText\">$lang_subject</span></td>
<td align=\"left\">
<select name=\"mail_subject\" class=\"inpts\" id=\"mail_subject\" style=\"width: $input_width;\">
<option value=\"NoSubject\">--Select--</option>
<option value=\"GeneralEnquiry\">General Enquiry</option>
<option value=\"PaymentProblem\">Payment Problem</option>
<option value=\"changeE-goldNumber\">change E-gold Number</option>
<option value=\"changeEmailAddress\">change Email Address</option>
<option value=\"TechnicalSupport\">Technical Support</option>
<option value=\"ForumSupport\">Forum Support</option>
</select>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"left\"><span class=\"signupText\">$lang_message</span></td>
<td align=\"left\"><textarea name=\"mail_message\" cols=\"36\" rows=\"5\" style=\"width: $input_width;\" class=\"inpts\">$mail_message</textarea></td>
</tr>
<tr valign=\"top\">
<td>&nbsp;</td>
<td colspan=\"2\" align=\"left\"><input name=\"randomness\" type=\"hidden\" id=\"randomness\" value=\"$random_code\">
<input name=\"submit\" type=\"submit\" id=\"submit\" value=\"$lang_submit\" class=\"sbmt\"></td>
</tr>
</table>
</form>";}else
{$info_notice = $lang_sent;
$mail_message = stripslashes($mail_message);
$headers = "From: $senders_name <$senders_email> \r\n";
$headers .= "X-Mailer: BELLonline.co.uk PHP mailer \r\n";
mail($sendto_email, $mail_subject, $mail_message, $headers);
print " <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
<tr align=\"$title_align\" valign=\"top\">
<td colspan=\"2\"><span class=\"signupText\"><b>$info_notice</b></span></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"right\"><span class=\"signupText\">$lang_name</span></td>
<td align=\"left\"><span class=\"signupText\"><b>$senders_name</b></span></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"right\"><span class=\"signupText\">$lang_youremail</span></td>
<td align=\"left\"><span class=\"signupText\"><b>$senders_email</b></span></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"right\"><span class=\"signupText\">$lang_subject</span></td>
<td align=\"left\"><span class=\"signupText\"><b>$mail_subject</b></span></td>
</tr>
<tr valign=\"top\">
<td width=\"100\" align=\"right\"><span class=\"signupText\">$lang_message</span></td>
<td align=\"left\"><span class=\"signupText\"><b>$mail_message</b></span></td>
</tr>
</table>";
}
print $link;
?>
--------------------------------------------------------------------------
the config.php contains:

<?php
$sendto_email = "admin@fxeasy.biz";
$lang_title = "Send us an email:";
$lang_notice = "Fill in the form to contact us by email. All fields are required";
$lang_name = "Your name:";
$lang_youremail = "Your email:";
$lang_subject = "Subject:";
$lang_message = "Message";
$lang_confirmation = "Enter Code:";
$lang_submit = "Send email";
$lang_error = "Your email has not been sent, the following errors were found:";
$lang_noname = "You did not enter your name";
$lang_noemail = "You did not enter your email address";
$lang_nosubject = "You did not enter a subject";
$lang_nomessage = "You did not enter a message";
$lang_nocode = "You did not the validation code";
$lang_wrongcode = "You entered the validation code incorrectly. Please note that it is case sensitive";
$lang_invalidemail = "The email address that you entered appears to be invalid";
$lang_sent = "Your email has been sent. The following message was submitted:";
$input_width = "300px";
$title_align = "left"; // Can be left, center or right
$title_css = "font-weight: bold; font-size: 11px; font-family: Geneva, Arial, Helvetica, sans-serif; color: #000000;";

$form_css = "font-size: 10px;";
$error_colour = "red"; // Must use HTML compatible colour
$showlink = "yes";
?>
Sep 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Rainmaker | last post by:
Greetings, I have not been able to find the documentation that will allow me to insert php code inside the html code in the $message block in the mail() function. Using the example in the help...
13
by: Robert Smith | last post by:
I'm doing a website development course and during an exercise my teacher gave me to do at home I was confronted with errors. Surprisingly, those that did the exercise in class did not receive...
3
by: 99m | last post by:
Can anyone recommend to me a thin PHP framework? By thin, I mean that I don't want a massive amount of code, dependencies, or large learning curve. I'm also not thrilled about introducing XSLT into...
17
by: ~john | last post by:
As the installation txt suggests, I have left my php.ini file inside the c:\php directory... but running phpinfo() shows that my php.ini file is in c:\windows as shown below. Configuration File...
2
by: Sarel | last post by:
Hi All, I'd like to know whether it is possible to use inline assembly code inside PHP? Remember good old Turbo Pascal 7, one could write Assembly language inside it if you have a function that...
1
by: sami | last post by:
Hi Is it possible to print the output of a Python script inside PHP? e.g. I have a python script that has the contens: pyScript.py: #!/usr/bin/python print "hello world"
4
by: Daniel | last post by:
is there a way to detect if a user tries to access a php file? For instance, db.config.php is called in many php pages but should never actually be open directly. Is there a way to know if...
3
by: leonardodiserpierodavinci | last post by:
Hi. Sorry for what is perhaps a neophyte question: is it possible to pass a variable to a PHP script from inside another PHP piece of code? For instance, the file test.php (which of course...
2
by: lynx129 | last post by:
Hi there , I have php script that works fine under my server but I dont know how to put the html code inside my site. feedback.html <html dir="rtl"> <head> <title> ????? ??? </title>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.