Welcome, Guest. Please Login or Register.
May 10, 2025, 08:15:41 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  stripslahes? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: stripslahes?  (Read 1283 times)
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

stripslahes?
« on: March 18, 2003, 05:38:47 PM »
Reply with quote

I made that the posted message is also sent in the email:

$message = stripslashes($message);

            $send_body = "$message";

sendmail($rowmember['emailAddress'], $send_subject, $send_body);


so far so good, the message is sent, however if the message contains breaks or quotes I get this kind of message:

test 3<br /><br />test 3 with quotes &quot; and &quot;

how can I make that they disappear and that message is clean? thanks
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:stripslahes?
« Reply #1 on: March 18, 2003, 05:53:08 PM »
Reply with quote

use str_replace() and replace &quot; to quote sign, and <br> into \n
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #2 on: March 18, 2003, 05:57:54 PM »
Reply with quote

so I simply have to change stripslahes into str_replace?

this way is correct?

$message = str_replace($message);
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:stripslahes?
« Reply #3 on: March 18, 2003, 06:02:33 PM »
Reply with quote

keep using the stripslashes, but also use the str_replace -> www.php.net/str_replace
i think stripslashes should affect the <br> tag too... dont know why it doesnt...
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #4 on: March 18, 2003, 06:09:21 PM »
Reply with quote

how can I use both??? can you help me with this an transform my script, I'm a bit confused here...thanks.
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:stripslahes?
« Reply #5 on: March 18, 2003, 06:35:37 PM »
Reply with quote

Replace that code with...


           // Warning:  Only works in 1.5.1!! (un_html_entities())
            sendmail($rowmember['emailAddress'], $send_subject, un_html_entities(br2nl(stripslashes($message))));


-[Unknown]
Logged
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #6 on: March 18, 2003, 06:40:13 PM »
Reply with quote

thanks however my $send_body contains a lot more...it looks like this:

$send_body = "Hello\n
            $username posted in the thread you have subscribed to:
            $subject
            ==================================Message:========================================
            $message
      
            =================================Your Action:=======================================
            
            $txt[12910]\n$cgi;action=display;threadid=$threadid;start=new\n
            $txt[12912]\n$cgi;action=post;threadid=$threadid;title=Post%2Breply;start=0\n
            
            ==================================Options:========================================
            
            To cancel the subscription to this thread/board go to:
            http://www.xsibase.com/forum/index.php?board=;action=shownotify
            \n\n$txt[130]
            www.xsibase.com";
            
            
             // Warning:  Only works in 1.5.1!! (un_html_entities())
           sendmail($rowmember['emailAddress'], $send_subject, un_html_entities(br2nl(stripslashes($message))));



how has the last line to look then?
Logged
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #7 on: March 18, 2003, 06:42:31 PM »
Reply with quote

is that correct like this?


un_html_entities(br2nl(stripslashes($message))));
//post
            $send_body = "Hello\n
            $username posted in the thread you have subscribed to:
            $subject
            ==================================Message:========================================
            $message
      
            =================================Your Action:=======================================
            
            $txt[12910]\n$cgi;action=display;threadid=$threadid;start=new\n
            $txt[12912]\n$cgi;action=post;threadid=$threadid;title=Post%2Breply;start=0\n
            
            ==================================Options:========================================
            
            To cancel the subscription to this thread/board go to:
            http://www.xsibase.com/forum/index.php?board=;action=shownotify
            \n\n$txt[130]
            www.xsibase.com";
            
            
            sendmail($rowmember['emailAddress'], $send_subject, $send_body);
Logged
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #8 on: March 18, 2003, 06:52:20 PM »
Reply with quote

I took a ) away sorry, but when I try it then I get:

Call to undefined function: br2nl() in /home/xsibase.com/www/forum/Sources/Post.php on line 1287


what do I have to do? thanks.
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:stripslahes?
« Reply #9 on: March 18, 2003, 06:57:57 PM »
Reply with quote

Darn, I guess that's only in 4.3.x...

It should be:

$message = un_html_entities(str_replace(array('<br>', '<br />'), array("\n", "\n"), stripslashes($message))));

-[Unknown]
Logged
raffael3d
Jr. Member
**
Posts: 79


I'm a llama!

Re:stripslahes?
« Reply #10 on: March 18, 2003, 07:07:48 PM »
Reply with quote

thanks a lot! solution is:

$message = (un_html_entities(str_replace(array('<br>', '<br />'), array("\n", "\n"), stripslashes($message))));

thanks again.  :D
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  stripslahes? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.125 seconds with 21 queries.