Minase Posted October 13, 2008 Share Posted October 13, 2008 hy there im having a little problem with post =/ weird but its true if i do have a value lets say $a = Me.2; just variable a value,if i use it into post the point ( . ) become underscore ( _ ) like $a = Me_2; i cant use str_replace here.. if user have name like this $a = ME_2; ... anyone know why this is happening ? thanks Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/ Share on other sites More sharing options...
AndyB Posted October 13, 2008 Share Posted October 13, 2008 Does your form have attributes quoted, e.g. <input type='text' name='wombat' size='10'/> Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663854 Share on other sites More sharing options...
Minase Posted October 13, 2008 Author Share Posted October 13, 2008 lol normally Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663857 Share on other sites More sharing options...
kenrbnsn Posted October 13, 2008 Share Posted October 13, 2008 How are you using that value in the form? Ken Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663858 Share on other sites More sharing options...
Minase Posted October 13, 2008 Author Share Posted October 13, 2008 i do fetch some usernames from mysql DB echo "<tr><td> $s[username] : $s[LastIP] <input type='checkbox' name='$s[username]' value='ban'></td></tr> \n"; this is what i echo on the page i use foreach ($_POST as $a => $b) to take every post i do something like if $b == ban then echo $a but if $a contain a point it become underscore =/ thanks Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663866 Share on other sites More sharing options...
kenrbnsn Posted October 13, 2008 Share Posted October 13, 2008 Since variable names in PHP can't contain periods, PHP will change the period to an underscore when it occurs in the name attribute. Ken Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663869 Share on other sites More sharing options...
Minase Posted October 13, 2008 Author Share Posted October 13, 2008 sorry i did type incorrect the last row i mean the variable value contain a point ,not the variable itself Link to comment https://forums.phpfreaks.com/topic/128180-post-problem/#findComment-663895 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.