PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
feyd wrote:I would hazard to guess it's Firefox that's adding the underscore.. or it may be your own code somewhere. Darn near impossible to say right now.
<?php
print_r($_POST);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
<head>
<title>POST Test</title>
</head>
<body>
<form action="" method="post">
Full Name : <input type="text" name="Full Name"/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>
On both my localhost and server using FF 1.5.0.4 and IE 7 beta 2, the whitespace gets converted to underscore.
If converted to GET, it becomes post-test.php?Full+Name=someone but print_r($_GET) still prints Array ( [Full_Name] => someone )
Changing the PHP code to ASP .NET and running it on IIS 5.1 (post-test.aspx)
Everah wrote:I'm still thinking it may be easier (and better) to axe the spaces in your db field names and form field names.
I would agree, but so far, anjanesh has disliked that solution.
Yeah, I know. And I suppose repeating that solution makes me look like a persistent @$$, so, with that, I believe I will be vacating my position in this thread.