Author Topic: I want to disable invalid characters  (Read 4177 times)

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
I want to disable invalid characters
« on: May 04, 2012, 08:02:43 PM »
phpEnter Web Hosting
Hello

I want to disable invalid characters

When I finished writing my article which contains as special caracères% .. etc ... after the click send .. I received the following message:

% Invalid characters!

Please help me solve this problem, help me too to making bb code and html allwed

Thank you
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Michael

  • Full Member
  • *****
  • Posts: 115
  • Karma: +0/-0
Re: I want to disable invalid characters
« Reply #1 on: May 04, 2012, 11:03:00 PM »
@7eway. Which version you are running?
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
Re: I want to disable invalid characters
« Reply #2 on: May 05, 2012, 01:19:34 PM »
Hello Michael

Thank you for you reply

I am runing with PHP Enter 4.1.1
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Jeremy

  • Full Member
  • *****
  • Posts: 238
  • Karma: +1/-0
Re: I want to disable invalid characters
« Reply #3 on: May 06, 2012, 06:40:52 PM »
Exactly after which file you get this error message? (post.php, comment.php...)
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »
Social Bookmarking Script markerpaper.com

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
Re: I want to disable invalid characters
« Reply #4 on: May 06, 2012, 07:10:52 PM »
Quote from: "Jeremy"
Exactly after which file you get this error message? (post.php, comment.php...)

Hello Jerymy thank you for your positive reactio

I found this error message when I put the contents of description with special character as %, ...
I received this error message ( "%" invalid characters )

But today i solved the problem with a small stuff...

I need now a solution to make html and bb code allowed for (postube.php)

So any help please

Thank you again...
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Jeremy

  • Full Member
  • *****
  • Posts: 238
  • Karma: +1/-0
Re: I want to disable invalid characters
« Reply #5 on: May 06, 2012, 07:30:46 PM »
postube.php

replace this code:
Code: [Select]
}
    $name = array($yname, $yadress, $yamess);
    foreach ($name as $name) {
        if (preg_match("/%/", $name)) {
            echo "<center><div id="toprow">Invalid Characters "%" </div>";
            die();
        }
        if (preg_match("/</", $name)) {
            echo "<center><div id="toprow">Invalid Characters "<" HTML is not allowed";
            die();
        }
        if (preg_match("/\[/", $name)) {
            echo "<center><div id="toprow">Invalid Characters "[" BB code is not allowed";
            die();
        }
    }


with:
Code: [Select]
      $yname = htmlspecialchars($yname);
       $yadress = htmlspecialchars($yadress);
}

 :)
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »
Social Bookmarking Script markerpaper.com

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
Re: I want to disable invalid characters
« Reply #6 on: May 07, 2012, 11:30:48 AM »
Quote from: "Jeremy"
postube.php

replace this code:
Code: [Select]
}
    $name = array($yname, $yadress, $yamess);
    foreach ($name as $name) {
        if (preg_match("/%/", $name)) {
            echo "<center><div id="toprow">Invalid Characters "%" </div>";
            die();
        }
        if (preg_match("/</", $name)) {
            echo "<center><div id="toprow">Invalid Characters "<" HTML is not allowed";
            die();
        }
        if (preg_match("/\[/", $name)) {
            echo "<center><div id="toprow">Invalid Characters "[" BB code is not allowed";
            die();
        }
    }


with:
Code: [Select]
      $yname = htmlspecialchars($yname);
       $yadress = htmlspecialchars($yadress);
}

 :)


Hello Jerymy

Thank you i replaced the code but i foud this message

Parse error: syntax error, unexpected '}' in /home/xxxxxxxx/xxxxxxx/php_enter/postube.php on line 88

!!!!
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Jeremy

  • Full Member
  • *****
  • Posts: 238
  • Karma: +1/-0
Re: I want to disable invalid characters
« Reply #7 on: May 07, 2012, 11:53:57 AM »
Sorry, my mistake...
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »
Social Bookmarking Script markerpaper.com

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
Re: I want to disable invalid characters
« Reply #8 on: May 07, 2012, 05:14:59 PM »
Quote from: "Jeremy"
Sorry, my mistake...


It's ok Jeremy. Thank you for your fast reply  ;)  :)

Have a good daytime.
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »