Is php pagination compulsory? - php

sorry if the question seems too idiot. I am student in development. I created a complete php website for posting stitches (with image video and audio) and then retrieving other users opinions on posted stitches. I made mobile ready and all. But I forgot to set pagination while building it. Yes that was not smart at all. Somehow I still don't have any issue with the website cause there are only 20-30 entries in the database. But in the future if I get more entries, will it freeze browsers considering the fact that there is no pagination for limiting query fetching. I'd like you to tell me what will technically happen if I don't set a pagination system.
If it is compulsory to set a pagination system, can you point me a very great and simple pagination tutorial !?
Thank you
EDIT: Ok, thank you for answers, I will set a pagination system for better user experience. Once again, thanks to all of you !!! 😊👍🏾
RE-EDIT:
I did it !!!!!!! I used Ajax. Added a load more button button and refreshes div via Ajax. Merci !!

Pagination plays a very important role in performance and user experience. As you are hitting to database and fetching more rows uses more memory which can slow database. On the other hand browsers can crash with a lot-of records. specially when you are making web services for mobile devices. So it is good practice to use pagination in php to avoid such overhauls of browser and database or any mobile device etc.

Related

How to make an online PHP point of sale (POS) system have offline capability?

I have been working on a POS system in PHP/MySQL and if the customers internet goes down they lose all ability to sell their products.
I will only need basic functionality while in "offline mode" for example selling a product I just need to record the price/qty and product id.
It is possible for me to use the latest browsers so I have been researching HTML5 localStorage, which can store data into the browser session which will work fine if I use AJAX to record the transactions.
But I am not sure exactly how to check that the internet has gone down, how to ensure the client can still see the webpage without getting an error/no connection screen, and how to implement the localStorage functionality to overwrite the regular functionality.
If you can help or have a better way of dealing with this that will be excellent!
Side note: I am considering moving to use this open source point of sale if that helps - http://sourceforge.net/projects/opensourcepos/?source=directory
Thanks
EDIT: Also the search function is used to find all products and is called using AJAX. Is there a way to store the product list (generated from MySQL) locally as well. I could populate a list of all products into the html but if the page is refreshed it will be lost.

PHP displaying page views for gallery style pages

This is really a point me in the right direction question. What path should I take if I want to display the number of page views each gallery page receives?
Retrieve Google Analytics Data via PHP, or
Capture the page views directly on my pages with my own PHP and mySQL setup?
Seems, like number 1 would be the better choice. I just don't know how difficult this option will be. Any insights on this?
Option 2 is definitely simpler.
If you do figure out how to get the page results out of Google Analytics, they will not be up-to-date. It takes Google at least several hours before the page views show up.
That also depends if You want to have info on more questions (statistics). I often use custom setup to track such things cause I can later use some data to do statistics about users actions.
For example, You want to give users (owners of photos) info about witch users (male or female, 30+ or below 30, and so on) are viewing. How many guests, how many registered users. There are tons of data You can retrive by building custom system.
It all depends on what You want to have at the end.
I suspect that if You want to have only raw data about number of users You coud somehow parse data from Google Analytics as well.
And as posted below. Google have to take time to update, custom setup not.

Best way to create a kiosk app displaying a movie and a few contact links?

I'm trying to create a web based welcome display for a building entrance. The project would include:
1) A wmv movie play constantly on the digital display until some visitors touch the screen (this can be played either locally or on the internet, but it has to be able to go to number 2 when visitors touch the screen)
2) A couple of buttons with department names show up for visitors to choose who they are here to see
3) After the visitor touch on one button, an email is sent to the department
4) Thank you page, the site should go back to the number 1) again
My experience is html, css, php, javascript, and some Flash, but I'm open to learn new skills. Can someone please suggest some good ways to build this site? Is there any tutorials or good sites I can learn from, that would be a bonus.
Thanks very much.
Sam :)
Edit:
Thanks very much Vigrond and Lloyd! You guys' answers are equally helpful, so I'll use html5 and javascript.
I have a couple of further questions, I hope you guys or someone can help me. (Any part of questions' help is appreciated)
Since this is going to be a kiosk, the same movie is going to be played constantly, everytime after the customer has contacted us, the 'thank you' page is going to show briefly and go back to the first movie page. My question is how can I not let the movie load again and again everytime when there is a customer? Because the local data space for the display is going to be limited.
I've been thinking if I just create one page for the whole process and use a javascript slide to make each page as a div, so the movie div is going to be hiden so it doesn't need to be reloaded again, would that fix number 1) data space concern?
I'm thinking of using a horizontal slide like http://www.queness.com/post/356/create-a-vertical-horizontal-and-diagonal-sliding-content-website-with-jquery How can I make the last div (thank you) to show about 5 secs and go to the first div (movie) again?
Thanks very much! :)
This can be purely done using html5/javascript (+php for the email sending). Google Chrome also has a -kiosk mode, that will enable fullscreen.
I would probably use HTML5 video, along with something like the jQuery cycle plugin. On the video onclick handler, I would just cycle() to the next 'slide'. You can put in effects such as fadein, fadeout, slide, etc.
If you wanna get fancy, a mobile framework such as jQuery mobile or Sencha mobile may be right up your ally as well, (with aesthetic familiar interfaces and cool transitions)
beside some backend PHP to send email, this trivial app could be built using plain old HTML5, CSS and Javascript.. I wouldn't bloat it with jQuery or jQuery plug-ins unless necessary..
I don't recommend using WMV content, though - this proprietary format is not supported by any of the main browsers.. To ensure maximum browser support, encode you media using an open format like WebM:
http://www.webmproject.org/

Questions about building a website

Just a couple questions about building websites. I know the basics of building a website, but there are a few things I was wondering about. The first thing is about posting on the main page. What I mean is if I want to set up an admin page where me or the other admin want to login and fill in the box and click post, how do you post to another HTML page? Can I just use php and if so how do you make it continually post the same way every time someone makes a post. The second thing is that when someone normally sets up an admin page or any kind of login page do they store the username and password in a mysql page? These may seem basic to some, but I have never had to do these types of things yet.
I suggest that you download and install Wordpress. This will take care of all the admin editing, security and posting to the front page for you. It's written in PHP and very easy to get started with. You can dip your toes into these deep waters! :)
good luck,
JD
You should learn PHP and Mysql. Mysql is a database, all your username/password/posting info will be stored there. And your PHP will do the updating or query content/posting from database to display in any page.
Read more at : http://www.freewebmasterhelp.com/tutorials/phpmysql

PHP, MySQL: Display only required parts of my website in sister website

Now I have my website built on PHP & Mysql. Consider this like a forum. Now when a user posts a reply in my website 1 (ex. www.website1.com), I want to be able to show the starting thread and it's related replies in a sister website of mine. I want to do this in a way that it does not show the rest of the page & other page contents (like logo etc.). I don't think iframe would be a solution because an iframe would embed the whole page and the users visiting my sister website (totally different domain i.e. www.website2.com) would be able to see all the page contents, like logo etc. I want to avoid that. I want to make them see only limited information from website 1 and only the info. that I intend.
I hope that makes sense. In a way, you could say that I am trying to replicate my 1 website, and show only a limited part of it. Users browsing 2nd website can post a reply in the 2nd website and it should automatically be posted & visible to the visitors of the website 1. Users of website 1 should not know that a user of website 2 has posted it. They would feel that some user from website 1 has posted it. Do I have to use 2 separate mysql DB or just 1? I think it would be problematic if I am trying to use different DB. I also feel I might have to face DB connectivity issues as I can connect to only 1 DB at a time.
It's basically like users of website1.com should feel that they are replying to users of website1.com & users of website2.com should feel that they are replying to users of website2.com. (I need it this way to bridge the gap between them). At the same time I want to make the front end of the websites different so that they don't feel that they are replying to some other users outside the domain. These websites would be under my control and I will have access to the source code at any time. If I need to change the source code, these changes are welcome.
Is this really possible?
Thank you in advance.
I'd recommend generating RSS (might be runtime) and using it on the sister website. If RSS is not suitable for your needs, you can create your own XML-based format (or any other :) )
Make two forums which use one database. Both websites would put new messages in the same database.
Make an API for website1, so that website2 can retrieve and post messages on the forum. Website2 would do a HTTP request to website1, which returns XML or JSON, so that website2 can request a list of posts that it can display.
Have both sites connect to the same database and display the content they pull in whatever way is appropriate for the particular site. Each site can only pull the fields relevant to that site.
If the idea is to have two websites with the same data but different presentations, then you would want to simply share a single database between them - assuming they are hosted in the same place and can both get at the database.
You can then just create different PHP pages that both access the same database in the same way but display the data differently.
The best way to do this would be to have a shared library of functions or classes that both sites use to manipulate the data. You would then build a different "presentation layer" on top of that for each site.

Categories