View Single Post
  #1 (permalink)  
Old October 2nd, 2014, 10:12 AM
CodeNewbe CodeNewbe is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 "Stock Widget"

I have attempted to modify the "Stock Widget" example to permit stock symbol entry via a text input form instead of the values being hard coded into the stockproxy.php file. This was accomplished by replacing the $SYMBOLS array with the following code (the text "ge" was retained for testing purposes):

$sticker0 = $_POST["sticker0"];
$sticker1 = $_POST["sticker1"];
$sticker2 = $_POST["sticker2"];
$sticker3 = $_POST["sticker3"];
$sticker4 = $_POST["sticker4"];

$SYMBOLS = array(
"$sticker0",
"$sticker1",
"$sticker2",
"$sticker3",
"$sticker4",
'ge',);

This appears to work fine for retrieving the information from Yahoo as indicated by the "echo $json->encode($object_to_serialize);" statement at the end of the stockproxy.php file. However, the table output produced by "default.htm" only includes data for the text data "ge".

Could you please help me understand why the text variables are not understood by the application?