PHP Pagination Code

Hiiiii, if you are a PHP developer and you are developing an admin section or any other section showing table records then you will need a pagination in that table to limit the records to be viewed on one page. Applying pagination is very easy and simple.

So, here is the code to apply pagination to the records fetch from a database table.

For this tutorial, we need in total 3 files. The name and code of these files are as follows :

 

php pagination

 

 

To get code……  CLICK HERE

Simple and Flexible function in PHP for ADD and EDIT in Database Table

Hiii, we all know that using with functions in our code makes our workflow very easier and our work also gets easy. It is very good if we have the already built raw database functions for basic and simple tasks like database insertion and edit. So, here is the simple class and function to create fancy and flexible ADD and EDIT FUNCTIONS.

ADD and EDIT in Database Table

 

To see code……  CLICK HERE

HTML Form mail sending with HTML structure and CSS with Tectite FormMail

Hiii, in my previous post HTML Form mail sending with HTML structure and CSS   , I had given a demo of how to send the contents <input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=Bio-data1_first.htm, Exclude=email;realname;” />or fields of form in a mail in HTML format with CSS with the help of PHP mail() Function. But there is some limitation in that method i.e. it requires more work to be done for proper HTML structure and it can cause difficulty if the form is very big . So. here in this post I’ll give you another demo with some other method to overcome that problem. We are using Tectite formMail in this demo.

Tectite form mail is very easy and it works by just adding some hidden fields in the form and just adding a form action to file namely ‘formmail.php’ in your form file.
Your can download formmail.php file from  here.

Continue reading

HTML Form mail sending with HTML structure and CSS

Hii, we all know that sending an email form HTML form is very easy but what if we want to send some CSS and HTML Design (like table structure) in the mail . So , in this post I will be explaining how to send a mail with custom CSS and HTML.

CSS and HTML can be added with mail by two methods :

–> By PHP mail() function , and

–> By  Form mail method.

Kindly note that both of the above mentioned methods will work if your site  is live and will not work if your site is on your local server.

Here in this post  I’ll be explaining HTML mails with PHP mail() function.

Continue reading

Selecting chechboxes via Javascript

Code to check all boxes by selecting a header checkbox and sendind array of ids of the selected checkboxes :

Creating a Checkbox HTML :

<table id=”table_name”>
<thead>
<tr>
<th><input type=’checkbox’ id=”check_all”></th>
</tr>
</thead>
<tbody>

<tr> <td><input type=”checkbox” name=”ids[]” value=”‘.$t_value[‘task_id’].'”></td> </tr>

</tbody>
</table>

Javascript code to select all checkboxes :

$( document ).on(“click”, “#check_all”,function() {
var checkedStatus = this.checked;
$(‘#table_name tbody tr’).find(‘td:first :checkbox’).each(function () {
$(this).prop(‘checked’, checkedStatus);
});
});

Getting array of ids of checkboxes selected :

$( document ).on(“click”, “#button_id”,function() {
var ids_arr = [];
$(“[name=’ids[]’]:checked”).each(function() {
ids_arr.push(this.value);
});

});

This ids_arr array you are getting is the array of ids checked/ selected. You have to pass this array to the next page through ajax where function or database queries to do with the selected ids is written.

To see How to send data on next page or same page through Ajax , CLICK HERE

Hope you like the post………Please Comment …..!!!!!!!

PHP FIle Uploading

For File Uploading , you first required a from to be multipart , just take  a look :

<form action=”#” method=”post” enctype=”multipart/form-data”>

<label for=”file”>Filename:</label>
<input type=”file” name=”file” id=”file” >

<input type=”submit” name=”submit” value=”Submit”>

</form>

Then after submitting a form you require a code given below to upload the file to the desired location :

Continue reading