I don’t usually ask for assistance unless I am completely defeated, which sadly, seems to be the case in this project.
Firstly I needed to get the variables content into the text area in order for them to be editable. This was accomplished with no problem. However, I still have not succeeded in getting the content from the array variables inside the referred text area. I only seem to be able to fetch variables that are not in arrays.
Also, I would like to know if there a possibility of instead of fetching the variables and placing them in a sequential numerical order in the select form, to make it possible for me to choose which variables do I want to fetch and which text do I want to display in the select form.
Finally, and after all these changes are successfully applied , I want to save the changes and be redirected to a success page.
P.S. I will gladly pay a small sum of money for this work. 15$
Only PAYPAL.
Vars.php
<?
$text1 = "text text text <br> dsdsd";
$text2 = "text text textz <br> dsdsd";
$content_array["zonaimagemsos"] ="text text text <br> dsdsd array";
$content_array["zonaimagemsos"] ="text text text>";
$content_array["zonaimagemsos"] ="text text text";
?>
Index.php
<?
if($cmd == "modify")
{
$newfile = "vars.php";
$fh = fopen($newfile, "r");
$newcontent = fread($fh, filesize($newfile));
fclose($fh);
$newinfo = explode('$', $newcontent);
$newnum = count($newinfo);
$sumb = $sumb;
$finalcontent = "<?
";
for($i =1;$i<$newnum;$i++)
{
$newdata = explode('= "', $newinfo[$i]);
$newdatab = explode("\";", $newdata[1]);
if($sumb == $i)
{
$newdatab[0] = addslashes($sum);
$newdatab[0] = eregi_replace("<", "<", $newdatab[0]);
$newdatab[0] = eregi_replace(">", ">", $newdatab[0]);
}
$finalcontent .= '$'.$newdata[0].'= "'.$newdatab[0].'";
';
}
$finalcontent .= "?>";
$fh = fopen($newfile, "w");
fwrite($fh, $finalcontent);
fclose($fh);
header('Location: http://www.hotmail.com');
}
?>
<html><body>
<head><title>Content Manager Update</title></head>
<script type="text/javascript"><!--
function updatesum() {
document.form.sum.value = (document.form.s1.options[document.form.s1.selectedIndex].value);
document.form.sumb.value = (document.form.s1.options[document.form.s1.selectedIndex].text); }
//--></script>
<form name="form" action="?cmd=modify" method="post"> Select a variable number: <select name="s1" onChange="updatesum()"> <option value="" selected>Select One</option>
<?
$newfile = "vars.php";
$fh = fopen($newfile, "r");
$newcontent = fread($fh, filesize($newfile));
fclose($fh);
$newinfo = explode('$', $newcontent);
$newnum = count($newinfo);
for($i =1;$i<$newnum;$i++)
{
$newdata = explode('= "', $newinfo[$i]);
$newdatab = explode("\";", $newdata[1]);
$newdatab[0] = eregi_replace("<", "<", $newdatab[0]);
$newdatab[0] = eregi_replace(">", ">", $newdatab[0]);
echo '<option value="'.stripslashes($newdatab[0]).'">'.$i.'</option>';
}
?>
</select> <BR><TEXTAREA NAME="sum" WRAP="VIRTUAL" COLS="70" ROWS="10"></TEXTAREA> <input name="sumb" type="hidden" value="">
<td><BR><INPUT TYPE="submit" NAME="Submit" VALUE="udpate"></form>
</body></html>