Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-27-2012, 07:10 AM   #1
Registered: May 2006
Location: Canada
Distribution: Slackware 13 and fedora 15
Posts: 32

Rep: Reputation: 0
Question Anybody having this issue with PHP scripts using forms?

So I wrote a simple PHP script which uses a form. The form submits fine if there is less than 113 characters, however, if I submit 113 or more characters in the field, I keep getting a 403 - forbidden message.

If it's of any help, here is the actual code:
$script_file = basename($_SERVER['SCRIPT_NAME']);
$script_path = str_replace("/".$script_file, "",$_SERVER['SCRIPT_FILENAME']);

if (isset($_POST['codedMsg'])) $codedMsg = $_POST['codedMsg'];
  else $codedMsg = "";

echo '<html>
Binary Decoder

<form method="post" action="'.$script_file.'">
<textarea name="codedMsg" cols="80" rows="5" style="border: #000000 1px solid;"></textarea>
<br><input type="submit" value="Decode">

// Strip entry to bare 0s and 1s.
for ($i = 0; $i < 48; $i++) $codedMsg = str_replace(chr($i), '', "$codedMsg");
for ($i = 50; $i < 256; $i++) $codedMsg = str_replace(chr($i), '', "$codedMsg");

if (is_numeric($codedMsg)) {
  $len = strlen($codedMsg);
  $fraLen = $len / 8;
  $totChars = floor($fraLen);
  for($i = 0; $i < $totChars; $i++) {
    $num = $i * 8;
    $binChar[] = bindec(substr("$codedMsg", $num, 8));
// substr
  echo "<b>Decoded:</b><p>";
  for ($i = 0; $i < count($binChar); $i++) echo chr($binChar[$i]);
  echo "</p>
I think the issue is with the server itself though.

I've even tried to lookup this problem on Google, and the results are from messages posted about mod_secure issues over a couple years ago, which is different than this problem.

Last edited by Elmware; 12-27-2012 at 07:12 AM.
Old 12-27-2012, 07:52 AM   #2
Senior Member
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,506

Rep: Reputation: 100Reputation: 100
Check your


PHP parameter? What is it set to?

113 chars sounds obscenely small though, but the above config setting is the first place to start checking?

What "kind" of PHP are you running? One you compiled yourself or a binary package?
Old 01-04-2013, 12:38 AM   #3
Registered: May 2006
Location: Canada
Distribution: Slackware 13 and fedora 15
Posts: 32

Original Poster
Rep: Reputation: 0
Thankks for the response.

Apparently, it shows in PHP.ini as:
post_max_size = 8M
Both PHP and HTTPD were installed using the Software Management that comes with fedora 16. Updates are done whenever Apper notifies me.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
processing forms with PHP 3vra Programming 15 02-16-2009 03:28 PM
processing email forms with php 3vra Programming 4 01-23-2009 04:27 PM
master - details forms with php htamayo Programming 1 04-09-2008 05:48 PM
LXer: Html Forms and PHP LXer Syndicated Linux News 0 01-09-2007 02:33 AM
Best mailer to use for a website with PHP email forms gbkyle Linux - Software 1 07-07-2005 05:00 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration