imperialized Posted June 20, 2009 Share Posted June 20, 2009 #connec to DB and get their info to replace the codes $query = mysql_query("SELECT * FROM poker_users WHERE email='$email'"); while($x = mysql_fetch_array($query)){ $fname = $x['fname']; $lname = $x['lname']; $poker_name = $x['poker_name']; str_replace("%fname%", $fname, $msg); str_replace("%lname%", $lname, $msg); str_replace("%pname%", $poker_name, $msg); print "$msg"; exit; } That's my code, the variables from the database are coming out just fine. The variables %fname% etc are coming through a form and are being sent correctly. It outputs: %fname% %lname% %pname% and does not replace them with the new vars.. any help is appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/162981-solved-str_replace-help/ Share on other sites More sharing options...
Alex Posted June 20, 2009 Share Posted June 20, 2009 $msg = str_replace("%fname%", $fname, $msg); $msg = str_replace("%lname%", $lname, $msg); $msg = str_replace("%pname%", $poker_name, $msg); Quote Link to comment https://forums.phpfreaks.com/topic/162981-solved-str_replace-help/#findComment-859989 Share on other sites More sharing options...
imperialized Posted June 20, 2009 Author Share Posted June 20, 2009 Wow... way for me to overlook that. haha, thanks for the quick reply Quote Link to comment https://forums.phpfreaks.com/topic/162981-solved-str_replace-help/#findComment-859994 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.