Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

HELP with <br> as newline.

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

nicedomain4sale

Account Closed
Impact
2
PHP:
<?php
								
$maxSize="500";                          // Maximum size for letter message
$verify_referrer=0;                      // Do you want to do domain checking (1 for yes and 0 for no)
$domain="http://anonmailer.com";           // Enter your domain if you want to verify it
$domainAlias="http://www.anonmailer.com";  // Enter your domains alias if you want to verify it


//  NO EDITING BEYOND THIS POINT

// PHP script by Dave Lauderdale
// Published at: [url]www.digi-dl.com[/url]
// A little bit modified by nicedomain4sale for [url]www.anonmailer.com[/url]

if($name=="")
{
	$errorMes1="ERROR: You didn't write your name. ";
	$error=1;
}
if($message=="")
{
	$errorMes2="ERROR: You didn't write a message. ";
	$error=1;
}
if($subject=="")
{
	$errorMes3="ERROR: You didn't include a subject line. ";
	$error=1;
}
elseif (strlen($message) >= $maxSize) 
{
	$errorMes4="ERROR: Your message is too long. The maximum characters allowed is $maxSize. ";
	$error=1;
}
else
	$error=0;

if ($from!=="")
{
	if (!eregi("^.+@.+\\..+$", $from))
	{
		$errorMes5="ERROR: Your email address contains errors. ";
		$error=1;
	}
}
else
	$from=trim($from);

if ($to!=="")
{
	if (!eregi("^.+@.+\\..+$", $to))
	{
		$errorMes6="ERROR: The targets email address contains errors. ";
		$error=1;
	}
}
else
	$to=trim($to);

if($verify_referrer==1)
{
	if(!eregi("$domain", $HTTP_REFERER) && !eregi("$domainAlias", $HTTP_REFERER)) 
        {
		$errorMesA="ERROR: Invalid referer. ";
		$error=1;
        }
}


if ($error==0)
{
	$body="This message was using free mailer at www.anonmailer.com<br>You should not trust what the content in this email<br>$message<br> ";
	$from="\"$name\" <$from>\n";
	$headers="Content-Type: text/html; charset=Windows-1252\n";
	$headers.="From: $from";
	
	mail($to,$subject,$body,$headers);
header("Refresh: 1; URL=http://www.anonmailer.com/");			
}
if ($error==1)
{
	echo (" <body>
		<br>
		<p style='font:10pt ms sans serif'>SendMail <font color=red> Error</font>
		<br>
		<br>
		The following errors have occured:
		<br>
		<br>
		$errorMes1<br>
		$errorMes2<br>
		$errorMes3<br>
		$errorMes4<br>
		$errorMes5<br>
		$errorMes6<br>
		$errorMesA<br>
		</body>");
}
?>

I need help with <br> thingy. My problem is that when I input the message, I found that if I press enter for newline, then the output is not as I hope, the newline is not exist. The solution is when I input the message with <br> as newline, the output is as I hope, there is newline.

Example: Hello.<br>How are you?
Output:
Hello.
How are you?

But I want the user don't use the <br> thingy for their comfortability. I want the user use enter key as newline instead of write <br> as newline.
Can someone help me to modify the script.

This is the link for this script, if you want to tried out. http://www.anonmailer.com/sendemailanonymously.htm

As thank you I will give you 20NP$ for you that help me untill this problem solved.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
0
Close
Thank you deadserious for your advice.
NP$ sent.

Now feel free to visit and enjoy www.anonmailer.com to send anonymous mail.
 
0
Close
nicedomain4sale said:
Thank you deadserious for your advice.
NP$ sent.

Now feel free to visit and enjoy www.anonmailer.com to send anonymous mail.

you might think of adding some sort of "flood" protection to prevent repeated abuse
 
0
Close
ps2gamer said:
you might think of adding some sort of "flood" protection to prevent repeated abuse
How I can do that?
 
0
Close
nicedomain4sale said:
How I can do that?

Not sure if this will be the best option but you can do this:

When its the first time the user visits the site:

Check if $_COOKIE['flood'] exists
PHP:
if ((isset($_COOKIE['flood'])) AND ($_GET['set'] != "true"))
{
// if it does, retreive the value of it
$value = $_COOKIE['flood'];
if ($value <= (time() - 59))
{
// emails have been sent in last min so dont allow anymore
exit;
}
} else
{
$time_now = time();
$time_exp = time() + 60*60*24*7;
setcookie("flood", $time_now, $time_exp);
echo "<META HTTP-EQUIV=Refresh CONTENT=\"10; URL=http://yourdomain.com/path/script.php?set=true\">";
exit;
}

if (!isset($_COOKIE['flood']))
{
echo "You must have cookies enabled to send mail.";
exit;
}

// Continue normal from here

Im not sure if that will work....its untested but you can try it
 
0
Close
It works. But how if I want to set the time become 1 minutes to wait ? Which one should I modified.
 
0
Close
edit the fiollowing line

$time_exp = time() + 60*60*24*7;

at present it seems to be set for a week (time is in seconds)
 
0
Close
filth said:
edit the fiollowing line

$time_exp = time() + 60*60*24*7;

at present it seems to be set for a week (time is in seconds)

the cookie is set to be expired in a 1 week, however

line 5 contains the check of how long it has been since email was sent:
if ($value <= (time() - 59))

right now, it is set to be 1 minute (to be exact: 59 seconds)
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Search: choose where to search from the All tab
Open the search at the top of any page. On the All tab, the list next to the search box lets you choose where to search: everything, all...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back