PHP Scripts Development » PHP Classes Support Forum » Db_cart class Support forum

parse error DB_cart Class

(12 posts)

Great offers not only for geeks!


  1. User has not uploaded an avatar

    damen18
    Member

    Hello,

    I want to check the stock, but i can't get it to work. I've added require($_SERVER['DOCUMENT_ROOT']."/classes/db_cart/db_cart_4stock.php"); in each file but i get an error: "Parse error: parse error, expectingT_OLD_FUNCTION' or T_FUNCTION' orT_VAR' or `'}'' in d:\program files\easyphp1-8\www\classes\db_cart\db_cart_4stock.php on line 21"

    What else do I have to do to get it to work?

    Posted 7 months ago #
  2. looks like that one curly bracket was gone:

    check line 15

    if ($test_stock) {
    	if (!empty($_SESSION['checked_cart'])) {
    		header("Location: ".$stock_main_page);
    		exit;
    	}
    }
    Posted 7 months ago #
  3. User has not uploaded an avatar

    damen18
    Member

    Thanx for your reply, i didn't see it. But now I have another problem:

    Notice: Constant ORDERS already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 5

    Notice: Constant ORDER_ROWS already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 6

    Notice: Constant SHIP_ADDRESS already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 7

    Notice: Constant CURRENCY already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 10

    Notice: Constant INCL_VAT already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 11

    Notice: Constant VAT_VALUE already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 12

    Notice: Constant SITE_MASTER already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 13

    Notice: Constant SITE_MASTER_MAIL already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 14

    Notice: Constant MAIL_ENCODING already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 15

    Notice: Constant DATE_FORMAT already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 16

    Notice: Constant RECOVER_ORDER already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 17

    Notice: Constant VALID_UNTIL already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 18

    Notice: Constant SHOW_CONTINUE already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 19

    Notice: Constant CART_CLASS_PATH already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 21

    Notice: Constant PROD_IDX already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 37

    Notice: Constant CHECKOUT already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 38

    Notice: Constant CONFIRM already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 39

    Notice: Constant CONTINUE_SCRIPT already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 40

    Notice: Constant ORDER_TMPL already defined in d:\program files\easyphp1-8\www\classes\db_cart\db_config.php on line 43

    Fatal error: Cannot redeclare class db_cart in d:\program files\easyphp1-8\www\classes\db_cart\db_cart_class.php on line 25

    I can't figure out how to remove this, what did I do wrong?

    Posted 7 months ago #
  4. you have included the db_config.php file twice (or more)

    use include_once or require_once instead

    Posted 7 months ago #
  5. User has not uploaded an avatar

    damen18
    Member

    i've included db_cart_4stock.php also in db_cart_example.php. That was the problem, but now i'm having 2 problems and they are all in db_cart_checkout_stock_example.php.

    1. When I order something it has to mail to an emailaddress, but i'm getting this error:
    Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in d:\program files\easyphp1-8\www\classes\db_cart\db_cart_class.php on line 428

    I also use your attachmailer class.

    2. Notice: Undefined variable: stock_array in d:\program files\easyphp1-8\www\classes\db_cart\db_cart_checkout_stock_example.php on line 140

    When this will be fixed i think it will work perfectly. Thank you for your reply and good support

    Posted 7 months ago #
  6. sounds like a php installation on a local windows testing server :D

    you need a mail server, what is your config?

    Posted 7 months ago #
  7. User has not uploaded an avatar

    damen18
    Member

    I don't have a mailserver, which one do you recommend?

    Yes, you are right....i'm using vista with easyphp :D

    Posted 7 months ago #
  8. try to use the smtp server from you ISP

    Posted 7 months ago #
  9. User has not uploaded an avatar

    damen18
    Member

    My ISP blocked port 25 so I can't use it. I use Tele2 as ISP. Do you have another idea?

    Do you also know what I can do with my second problem? (see previous post)

    Thanx again for your support!

    Posted 7 months ago #
  10. I think most of the problems are related to the first problem, do you have a hosting account where you can test your php scripts?

    Posted 7 months ago #

RSS feed for this topic

Reply »

You must log in to post.