Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error in trying to make United States appear


Graveyard666

Recommended Posts

After following the Wiki doc, I get this error:

 

 

Parse error: parse error, expecting `')'' in /home/graveyar/public_html/catalog/includes/functions/html_output.php on line 277

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/graveyar/public_html/catalog/includes/functions/html_output.php:277) in /home/graveyar/public_html/catalog/includes/functions/sessions.php on line 67

 

www.graveyardrecords.com/catalog

 

my line says:

 

for ($i=0, $n=sizeof($countries); $i<$n; $i++) {

$countries_array = array(array('id' => '223', 'text' => 'United States'));

}

 

I just copy/pasted what Wiki put in their doc

 

any idea hwo to fix this?

 

jeff

Link to comment
Share on other sites

my line says:

 

for ($i=0, $n=sizeof($countries); $i<$n; $i++) {

$countries_array = array(array('id' => '223', 'text' => 'United States'));

}

 

You changed the wrong line that begins with $countries_array (you do not change the one in the loop!)...the entire function should look like this:

 

  function tep_get_country_list($name, $selected = '', $parameters = '') {
   $countries_array = array(array('id' => '223', 'text' => 'United States'));
   $countries = tep_get_countries();

   for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
     $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
   }

   return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
 }

 

HTH

Link to comment
Share on other sites

that code still didn't work..

 

I re-uploaded the original with no changes and the error messages are gone..

 

here is what I have, what needs to be changed?

 

 

// Creates a pull-down list of countries

function tep_get_country_list($name, $selected = '', $parameters = '') {

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$countries = tep_get_countries();

 

for ($i=0, $n=sizeof($countries); $i<$n; $i++) {

$countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);

}

 

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);

}

?>

 

can you put it where I can just copy/paste so I don't type something wrong.

do any other files need to be modified to make this work?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...