Can dynamic text fields in the canvas be populated with data from an external text file?
Scenario: A canvas has some dynamic textfields with instance names. I want these textfields to be populated by the data from a text file immediately, no clicking of buttons, just instantly appear once the page is opened. Said instances are: ToName, FromName, Greeting, and IntroMessage.
In my original flash site, a textfile is generated from a php (worked in flash, haven't gotten it going in canvas yet), but before I do even THAT, I want to know if the generated textfile's contents are in the correct format for use with the canvas.
The original e-card used this ActionScript to load the text file:
loadVariablesNum ("http://www.mysite.net/dBText/"+EcardText+".txt", 0);
EcardText is a random number, the name of the text file, generated by the php, so I need to be able to get that same function in jQuery.
Recently, I was given this code format, don't know how to use it in place of the old code:
$.load()
The contents of the textfile are as follows:
ToName=JohnDoe&ToEmail=Person@makebelievesite.com&FromName=FriendlyPerson&FromEmail=ecards@mysite.net&Greeting=hi&IntroMessage=Hello John&Created=&
This php (not the same one that generated the text), is the one that tells the text file to put its contents into the dynamic textfields. Instead of embedding an swf onto it, I embed the canvas this time. Since this isn't flash anymore, I don't know if I need to change anything here, so here it is:
<HTML>
<HEAD>
<TITLE>UNDISCLOSED</TITLE>
<?
register_globals( 'NGPCFRES' );
function register_global_array( $sg ) {
Static $superGlobals = array(
'e' => '_ENV' ,
'g' => '_GET' ,
'p' => '_POST' ,
'c' => '_COOKIE' ,
'r' => '_REQUEST' ,
's' => '_SERVER' ,
'f' => '_FILES' ,
'n' => '_SESSION'
);
Global ${$superGlobals[$sg]};
foreach( ${$superGlobals[$sg]} as $key => $val ) {
$GLOBALS[$key] = $val;
}
}
function register_globals( $order = 'gpc' ) {
$_SERVER; //See Note Below
$_ENV;
$_REQUEST;
$order = str_split( strtolower( $order ) );
array_map( 'register_global_array' , $order );
}
switch ($_GET['ENum']) {
## TEST Cards
case '1':
$goto = "ecards/birthdaycards/birthday1.html?EcardText=".$EcardText;
$Dimensions = "WIDTH=700 HEIGHT=564";
break;
}
?>
<?php
$url = 'http://www.mysite.net/images/wallpaper.png';
?>
</script>
</head>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<br>
<br>
<br>
<br>
<center>
<OBJECT
<? print "$Dimensions";?>>
<PARAM NAME=movie VALUE="<? print "$goto";?>"> <EMBED src="<? print "$goto";?>" quality=high bgcolor=#FFFFFF <? print "$Dimensions";?></EMBED>
</OBJECT>
</center>
<style type="text/css">
body
{
background-image:url('<?php echo $url ?>');
}
</style>
</BODY>
</HTML>
quick note, afraid my previous post might have been too big/overhwelming. so this is only asking a small piece at a time. thank you!!!
