I read on www.php.net... the php manual on how to use htmlspecialchars() i'm trying to eliminate some security issus so ppl can't send javascript or anyother script to the guestbook but i have run into a problem that i do not know how to solve... Maby anyone of you can? As you can see below it's the error msg and below that is the code i'm using... I'm using the latest php version so it should not be any problem... Help please
//Johan

Fatal error: Call to undefined function: _htmlspecialchars() in /home/syskonskapet/public_html/fspalt/spara.php on line 12

	$text_=_htmlspecialchars($text);
	$text = str_replace('>', '>', $text);
	$text = str_replace('&lt;br>', '<br>', $text);
	$text = str_replace('&lt;b>', '<b>', $text);
	$text = str_replace('&lt;/b>', '</b>', $text);
	$text = str_replace('&lt;i>', '<i>', $text);
	$text = str_replace('&lt;/i>', '</i>', $text);

    change the first line of code to look like this:

    $text = htmlspecialchars($text);

      Try this it will work:
      just remove underscore from function _htmlspecialchars

      <?
      $text=htmlspecialchars($text); 
      $text = str_replace('&gt;', '>', $text); 
      $text = str_replace('&lt;br>', '<br>', $text); 
      $text = str_replace('&lt;b>', '<b>', $text); 
      $text = str_replace('&lt;/b>', '</b>', $text); 
      $text = str_replace('&lt;i>', '<i>', $text); 
      $text = str_replace('&lt;/i>', '</i>', $text);
      ?>
      

        Great it works... Thanks! πŸ™‚

        A question... do you know of anyother system that can rule out anyother HTML tag or php code of some sort so it doesn't show?

        with htmlspecialchars the tags that aint aproved like <font> and so on shows in the text... But is there away that any other tag that aint approved is taken away from the text so it is left clean? just text? Am i makeing any sens?
        //Johan

          Great! Thanks all for your help strip_tags() did do the workπŸ™‚ Thanks to you guys i learn more and more about usefull fuctions in PHP thanks again
          //Johan

            correct!

            I want some of that you're eating!

              Originally posted by sijis
              correct!

              I want some of that you're eating!

              Sure, help yourself ... no, not that bit, you don't want that bit, I've already gobbed on that bit ...

                I came up with a new question again πŸ™‚

                in this forum when you hit enter you get a newline.. but in what have they done to make it get a newline without using <br>. I the Gbook i'm making you have to use <br> to get a newline but how do i do to get a newline just by hitting enter?
                //Johan

                  Write a Reply...