This is an example on how to verify a string only contains integer values. String may contain anything like float value, double value, characters etc. This example uses regular expression to check a string contains only int values.
Below is the function which validates a string contains only int values. Continue reading “Verify a string contains only integer value in PHP”
File upload example in Codeigniter 2.1.4. There is file upload class, in Codeigniter, which permits you to upload the file or files. This class also permits you to set various preferences such as destination where the file will be uploaded, restriction on file types, restriction on file size, whether a file name should be encrypted or not, maximum length of the file name etc.
Please feel free to contact if you have any query.
Below are the simple few processes for uploading a file
- A form with input type file is required so that user can select the file using the browse button
- When the form is submitted, the file is validated to make sure that the file is uploaded against the preferences you set
- Once the file is uploaded successfully to the specified destination, the success message is shown
- The output in the browser
Continue reading “Codeigniter Multiple Files Upload”
This tutorial shows how to bookmark a current URL. We have already built-in functionality in most of the browsers and we can bookmark a URL there but it’s also like you have to go to the menu option. The below code do the same thing just in one click on the web page. User is given a link to bookmark the current URL on any web page. This application logic is written in Codeigniter PHP framework but it’s very easy to understand the logic of the code and you can use the logic in simple PHP also. If you have any doubt or query then let me know. Continue reading “Bookmark web page using Codeigniter and jQuery”
Sometimes we need to check username availability instantly before a user presses the submit button after filling a long-sized signup form. In this case we can use AJAX with any technologies like PHP, Codeigniter, Servlet, Struts, JSF, Spring etc. for checking whether the input username is avaialable or already occupied by someone else. So if we give instant result to the user for username availability then sometimes it makes more sensible than while pressing the submit button and goes top of the signup form to rectify the username input field if input username is not available.
This tutorial shows how to check username availability using PHP, AJAX and MySQL. So after finishing this example you will be able to apply the same logic to any PHP framework or any server side technologies. Continue reading “Username availability check using PHP, AJAX and MySQL”