Page 1 of 1

Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 2:43 am
by DevPHP
while posting any variables from one page to another page, automatically it is removing the space between the words using $_POST method. Need help pls. Thanks in advance friends. :(

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 2:44 am
by panic!
what happens when you run.


<?
print var_dump($_POST);

?>

paste us the result.

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 3:05 am
by DevPHP
The value which enter in text area is 'New! Email Benchmark Guide 2008'. After submitting the page am getting 'New!EmailBenchmarkGuide2008' this as the posted value. even i didnt use php_strip_whitespace. Thanks for ur immediate reply.

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 3:21 am
by Ziq
show your PHP code

or try this:

Code: Select all

 
<?php
print_r($_POST);
?>
 
<form action="<?=$_SERVER['SCRIPT_NAME']?>" method="POST">
    <textarea name="text"></textarea><br>
    <input type="submit">
</form>
 

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 4:09 am
by DevPHP
whether any server settings may affect the post variable? Any chances to remove the spaces?

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 5:34 am
by panic!
what happens when you run.

Code: Select all

 
<?
print var_dump($_POST);
 
?>
 
paste us the result.

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 5:54 am
by DevPHP
The value which enter in text area is 'New! Email Benchmark Guide 2008'. After submitting the page am getting 'New!EmailBenchmarkGuide2008' this as the posted value. even i didnt use php_strip_whitespace.

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 5:57 am
by panic!
Are you reading what I'm writing?


I don't know how to say this any simpler

this code:

Code: Select all

 
 <?
print var_dump($_POST);
 
  
?>
 
Copy and paste it into your script on your server, then run the script in your browser then copy and paste the result into a reply on this forum and click submit with your mouse.

Do you understand?

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 7:11 am
by DevPHP
i think u r expecting me to paste what am getting, but i just send u the thing which i saw in browser. Fine i got this as the result.
array(4) { 5["name"]=> string(4) "test" ["org"]=> string(4) "test" ["email"]=> string(0) "" ["comments"]=> string(51) "donotcontainoffensivecontentand(c)notanovertsales "}

Re: Automatically removes space from $_POST variables- Need help

Posted: Tue Aug 26, 2008 7:23 am
by DevPHP
Thank u so much for all who helped me to find out the solution. For validation purpose i used str_replace() to remove space. Thats y it removed all the space for the posted variables.