Automatically removes space from $_POST variables- Need help
Moderator: General Moderators
Automatically removes space from $_POST variables- Need help
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
what happens when you run.
<?
print var_dump($_POST);
?>
paste us the result.
<?
print var_dump($_POST);
?>
paste us the result.
Re: Automatically removes space from $_POST variables- Need help
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
show your PHP code
or try this:
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
whether any server settings may affect the post variable? Any chances to remove the spaces?
Re: Automatically removes space from $_POST variables- Need help
what happens when you run.
paste us the result.
Code: Select all
<?
print var_dump($_POST);
?>
Re: Automatically removes space from $_POST variables- Need help
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
Are you reading what I'm writing?
I don't know how to say this any simpler
this code:
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?
I don't know how to say this any simpler
this code:
Code: Select all
<?
print var_dump($_POST);
?>
Do you understand?
Re: Automatically removes space from $_POST variables- Need help
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 "}
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
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.