Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Thanks for the help. I am still having a little bit of trouble.
> I don't understand what the super global is, but right now I don't think it's too important
> I revised the code a little to show a couple examples of problems I am having
Code:Code: Select all
<?PHP
function WriteToFile(){
global $yesPercentage;
//echo($yesPercentage."HERE");
echo("HERE".$yesPercentage);
// or you can use the superglobal $_POST var
$filename="/home/content/w/h/y/whyworkforever/html/test/test.txt";
$file=fopen($filename,"w");
fwrite($file,$yesPercentage); // $yesPercentage needs to be globalized
fclose($file);
}
function Read(){
$filename="/home/content/w/h/y/whyworkforever/html/test/test.txt";
$file=fopen($filename,"r");
echo($file);
fclose($file);
}
//$yesPercentage = $_POST['yesPercentage']; // set the value of $yesPercentage
echo("yesPercentage=".$yesPercentage);
?>Code:
Code: Select all
global $yesPercentage;
//echo($yesPercentage."HERE");
echo("HERE".$yesPercentage);The globalization did help, and I do remember that from my VB classes, but it has been a while so I needed a refresher, thanks Very Happy
Also I have a link in the HTML...
Code:
Code: Select all
<a href=http://www.whyworkforever.org/test/test.php?Read>HERE</a>I was going to try to put in a "return $yesPercentage" line in the WriteToFile function, but I thought I would get one thing done at a time.
I hope this was well explained so some kind person can help. Thanks for your fast response on the previous message.
It's weird how some of the easiest things get forgotten, but once they get refreshed in your memory, other things start to get unlocked and remembered.
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]