Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

need to add this to the home.php

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-14-2004, 09:17 AM
 
towbar towbar is offline
 

Member
  
Join Date: Feb 2004
Location: UK
Posts: 20
 

Default need to add this to the home.php

I need to add this to the home.php can anybody help

<?php require("stats/spider_trap.php"); ?>

it for a stats program that i would like to run i have tried to add it but just get errors i tried include but errors like below

I get this error at the bottom of the page (when I try to include the require function directly in the PHP code):



INVALID SQL: 1046 : No Database Selected
SQL QUERY FAILURE: UPDATE xcart_sessions_data SET data='a:24:{s:11:\"editor_mode\";s:0:\"\";s:8:\"is _robot\";s:1:\"N\";s:5:\"robot\";s:0:\"\";s:11:\"i s_location\";s:1:\"Y\";s:9:\"adaptives\";a:12:{s:4 :\"isJS\";s:1:\"Y\";s:5:\"isDOM\";s:1:\"Y\";s:8:\" isStrict\";s:0:\"\";s:6:\"isJava\";s:1:\"Y\";s:7:\ "browser\";s:4:\"MSIE\";s:7:\"version\";s:3:\"6.0\ ";s:8:\"platform\";s:5:\"Win32\";s:8:\"isCookie\"; s:1:\"Y\";s:8:\"screen_x\";s:4:\"1280\";s:8:\"scre en_y\";s:4:\"1024\";s:7:\"plugins\";a:1:{i:0;s:0:\ "\";}s:14:\"is_first_start\";s:0:\"\";}s:26:\"sess ion_failed_transaction\";s:0:\"\";s:16:\"add_to_ca rt_time\";s:0:\"\";s:17:\"always_allow_shop\";s:0: \"\";s:16:\"current_url_page\";s:37:\"https://www.towbar.biz/home.php?cat=0\";s:12:\"current_date\";i:110304513 9;s:19:\"session_create_date\";i:1103045135;s:4:\" wlid\";s:0:\"\";s:10:\"js_enabled\";s:1:\"Y\";s:11 :\"top_message\";s:0:\"\";s:15:\"referer_session\" ;s:30:\"https://www.towbar.biz/stats2/\";s:5:\"login\";s:0:\"\";s:10:\"login_type\";s:0: \"\";s:6:\"logged\";s:0:\"\";s:4:\"cart\";s:0:\"\" ;s:12:\"stats_pageid\";s:1:\"2\";s:15:\"stats_page _time\";i:1103045139;s:18:\"stats_pages_string\";s :1:\"2\";s:19:\"stats_transactionid\";s:0:\"\";s:2 2:\"stats_transaction_step\";s:0:\"\";}' WHERE sessid='82c33cb805380e6f658161d1fe3492e3'



Which means that the xcart script, you have managing your site, is trying to save the session info into a database but encounters problems when it is trying to save that information, which it does not understand. In a real world this should not happen. It should work independently and save only what it creates but this is not your case. runnig 4.0.8
__________________
andy

X cart 5 ver 5.0.14
PHP: 5.3.2-1ubuntu4.24 details >>
MySQL server: 5.1.67-0ubuntu0.10.04.1 (InnoDB engine support enabled)
Web server: Apache
Operating system: Linux
XML parser: found
GDLib: found (2.0)
Translation driver: Database
Curl version: 7.19.7
Reply With Quote
  #2  
Old 12-14-2004, 10:19 AM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Try:
Code:
{include file="stats/spider_trap.php"}
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #3  
Old 12-14-2004, 12:32 PM
 
towbar towbar is offline
 

Member
  
Join Date: Feb 2004
Location: UK
Posts: 20
 

Default

Quote:
Originally Posted by Emerson
Try:
Code:
{include file="stats/spider_trap.php"}

No just got a error
__________________
andy

X cart 5 ver 5.0.14
PHP: 5.3.2-1ubuntu4.24 details >>
MySQL server: 5.1.67-0ubuntu0.10.04.1 (InnoDB engine support enabled)
Web server: Apache
Operating system: Linux
XML parser: found
GDLib: found (2.0)
Translation driver: Database
Curl version: 7.19.7
Reply With Quote
  #4  
Old 12-14-2004, 12:32 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

and the error is exactly?
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #5  
Old 12-14-2004, 12:38 PM
 
towbar towbar is offline
 

Member
  
Join Date: Feb 2004
Location: UK
Posts: 20
 

Default

Quote:
Originally Posted by Emerson
and the error is exactly?




Parse error: parse error, unexpected T_REQUIRE in /usr/local/etc/httpd/sites/towbar.biz/htdocs/home.php on line 44

include "stat2/spider_trap.php" not like "=" or the {}

Hope this helps
__________________
andy

X cart 5 ver 5.0.14
PHP: 5.3.2-1ubuntu4.24 details >>
MySQL server: 5.1.67-0ubuntu0.10.04.1 (InnoDB engine support enabled)
Web server: Apache
Operating system: Linux
XML parser: found
GDLib: found (2.0)
Translation driver: Database
Curl version: 7.19.7
Reply With Quote
  #6  
Old 12-14-2004, 12:44 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Sorry, I just realised you were tying to add the code to the home.php file and no the tpl file.

You could try to add the following... right before the last ?> in home.php

Quote:
require("stats/spider_trap.php");
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #7  
Old 12-14-2004, 12:51 PM
 
towbar towbar is offline
 

Member
  
Join Date: Feb 2004
Location: UK
Posts: 20
 

Default

Quote:
Originally Posted by Emerson
Sorry, I just realised you were tying to add the code to the home.php file and no the tpl file.

You could try to add the following... right before the last ?> in home.php

Quote:
require("stats/spider_trap.php");

the error at the bottom of the page

INVALID SQL: 1046 : No Database Selected
SQL QUERY FAILURE: UPDATE xcart_sessions_data SET data='a:24:{s:11:\"editor_mode\";s:0:\"\";s:8:\"is _robot\";s:1:\"N\";s:5:\"robot\";s:0:\"\";s:11:\"i s_location\";s:1:\"Y\";s:9:\"adaptives\";a:12:{s:4 :\"isJS\";s:1:\"Y\";s:5:\"isDOM\";s:1:\"Y\";s:8:\" isStrict\";s:0:\"\";s:6:\"isJava\";s:1:\"Y\";s:7:\ "browser\";s:4:\"MSIE\";s:7:\"version\";s:3:\"6.0\ ";s:8:\"platform\";s:5:\"Win32\";s:8:\"isCookie\"; s:1:\"Y\";s:8:\"screen_x\";s:4:\"1024\";s:8:\"scre en_y\";s:3:\"768\";s:7:\"plugins\";a:1:{i:0;s:0:\" \";}s:14:\"is_first_start\";s:0:\"\";}s:26:\"sessi on_failed_transaction\";s:0:\"\";s:16:\"add_to_car t_time\";s:0:\"\";s:17:\"always_allow_shop\";s:0:\ "\";s:16:\"current_url_page\";s:30:\"http://www.towbar.biz/home.php\";s:12:\"current_date\";i:1103060850;s:19 :\"session_create_date\";i:1103055841;s:4:\"wlid\" ;s:0:\"\";s:10:\"js_enabled\";s:1:\"Y\";s:11:\"top _message\";s:0:\"\";s:15:\"referer_session\";s:69: \"XXXX:+++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++\";s:5:\"login\";s:0:\"\";s:1 0:\"login_type\";s:0:\"\";s:6:\"logged\";s:0:\"\"; s:4:\"cart\";s:0:\"\";s:12:\"stats_pageid\";s:1:\" 1\";s:15:\"stats_page_time\";i:1103060850;s:18:\"s tats_pages_string\";s:3:\"2-1\";s:19:\"stats_transactionid\";s:0:\"\";s:22:\"s tats_transaction_step\";s:0:\"\";}' WHERE sessid='2d95166696be309213a0593436f34e04'
__________________
andy

X cart 5 ver 5.0.14
PHP: 5.3.2-1ubuntu4.24 details >>
MySQL server: 5.1.67-0ubuntu0.10.04.1 (InnoDB engine support enabled)
Web server: Apache
Operating system: Linux
XML parser: found
GDLib: found (2.0)
Translation driver: Database
Curl version: 7.19.7
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:44 AM.

   

 
X-Cart forums © 2001-2020