
Welcome to MysqlPhpTutorial.com, the weblog where we discuss about php programming and development by creating easy to learn php tutorials.
Functions, sessions, arrays, classes and forms - a overwhelming amount of information you need to absorb in order to perform better as a coder.
We believe that php examples presented on the site will boost your coding knowledges and help you develop performant, secure php applications.
You may need this php function when you want to clean your url especially when extracting data from mysql will bring special characters like !, ?, @ … The url must not contain characters like those and you must replace them like in the example. SEF stands for Search Engine Friendly, so this php function will create a SEF url by cleaning it up of those unwanted characters.
Example
without cleaning your url will look like: /Mail-@-you-stopped!.php (this is not right)
with PHP SEF clean url will be like: /mail-you-stopped.php (the correct way)
(more…)
PHP security is something you have to take very serious because every site will suffer damages if a hacker finds vulnerabilities in the php code.
With the php secure code below you can protect your php project from SQL injections and XSS.
Basically, this function will clean your variable, starting with ereg_replace function which will replace ‘, “, < and > with empty space “”.
(more…)
PHP in_array function is very helpful if you want to include or exclude php code of files based on a certain criteria like id’s or $_GET variables.
Let’s imagine that you have a list of numbers that we want to use to include a file.
If you want the get the page id or some parameter from the url using $_GET variable use the code snippet below and display content based on the id’s value.
(more…)