Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Location
    Swellyville
    Posts
    2,340

    Parsing error in order page...going crazy!

    HostFrog utilizes ModernBill. We are creating our own order page (just passing variables). However, when the order page is brought up in a browser we get an error message like this:


    Parse error: syntax error, unexpected '[', expecting ')' in /home/hostfrog/public_html/secure/order3.php on line 656

    Here is the Array:

    <?PHP
    Array
    (
    [num_items] => 0
    [domains] => Array
    (
    [domain.tld] => Array
    (
    [0] => nameserver
    [1] => nameserverdomain
    [2] => org
    [3] => 1
    )
    )
    [packages] => Array
    (
    [0] => Array
    (
    [0] => 8
    [1] => 9
    [2] => 10
    [3] => 11
    )
    )
    [addons] => Array (optional)
    (
    [pack_id] => Array (must be the valid package id)
    (
    [0] => pack_id (valid package id)
    [1] => pack_plan (billing cycle) [1,3,6,12,24]
    )
    )
    [coupons] => coupon_code (optional)
    [affiliate] => affiliate_code (optional)
    [v] => 1
    )
    ?>

    What is not right about this?
    <<< Please see Forum Guidelines for signature setup. >>>

  2. #2
    Did you directly use all the given code above into your scripts?

    Basically what i see is that you need to remove those "(optional)" and also add "," after the array value

    eg : [coupons] => coupon_code,

    hope this helps
    UltraUnix Internet Services
    Quality service since 2000!
    Reliability . Simplicity . Affordability

  3. #3
    Join Date
    Feb 2006
    Location
    Swellyville
    Posts
    2,340
    Tried this with still no luck Also there is a different $cart that I can use, however... serializing the data is the hard part. I have no clue what that is. Reading the material about how to makes me go cross-eyed. Any suggestions on that?
    <<< Please see Forum Guidelines for signature setup. >>>

  4. #4
    just realize that your 1st Array didnt have any variable associate with it. the 1st line

    $myvar = Array (
    [num_items] => 0,
    ...
    )

    Also try using print_r($myvar) to see what's contained in an array.

    Some notes on serialize, taken from php manual
    serialize() returns a string containing a byte-stream representation of value that can be stored anywhere.
    This is useful for storing or passing PHP values around without losing their type and structure.
    UltraUnix Internet Services
    Quality service since 2000!
    Reliability . Simplicity . Affordability

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •