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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding PHP code to a HTML script

    I posted this in the HTML and PHP direct threads, but hopefully posting it here will help get a quicker response. 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
    Quote Originally Posted by gavinshaw View Post
    I posted this in the HTML and PHP direct threads, but hopefully posting it here will help get a quicker response.
    Surely x-posting like you have is against the rules. It is on other sites.

    If you don't like the responses you got in your other threads on this topic, x-posting is not the way to get people to help you. Fwiw here is what I said in your other thread.
    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
    •