Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/17/2022 in all areas

  1. Let's see if we can clarify some things about this project. From reading your initial post, and looking at your link, here is my interpretation of what you are asking: It appears that what you want is a shopping cart You have arrived at an html form While this may have started with excel, that is not relevant to what you eventually arrived at, which again is the simple html form and associated javascript Now that you have this form and javascript you want to expand its functionality The drop down lists of the form should be sourced from server side data rather than being static data in the html While not clear, you may desire some interactivity in the form based upon selections in the drop downs. You desire to have server-side processing of an order on your site which includes integration of a payment gateway If these requirements are correct, then my initial response to you is that this is a non-trivial set of requirements. It most certainly can be accomplished using HTML, Javascript and PHP, but regardless of the tech stack involved, this is a significant project. As a point of clarification, HTTP protocol is based on request & response. The client makes a request for a resource (URL). This request can be of a few different types. In the case of a form like the one you mocked up, that request is typically going to be a POST. When the server receives a request, it then returns a response. Typically that response is the HTML that is then assembled by the client/browser. At that point, there is no connection between the client and server. The connection to the server is closed, and interaction with the html page is happening on the client's browser. All javascript in the page is running inside the browser. These basics limit the level of interactivity possible in a web application. "Ajax" was an extension to the javascript standard intended to allow javascript in a fully rendered html page, to be able to make additional requests, without the client having to do another full HTTP request, which in turn would require the browser to have to reinterpret and rebuild the page. Ajax isn't a separate language -- it's just an extension to the built in javascript api that the browser provides. It allows a rendered html page to include javascript code that can make network requests which typically will be for the purpose of getting data from the server. It is nothing more nor less than that. It's also important to understand that traditional pre-ajax web applications were still capable of doing everything that ajax does -- only in a manner where all interaction required a normal HTTP request/response cycle. You can have a form, and when the user changes a drop down value, the form can be submitted and the desired HTML/javascript/css source can be returned based on the modifications made to the form. It's just not as efficient or user friendly as a page that incorporates ajax, and additional javascript code to manipulate the browser's DOM using data that may have been returned from the ajax call(s). Putting the complexity question aside, it would help to break things down into individual parts. For each drop down, what is the source of the data? Is it coming from a database? Then you need a PHP script that returns the drop down data and returns it, preferably in json format. You then need javascript code that can take the json data and recompute the relevant DOM object (in this example, the drop down). You also clearly will need a serverside script that accepts the submitted form, and if everything checks out, saves the order, and then makes the payment gateway request for payment processing. The status of that payment gateway request from the PHP script to the payment gateway then needs to be saved in the order, and a response returned to the client. None of this is actually stated in your question, so I'm extrapolating additional stages and steps that I know exist for any shopping cart/ecommerce application. Again this is a big project, with a lot of complexity that requires a solid foundational understanding of html/javascript with ajax/json/http protocol/PHP network client request. Phpfreaks exists to help people of any level work towards their goals, and aims to help advise and educate. I hope this might give you a better idea of what you will need to accomplish from a technical standpoint, and that this is not a simple project for which a simple solution exists. Because ecommerce is non-trivial, often the best way to get to a solution, is to utilize a commerce platform like Shopify, or a CMS like wordpress with an extension like woocommerce.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.