Sorry I love to figure out things for myself but need some beginner direction. I'm trying to use _GET to pass a variable to php and modify a Java applet configuration file. <?php $symbol = $_GET['symbol']; $text1 = @file_get_contents("ondemand.txt") or die("file not found!"); print "$symbol"; print "$text1"; The portion of ondemand.txt I'm trying to modify <param name="symbol" value = "$symbol"> it evaluates the variable in print "$symbol"; but not in <param name="symbol" value = "$symbol"> Help Please
If i understand you correctly, this should be what you need: <?php error_reporting(E_ALL); $symbol = $_GET['symbol']; $text1 = file_get_contents("ondemand.txt") or die("file not found!"); $text1 = preg_replace("@<param name=\"symbol\" value = \"(.*)\">@", "<param name=\"symbol\" value = \"$symbol\">", $text1); echo $text1; ?> PHP: