Category Archives: PHP Tutorial
The str_ireplace function In order to replace words in your strings with other words, you can use replace string function str_ireplace() in PHP. You can You can use str_replace() as well, however, this is a case sensitive function while str_ireplace() is not. See an example of str_ireplace PHP str_ireplace Syntax Following is the syntax of using the str_ireplace
Grouping similar types of tasks into classes is termed as object oriented programming. Where Class is a combination of variables/properties and functions/methods. This chapter does not aim at explaining object oriented programming concepts thoroughly. The aim of this chapter is how to create and use PHP classes.
Introduction to mail function in PHP Often we see web sites having links to contact them by way of Contact Us or An Inquiry form or any other way. After clicking there visitors are presented with a form asking for information and then Submit. Generally an email is sent to webmaster or contact persons of that website.
The mysql_query() function After establishing a connection to the MySQL and its specific database, it is time to work with the database records. Mostly, we need to insert, update, retrieve and delete records from the database tables. PHP provides a built-in function mysql_query() to achieve these tasks along with others. This chapter will explain how
Establishing DB connection with mysql_connect PHP provides built-in function mysql_connect to establish database connection with MySQL database. See the syntax below connection mysql_connect(server,user,passwd,new_link,client_flag); We have assumed that you have created a database with: database name = testdb user name = tesuser password = testpassword at your local system. In that case: DB host = “localhost”
Brief about MySQL MySQL is an open source relational data base management system now owned by Oracle. MySQL is particularly popular for web based applications. It is being supported by most of server side scripting languages like PHP. Many big sites use MySQL as database like Wikipedia and youtube as well. MySQL is multi-user and
The basename() function used to return file name from a given path. The basename function is generally used in PHP fileupload script to let users upload files.
The move_uploaded_file() function is used to move uploaded file to specified location. The move_uploaded_file() function returns true if move is successful and false if it fails.
How to increase upload file limit In previous chapter we covered how to upload file in PHP script, this only covers single file upload with default upload limit size defined by PHP, which is generally 3 MBs. However there will be situation where you are offering your visitors to upload files and desired limit is
This chapter will take you through how to upload files by using PHP script. File upload is required in many scenarios to allow users of your site to select files from their local computers and upload to your website. These files may include images uploads, pdfs, audio or video files depending on your requirement.