Forums / Templates, Stylesheets, Page Layout / blank login page and add to cart doesn't work

blank login page and add to cart doesn't work

Locked

Views: 6,929

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
18 Apr 2008, 9:16 PM
#1
hotshotp2 avatar

hotshotp2

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

blank login page and add to cart doesn't work

add to cart button doesn't work and logging in gives me a blank page. These are the error messages I'm getting... can anyone help?
There aren't any spaces that I can find at the beginning of the functions_general.php file

[18-Apr-2008 17:02:25] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/content/h/o/t/hotshotp2/html/includes/functions/functions_general.php:1) in /home/content/h/o/t/hotshotp2/html/includes/functions/sessions.php on line 108
[18-Apr-2008 17:02:25] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/o/t/hotshotp2/html/includes/functions/functions_general.php:1) in /home/content/h/o/t/hotshotp2/html/includes/init_includes/init_templates.php on line 152
[18-Apr-2008 17:02:26] PHP Warning: session_regenerate_id() [<a href='function.session-regenerate-id'>function.session-regenerate-id</a>]: Cannot regenerate session id - headers already sent in /home/content/h/o/t/hotshotp2/html/includes/functions/sessions.php on line 167
[18-Apr-2008 17:02:26] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/o/t/hotshotp2/html/includes/functions/functions_general.php:1) in /home/content/h/o/t/hotshotp2/html/includes/functions/functions_general.php on line 85

18 Apr 2008, 9:50 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: blank login page and add to cart doesn't work

Might look at this as it might be related
https://www.zen-cart.com/tutorials/index.php?article=97

Zen-Venom Get Bitten

18 Apr 2008, 11:57 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: blank login page and add to cart doesn't work

Looks to me as though you might have some inappropriate characters at the start of your functions_general.php file.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Apr 2008, 6:04 AM
#4
hotshotp2 avatar

hotshotp2

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Re: blank login page and add to cart doesn't work

Thanks guys, the fix cache key didn't work.

When I open the functions_general.php file in microsoft expression, on the design page, i.e. what you see in browser has the following:

/si", ' ', $clean_it); } // remove any double-spaces created by cleanups: while (strstr($clean_it, ' ')) $clean_it = str_replace(' ', ' ', $clean_it); // remove other html code to prevent problems on display of text $clean_it = strip_tags($clean_it); return $clean_it; } //// // find module directory // include template specific immediate /modules files // new_products, products_new_listing, featured_products, featured_products_listing, product_listing, specials_index, upcoming, // products_all_listing, products_discount_prices, also_purchased_products function zen_get_module_directory($check_file, $dir_only = 'false') { global $template_dir; $zv_filename = $check_file; if (!strstr($zv_filename, '.php')) $zv_filename .= '.php'; if (file_exists(DIR_WS_MODULES . $template_dir . '/' . $zv_filename)) { $template_dir_select = $template_dir . '/'; } else { $template_dir_select = ''; } if ($dir_only == 'true') { return $template_dir_select; } else { return $template_dir_select . $zv_filename; } } //// // find template or default file function zen_get_file_directory($check_directory, $check_file, $dir_only = 'false') { global $template_dir; $zv_filename = $check_file; if (!strstr($zv_filename, '.php')) $zv_filename .= '.php'; if (file_exists($check_directory . $template_dir . '/' . $zv_filename)) { $zv_directory = $check_directory . $template_dir . '/'; } else { $zv_directory = $check_directory; } if ($dir_only == 'true') { return $zv_directory; } else { return $zv_directory . $zv_filename; } } // check to see if database stored GET terms are in the URL as $_GET parameters function zen_check_url_get_terms() { global $db; $zp_sql = "select * from " . TABLE_GET_TERMS_TO_FILTER; $zp_filter_terms = $db->Execute($zp_sql); $zp_result = false; while (!$zp_filter_terms->EOF) { if (isset($_GET[$zp_filter_terms->fields['get_term_name']]) && zen_not_null($_GET[$zp_filter_terms->fields['get_term_name']])) $zp_result = true; $zp_filter_terms->MoveNext(); } return $zp_result; } // replacement for fmod to manage values < 1 function fmod_round($x, $y) { $x = strval($x); $y = strval($y); $zc_round = ($x1000)/($y1000); $zc_round_ceil = (int)($zc_round); $multiplier = $zc_round_ceil * $y; $results = abs(round($x - $multiplier, 6)); return $results; } //// // return truncated paragraph function zen_truncate_paragraph($paragraph, $size = 100, $word = ' ') { $zv_paragraph = ""; $word = explode(" ", $paragraph); $zv_total = count($word); if ($zv_total > $size) { for ($x=0; $x < $size; $x++) { $zv_paragraph = $zv_paragraph . $word[$x] . " "; } $zv_paragraph = trim($zv_paragraph); } else { $zv_paragraph = trim($paragraph); } return $zv_paragraph; } /** * return an array with zones defined for the specified country / function zen_get_country_zones($country_id) { global $db; $zones_array = array(); $zones = $db->Execute("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' order by zone_name"); while (!$zones->EOF) { $zones_array[] = array('id' => $zones->fields['zone_id'], 'text' => $zones->fields['zone_name']); $zones->MoveNext(); } return $zones_array; } /* * return an array with country names and matching zones to be used in pulldown menus / function zen_prepare_country_zones_pull_down($country_id = '') { // preset the width of the drop-down for Netscape $pre = ''; if ( (!zen_browser_detect('MSIE')) && (zen_browser_detect('Mozilla/4')) ) { for ($i=0; $i<45; $i++) $pre .= '##'; } $zones = zen_get_country_zones($country_id); if (sizeof($zones) > 0) { $zones_select = array(array('id' => '', 'text' => PLEASE_SELECT)); $zones = array_merge($zones_select, $zones); } else { $zones = array(array('id' => '', 'text' => TYPE_BELOW)); // create dummy options for Netscape to preset the height of the drop-down if ( (!zen_browser_detect('MSIE')) && (zen_browser_detect('Mozilla/4')) ) { for ($i=0; $i<9; $i++) { $zones[] = array('id' => '', 'text' => $pre); } } } return $zones; } /* * supplies javascript to dynamically update the states/provinces list when the country is changed * TABLES: zones * * return string / function zen_js_zone_list($country, $form, $field) { global $db; $countries = $db->Execute("select distinct zone_country_id from " . TABLE_ZONES . " order by zone_country_id"); $num_country = 1; $output_string = ''; while (!$countries->EOF) { if ($num_country == 1) { $output_string .= ' if (' . $country . ' == "' . $countries->fields['zone_country_id'] . '") {' . "\n"; } else { $output_string .= ' } else if (' . $country . ' == "' . $countries->fields['zone_country_id'] . '") {' . "\n"; } $states = $db->Execute("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . $countries->fields['zone_country_id'] . "' order by zone_name"); $num_state = 1; while (!$states->EOF) { if ($num_state == '1') $output_string .= ' ' . $form . '.' . $field . '.options[0] = new Option("' . PLEASE_SELECT . '", "");' . "\n"; $output_string .= ' ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $states->fields['zone_name'] . '", "' . $states->fields['zone_id'] . '");' . "\n"; $num_state++; $states->MoveNext(); } $num_country++; $countries->MoveNext(); $output_string .= ' hideStateField(' . $form . ');' . "\n" ; } $output_string .= ' } else {' . "\n" . ' ' . $form . '.' . $field . '.options[0] = new Option("' . TYPE_BELOW . '", "");' . "\n" . ' showStateField(' . $form . ');' . "\n" . ' }' . "\n"; return $output_string; } //// // compute the days between two dates function date_diff($date1, $date2) { //$date1 today, or any other day //$date2 date to check against $d1 = explode("-", $date1); $y1 = $d1[0]; $m1 = $d1[1]; $d1 = $d1[2]; $d2 = explode("-", $date2); $y2 = $d2[0]; $m2 = $d2[1]; $d2 = $d2[2]; $date1_set = mktime(0,0,0, $m1, $d1, $y1); $date2_set = mktime(0,0,0, $m2, $d2, $y2); return(round(($date2_set-$date1_set)/(6060*24))); } /** * strip out accented characters to reasonable approximations of english equivalents / function replace_accents($s) { $s = htmlentities($s); $s = preg_replace ('/&([a-zA-Z])(uml|acute|elig|grave|circ|tilde|cedil|ring|quest|slash|caron);/', '$1', $s); $s = html_entity_decode($s); return $s; } /* * function to override PHP's is_writable() which can occasionally be unreliable due to O/S and F/S differences * attempts to open the specified file for writing. Returns true if successful, false if not. * if a directory is specified, uses PHP's is_writable() anyway * * @var string * @return boolean */ function is__writeable($filepath) { if (is_dir($filepath)) return is_writable($filepath); $fp = @fopen($filepath, 'a'); if ($fp) { @fclose($fp); return true; } return false; } ///////////////////////////////////////////// //// // call additional function files // prices and quantities require(DIR_WS_FUNCTIONS . 'functions_prices.php'); // taxes require(DIR_WS_FUNCTIONS . 'functions_taxes.php'); // gv and coupons require(DIR_WS_FUNCTIONS . 'functions_gvcoupons.php'); // categories, paths, pulldowns require(DIR_WS_FUNCTIONS . 'functions_categories.php'); // customers and addresses require(DIR_WS_FUNCTIONS . 'functions_customers.php'); // lookup information require(DIR_WS_FUNCTIONS . 'functions_lookups.php'); //// ///////////////////////////////////////////// ?>

normally this is blank... however, if I delete this I get an internal 500 server error. Any thoughts?
the function itself looks OK to me.

19 Apr 2008, 6:19 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: blank login page and add to cart doesn't work

hotshotp2:

aThese are the error messages I'm getting... can anyone help?
There aren't any spaces that I can find at the beginning of the functions_general.php file

[18-Apr-2008 17:02:25] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/content/h/o/t/hotshotp2/html/includes/functions/functions_general.php:1) in ...

kuroi:

Looks to me as though you might have some inappropriate characters at the start of your functions_general.php file.Kuroi is correct.

hotshotp2:

When I open the functions_general.php file in microsoft expression, on the design page, i.e. what you see in browser has the following:

/si", ' ', $clean_it); } // remove any double-spaces created b...

...

normally this is blank... however, if I delete this I get an internal 500 server error. Any thoughts?
the function itself looks OK to me.:eek: "Microsoft Expression"? in "design" mode?

  1. Microsoft products traditionally suck at PHP code
  2. "design mode" should not be used for managing PHP files.

Try a more reliable PHP editor ... such as Notepad++ (notepad-plus.sf.net) which is free, fast, and easy to use. And a reliable FTP program ... such as perhaps FileZilla (filezilla.sf.net) for uploading and downloading files.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Apr 2008, 7:53 AM
#6
hotshotp2 avatar

hotshotp2

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Re: blank login page and add to cart doesn't work

OK I solved the problems by reinstalling in a separate directory and copying over the files... I could not see the difference between the two but it now works.

Thanks for your advice folks, appreciated.

My other problem is the add to cart link seems to have been broken. Hovering the mouse over the add to cart icon doesn't give you an address at the bottom of explorer and clicking it does nothing whatsoever... how do I resolve this which file should the link be in and where should it point to?

Thanks

19 Apr 2008, 11:41 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: blank login page and add to cart doesn't work

Add-to-Cart isn't a "URL" to click on. It's a form-submit button, for which there is no URL shown on "hover".
What's the URL where we can see what you've done?
What settings have you changed in the admin since installing?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Apr 2008, 12:07 PM
#8
hotshotp2 avatar

hotshotp2

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Re: blank login page and add to cart doesn't work

http://www.videogames-world.com

I've not changed any settings in admin that I'm aware of that have anything to do with the add to cart.

I've installed another zencart on another directory and compared the admin pages, they're all the same and the add to cart when you hover over it has a URL link at the bottom of the page using the default zencart.

it's at http://www.videogames-world.com/zc
with a test product.

19 Apr 2008, 12:24 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: blank login page and add to cart doesn't work

I selected your test product - clicked add to cart and it was added to the cart...

Zen-Venom Get Bitten

19 Apr 2008, 12:38 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: blank login page and add to cart doesn't work

ditto - I can add to cart just fine on your site ... on both sites.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Apr 2008, 1:11 PM
#12
hotshotp2 avatar

hotshotp2

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Re: blank login page and add to cart doesn't work

You can on the test, not the real one! Or at least I can't.

that was my original question... why can't I on the real one?