Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding PHP into HTML

    I am building a website for a business and I have all of the code written for the website (in HTML) and all the code for the shopping cart (in PHP). I was just wondering if any one could tell me where I would put the shopping PHP within the HTML.

  • #2
    Banned
    Join Date
    Mar 2013
    Posts
    139
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Your html will have somewhere buttons or links to prompt the user to add the respective product for that button or link to their cart. The button or link calls the php scripr handling your cart and passes to it some unique id for the product which is then added to the user's cart by your php code.

    It would help if you post the html which you have to prompt the user to add an item to their cart.

  • #3
    Banned
    Join Date
    Mar 2013
    Posts
    139
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Where you have your shopping cart php code also depends on how the php code is constructed. Personally I would suggest setting up your cart code as a php object which can be kept completely separate from any html code. You then simply instantiate an instance of the shopping cart php class and send items to it from your web page.

    If you want to embed the cart php code into your web page code then how/where you do it depends on how you are getting the user to add an item to their cart. Post the hrml code prompting the user to add an item to their cart.


  •  

    Posting Permissions

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