Category: PHP (Page 12 of 15)

Learn PHP programming through practical examples and tutorials. This category covers core PHP concepts, form handling, file opera

How to prevent cross site scripting in php

Last updated on October 22nd, 2024 at 07:55 amCross site scripting can be dangerous especially when hackers try to exploit a website in PHP that doesn’t validate query strings once passed. In this tutorial I am going to define how to prevent cross site scripting in PHP while using query strings. Let’s define a simple […]

How to restrict access to php file

Last updated on March 23rd, 2022 at 01:00 pmIf you don’t want users to access some files directly from browser, you can simply add the following php script on top of such files. Let us take one file named MYFILE.PHP as an example, all you have to do is just add the below code on […]

How To Set And Get Cookies Using PHP

Last updated on November 23rd, 2022 at 07:54 amHere is a simple code that explains how a cookie is set and retrieved using php. A cookie is set with the following code: setcookie(name, value, expiration) The above code sets a cookie named “MyVisit” in the visitors browser. The cookie sets the value to the current […]

How to change background color using php

Last updated on November 23rd, 2022 at 01:43 pmThis is a very simple script which will dynamically change the background color of a webpage using php .Just copy and paste the script below. In case if you missed it, we also have a script using Javascript that changes background color of a webpage. Check out the Demo

« Older posts Newer posts »