Guest upirate Posted March 28, 2007 Share Posted March 28, 2007 $_POSTequals '/results.php?mysearch=xbox' $_POST[mysearch] equals 'xbox' $fav="<a href=".str_replace(" ", "+", $_POST).">".$_POST[mysearch]."</a>"; echo $fav; Nothing gets outputted. ???????????????????????? Link to comment https://forums.phpfreaks.com/topic/44712-stupid-error-or-am-i-being-stupid/ Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 There doesn't appear to be anything so wrong that it would cause your code to fail outright. The most likely culprit is that you have a syntax error elsewhere in your code and display errors is set to 0 in your php.ini file, so it will not show syntax errors. It is always a good idea to use single quotes when addressing array elements: $fav = '<a href=' . str_replace(" ", "+", $_POST['url']) . '>' . $_POST['mysearch'] . '</a>'; Link to comment https://forums.phpfreaks.com/topic/44712-stupid-error-or-am-i-being-stupid/#findComment-217117 Share on other sites More sharing options...
Guest upirate Posted March 29, 2007 Share Posted March 29, 2007 yeah you are right. My code was correct. I just was not getting one of the variables. thanks Link to comment https://forums.phpfreaks.com/topic/44712-stupid-error-or-am-i-being-stupid/#findComment-217517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.