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. ???????????????????????? Quote Link to comment 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>'; Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.