Skip to content

Automatic Logout after 15 minutes of inactive in php

I want to destroy session if users are not doing any kind of activity on website. At that time after 5 users automatically redirect on index page. How is it possible? Is possible in php with session handling and for that I have to maintain or update user login time or not.. Answer This is relatively easy to a…

Interpret PHP inside a quote in a PHP

I have this variable $url that I need to print inside a quoted HTML that it’s inside a PHP if conditional. <?php $url = $thumb['0']; if ( in_category( 'News' )) { //nothing here } else { …

woocommerce get list of attribute values

I’m using woocommerce on wordpress to create a simple shop site and I’ve added a couple attributes to a product. These are namely, size and color. Under size I have a variety of values including Small, Medium and Large. Same with color ie. Red, Blue, Green. What I want to do is show these values i…

Image links broken in Gmail because of google’s Image proxy

Image links in gmail are broken because of google’s Image proxy (news1,news2). I can’t load my site’s images in gmail. Actual image path is: http://sampleimageurl.com/images/logo.jpg But I get the same image path like this in gmail: https://ci3.googleusercontent.com/proxy/CUiMBo2ELdin8h5R_jK…

Create and Call a JavaScript Function in PHP

I have just started learning how to create web applications in PHP after migrating from ASP.NET. I wanted to know how to integrate JavaScript with PHP. For example, there is a Home.php page that resides in the website’s root folder. The page has an HTML button on it and a simple JavaScript function that…

Progress bar AJAX and PHP

I want to create a progress bar for a server-side task ( written in php ) For learning purposes the example and task would be very simplistic. I would have a text field on the client page, read a number, pass it to the php script with ajax and make it calculate the sum of all numbers from 0 to