This topic is locked

Custom Code - my variables wrong?

4/16/2008 9:43:55 AM
PHPRunner General questions
B
billteale author

Hi,
I'm trying to pass information into a text file after a record has been edited (the purpose is to then pass that information into a flash graphic to produce a pretty little header <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=8175&image=1&table=forumtopics' class='bbc_emoticon' alt=';)' /> )
Everything seems to work, but I am getting the error "undefined variable" - It is probably another "newbie" error, but if somebody could point me in the right direction I would be most grateful.
[codebox]$myFile = ("../flash/text.txt");

$fh = fopen($myFile, 'w') or die("can't open file");

$stringData = "&main=".$value_HOME."&";

fwrite($fh, $stringData);

$stringData = "&about=".$value_ABOUT."&";

fwrite($fh, $stringData);

$stringData = "&locations=".$value_LOCATIONS."&";

fwrite($fh, $stringData);

$stringData = "&commercial=".$value_COMMERCIAL."&";

fwrite($fh, $stringData);

$stringData = "&home=".$value_PROPERTY."&";

fwrite($fh, $stringData);

$stringData = "&motor=".$value_MOTOR."&";

fwrite($fh, $stringData);

$stringData = "&personal=".$value_PERSONAL."&";

fwrite($fh, $stringData);

fclose($fh);

[/codebox]
Many thanks!

J
Jane 4/17/2008

Bill,
there are no $value_FieldName variables in the PHPRunner events.

Try to use one of the pre-defined arrays ($values, $oldvalues, etc.).

B
billteale author 4/18/2008

Bill,

there are no $value_FieldName variables in the PHPRunner events.

Try to use one of the pre-defined arrays ($values, $oldvalues, etc.).


Thanks Jane, it was a newbie error, I got it sorted out using $value['VARIABLE'] - still getting the hang of this new language! smiles!