Creating a dynamic one page web application [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to make a web application (PHP) that will have overlay container that contain dynamic fields/forms.
I would like the user to complete the form but not be taken away from the main part of the page.
Imagine, browsing a website and reporting a page error into an overlay but not being taken away from the page you were reading.
Also, is it possible to make the form multiple parts/pages, such as user clicks next button and the next part of the form is presented?

Nice example of this type of web app here, with some useful tips:
The Future of Web Apps - Single Page Applications

What you are looking for is called ajax.
Using jQuery you could easily create the kind of form you want where the whole page is not reloaded upon submission.
Going into more details, check out jQuery UI. There a set of usually very simple to implement power tools to help create a dynamic webpage.
So jQuery UI stuff for layout (look at tabs) and ajax through jQuery for your communication with the server (PHP).

I just finished building a single-page application using the Yii Framework for PHP and Jquery (Jquery UI as well).
What I have learned is that Jquery isn't adequate enough to handle a true single-page application.
What you need to use is a library that handles a lot of issues that will come up whilst building SPA's and frees you from having to do a lot of DOM based manipulations.
Instead what you'd end up doing is actually write a true application and let the 'library' handle those aspects for you.
One library that comes to mind is AngularJS.
Hope this helps.

Related

Laravel 6 Without Blade [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have this Advanced Programming assignment building an e-commerce website. I am using Laravel 6. However, the assignment states that the server must be independent of the client, therefore I cannot use blade. Instead all the client-side must only comprise HTML5, CSS and Javascript. How can I go about linking my backend with my frontend? I have tried searching online for an answer but since I'm very new to Laravel, I don't quite understand how to go about this. Could you guys point me the right direction?
What your assignment is asking is to create a restless backend API and frontend to consume it. When you are going to access your site you will be contacting the frontend and then the frontend is going to retrieve what info it needs from the backend and display them to you. Usually, the backend and frontend run on different servers (eg a php server for the backend and node.js for the frontend) but this isn't always the case.
Basically he wants two separate projects the backend and the frontend.
The frontend can be created by using just html-css-javascript or by using react.js, vue.js or any other library for building ui's.
In both cases you will use ajax call to get the info from your backend (in your case the laravel app) to the frontend.
Check this tutorial for building a backend api with laravel.
Check this tutorial for consuming api in html.
Check this tutorial for consuming api with vue.js

vuejs prerendering with php dynamic content [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a Question about prerendering a vue app built with php ( laravel or pure php it doesn't matter )
My question is how really prerendering work with dynamic content For example:
when I make a blog with vue and php to show post I make Ajax Request in my vue app.. how google bots and other web crawlers will read my site content
Thanks in advance
The concept of prerendering is most used in SPA. It consists of rendering a placeholder or dynamic elements until the JavaScript code makes the necessary Ajax requests and uses the requested data to render new elements.
You can use prerendering to server-side render the HTML that you want to make indexable for the search engines. Using PHP and Vue.js to achieve that can be complex because you need to have a view for the PHP template engine and another one for Vue.js. It can be difficult to maintain when the application grows.
I've used hypernova to achieve that (Laravel and Vue.js). I wrote a couple of articles about it
https://dev.to/phillipgd1992/universal-rendering-in-laravel-using-vue-js-and-ara-framework-5amd
https://itnext.io/strangling-a-monolith-to-micro-frontends-decoupling-presentation-layer-18a33ddf591b
You can read more about prerender, ssr, csr and universal rendering here:
https://developers.google.com/web/updates/2019/02/rendering-on-the-web#seo
Let me know if I can help you with something else.

Need help choosing languague for this project [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
first of all, sorry for bad english. Please correct me if I write something wrong!
I'm a "noob" in the programing scene, so I need some help. I want to help my mom to automate a process at her bussines. The core thing I need to do are this:
I need to extract info from a webpage (it's an php webpage), and compare the products that arrive with the one's displayed in the webpage. I want to do that scanning the bar codes of the products (I've a database of all the products barcodes). Then I need to save the comparission in a file just to make sure that everything is ok. I want to know wich languague is better for my case. (Then I will try to do it, fail, learn from my mistakes and then have some "stable" program to do this)
TL;DR: I recive products, I check if everything arrived in a website. I want to do that using bar codes and "automate" the process. I want to know wich languague is better for my case.
Thank you!!
As others pointed out in the coments, there is not best language, you need to chose the one that fits you.
But let me give you some recommendations on what might work.
You said that the site is already in PHP, that's the backend language. You should keep using it since a part of the site is already built with it. Other options are JavaScript using NodeJS, Python, Java, Ruby.
You can do almost everything you need in the backend (server side) using PHP, but some things might be better to solve them in the client side (front end) using JavaScript, is the default language that runs on the browsers.
Usually you use the backend language to serve pages, interact with a database, send data to the client. And the front end (JavaScript) to add dynamic functionality to your website.
Web apps used to depend a lot on the backend, reloading the page for every action, sending a lot of information back and forth.
The modern aproach to build web apps (like yours) is a bit more dependant on JavaScript. You load the page once and then just do AJAX (Asynchronous JavaScript and XML) requests to the server asking just for the information you need and showing it dynamicly with out reloading and having to load the HTML/CSS all over again. Many frameworks like Angular, React (with its whole ecosystem), help you a lot with it.
Read more about it here.
EDIT: just to clirify, I answered with some recommendations and opinions because it is what the question asks for.

how to transffer data from website to android app and enable or disable it from website only? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My team is going to make application in android having quizzes on mobile whose questions,options would be entered from my website. I want to be able to enable the new quiz from website end.
Going to code website in PHP. I'm good at wordpress so just wondering if I can do this in that only or not as I don't in what form I have to convert my data so that android can get it and use it in "native app"(not browser!!).
my job is only the website part I know how to make pages but don't know in what form I have to give quiz data and how to control enabling and disabling the quiz in mobile app
thanks for the help in advance...
There are several ways you can transfer data through different applications/technology.
Some ways that appear to be straight ahead to me:
The Android App can parse your generated HTML file directly and extract the questions and the options parsing the HTML tags.
The Android App can also connect to your website DB and get the information directly from that.
You can also expose your data creating a services using WebServices or ODATA, for example.
I have to say I've only ever dealt with Cordova for writing apps but if Cordova can do it...
In the app I wrote for an internal application I used an AJAX call (Cordova uses JS + HTML as its interface). My PHP server then returned a response my app could use (in my case, JSON) It sounds like this is what you want to know. Now your app team will have to tell you what format to send your response but it's possible to have apps do this.
This would have to be done in PHP(EDIT: or any other technology as such) since your team is working in PHP already. To enable/disable the "new quiz", the app would have to query the server for this information, which would come from the Database.

chat rooms implementation [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Can you give me an idea on how to implement chat room using PHP and MySQL?
You will probably want to use AJAX or if not that, Javascript with timer to make chat appear instant or with polled updates.
(Chat text data fetched and displayed.) Form frontend fields accepts chat input
Chat input sent to server via form. AJAX waits to receive data to update chat text display.
Server updates a data queue (example - PHP dumps to MySQL). Data sent back to frontend via AJAX wrappers
Repeat
There are lots of tutorials on creating something like this - including a number with AJAX i/o - http://css-tricks.com/chat2/
The best you can do with php and mysql is create a bulletin board kind of system where people add comments to a "channel", then reload the page to update.
In general, I think, it is a bad idea to use PHP for this kind of project. Every client hast to reload the page (mentioned bulletin board e. g.) every few seconds to get informed about updates.
If you want to code in PHP and a little javascript, try Jaxl library Web Chat sample application. Can be worked upon to build a full fledged chat systems. http://github.com/abhinavsingh/JAXL. XMPP protocol is the way today, when it comes to chat client :D

Categories