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 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); 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 Link to comment https://forums.phpfreaks.com/topic/162981-solved-str_replace-help/#findComment-859994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.