mmendo
06-19-2008, 11:30 AM
Hi there,
I'm a PHP newbie and have a question that I just can't seem to figure out. I have a form in which one of the fields uses an image browers to select an image from the user's computer and then save the image path to a CSS file. Problem is, the image browser uses the img source tag, but I need to strip that off and only save the path itself to the CSS file.
The $value it is pulling now is the value currently in the CSS file, not the new image selected with the image browser.
I have figured out how to use the str_replace function to get the path only (shown in the echo part below), but I cannot figure out how to make that value actually save to the CSS file.
I will post my code below.
Can anyone help?
Thanks,
Nicole
case "image":
$old = array('<img src=\"..', '\" />');
$new = array('', '');
?><textarea name="<?=$key?>" cols="20" rows="1" mce_editable="true" value="<?=$value?>" ></textarea><?
echo ("$value");
echo $value = str_replace($old, $new, $value);
break;
I'm a PHP newbie and have a question that I just can't seem to figure out. I have a form in which one of the fields uses an image browers to select an image from the user's computer and then save the image path to a CSS file. Problem is, the image browser uses the img source tag, but I need to strip that off and only save the path itself to the CSS file.
The $value it is pulling now is the value currently in the CSS file, not the new image selected with the image browser.
I have figured out how to use the str_replace function to get the path only (shown in the echo part below), but I cannot figure out how to make that value actually save to the CSS file.
I will post my code below.
Can anyone help?
Thanks,
Nicole
case "image":
$old = array('<img src=\"..', '\" />');
$new = array('', '');
?><textarea name="<?=$key?>" cols="20" rows="1" mce_editable="true" value="<?=$value?>" ></textarea><?
echo ("$value");
echo $value = str_replace($old, $new, $value);
break;