Hire A Programmer
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherHire A Programmer

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 10th, 2004, 10:59 AM
vogs vogs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 vogs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with a simple CMS - a symbolic $ award given for assistance.

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>



______________________________________________________________

Reply With Quote
  #2  
Old April 10th, 2004, 07:36 PM
vogs vogs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 vogs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've had some progress, but I still can't seem to edit and save the array variable scorrectly.
The vars.php file get's messed up after attempting to save the modifications.

--------------

Vars.php

<?


$content_array["zonaimagemsos"] ="text text text <br> dsdsd array";

$content_array["zonaimagemddd"] ="text text text>";

?>

----------------------------

index2.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');
}

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language=JavaScript>
function changeWindow(value){if (value != 'Category'){window.location=value;}else{return false;}}</script>
</head>

<body><form name="form" action="?cmd=modify" method="post">
<p>
<select onChange="changeWindow(this.options[this.selectedIndex].value)" name="select">
<option selected value="Category">Seleccione, por favor&nbsp;</option>
<option value="http://www.ajudademae.com/zipped/index2.php?content=zonaimagemsos">Grande
Cavaco 1</option>
<option value="http://www.ajudademae.com/zipped/index2.php?content=zonaimagemddd">Grande
Cavaco 2</option>
</select>
</p>
<textarea cols="80" rows="10" name="sum"><?php include("vars.php"); echo $content_array[$_GET["content"]]; ?></textarea><br><br><INPUT TYPE="submit" NAME="Submit" VALUE="udpate">

</form>
</body>

</html>

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherHire A Programmer > Help with a simple CMS - a symbolic $ award given for assistance.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway