Flying Sagittarius Posted August 12, 2008 Share Posted August 12, 2008 I'm making a small RPG. One of my early hurdles is this code; it won't substitute a value in for the variable, it ignores it. <?php $_POST["name"] = $name; $_POST["command"] = $command; $_POST["target"] = $target; $str = $name.' used '.$command.' on '.$target.'!'; ?> any way to make it work? Link to comment https://forums.phpfreaks.com/topic/119255-will-php-always-substitute-the-value-of-a-variable/ Share on other sites More sharing options...
ratcateme Posted August 12, 2008 Share Posted August 12, 2008 you are assign them the wrong way round try this <?php $name = $_POST["name"]; $command = $_POST["command"]; $target = $_POST["target"]; $str = $name.' used '.$command.' on '.$target.'!'; ?> Scott. Link to comment https://forums.phpfreaks.com/topic/119255-will-php-always-substitute-the-value-of-a-variable/#findComment-614266 Share on other sites More sharing options...
Flying Sagittarius Posted August 12, 2008 Author Share Posted August 12, 2008 D'oh! Thanks. Link to comment https://forums.phpfreaks.com/topic/119255-will-php-always-substitute-the-value-of-a-variable/#findComment-614553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.