The first two work perfectly. In the third, I tried to put them together in an array and nothing happens. Can anyone see what I am doing wrong?
Thanks
<?php $ident = $_POST['ident']; ?>
<?php
$filename = 'r5include.html';
$string = file_get_contents($filename);
$data = str_replace("add.html' target='_blank'","$ident.html' target='iframe2'","$string");
$handle = fopen($filename, "w+");
fwrite($handle,$data);
fclose($handle);
?>
<?php $ident = $_POST['ident']; ?>
<?php
$ident2 = ($ident . 2);
$filename = 'r5include.html';
$string = file_get_contents($filename);
$data = str_replace("'images/up.jpg'","'$ident/$ident2.jpg'","$string");
$handle = fopen($filename, "w+");
fwrite($handle,$data);
fclose($handle);
?>
<?php $ident = $_POST['ident']; ?>
<?php
$ident2 = ($ident . 2);
$filename = 'r5include.html';
$string = file_get_contents($filename);
$old = array("'images/up.jpg'","add.html' target='_blank'");
$new = array("'$ident/$ident2.jpg'","$ident.html' target='iframe2'");
$data = str_replace("$old","$new","$string");
$handle = fopen($filename, "w+");
fwrite($handle,$data);
fclose($handle);
?>