I have three pages an index page that takes form info and sends it to final.php. final.php is supposed to look at test.php and change the info in test.php
index.php
<html>
<head>
<title>Batch File Content Find and Replace </title>
<body bgcolor="#FFFFFF" text="#000000">
<form method="post" action="final.php">
Text to replace: <input name="find" size="40">
<br><BR>
Replacement text: <input name="replace" size="40">
<input type="submit" name="submit" value="Go!">
</form>
</head>
</html>
final.php
<?php
// Sets location to search
$location = 'test.php';
// The string to replace
$find = $_POST['find'];
// The string that replaces $find
$replace = $_POST['replace'];
// Runs through text to replace $find
$output = str_replace($find , $replace , $location);
// Display the output of what happened
print "<br>location: " . $location . "<br>";
print "find: " . $find. "<br>";
print "replace: " . $replace. "<br>";
echo $output;
?>
test.php
ab abcd ef efgh
Can you see a reason why this wouldn't work?
I'm sure it is my $location variable in the final.php but can't seem to figure it out.
Thanks,
Brandon