Forum Moderators: coopster

Message Too Old, No Replies

Adding states to a <select> menu dynamically

I think I know how, but I am getting errors.

         

Conscientious Reject

9:21 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



I took out many of the states to focus in on the problem. I am very new to PHP, but I am slowly grasping it. Anyway...

Parse error: parse error, unexpected $ in /home/landingh/public_html/functions.inc on line 16

here is my code:

<?php
function getStateCode()
{
$stateCode = array(1=> "AL",
###############...#########
"WY" );
return $stateCode;

function getStateName()
{
$stateName = array(1=> "ALABAMA",
###############...###########
"WYOMING" );
return $stateName;
}
?><!-- this is 16 //-->

Thanks
Mitchell

jatar_k

10:21 pm on Mar 15, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it looks like your getStateCode function doesn't have a closing } after return $stateCode;

Conscientious Reject

1:28 am on Mar 16, 2006 (gmt 0)

10+ Year Member



Thanks, I seem to be famous for silly mistakes like that. I appreciate your help. Give me about a day, and I am sure stir up something.