PHP Frameworks

Couple of different ways to rename table name through UI in phpmyadmin

Author - Parminder Kaur
|
0 Comments
|

First method:

1. Click on the database (from list of databases on the phpMyAdmin home screen) in which you want to rename table name.
2. You will see a list of tables on click of the database.
3. Select the table and there is a dropdown below the tables with Read more…

What is PDO? Why PDO should be used in PHP?

Author - Ishpreet Kaur
|
0 Comments
|

PDO stands for PHP Data Objects. PDO is a consistent way to access databases.
Today, mostly websites or desktop based applications store their data in databases. Therefore, PHP has also provided the way to connect with databases.

PHP supports following ways to connect to the database:

1. Mysql Read more…

Moodle | Hyperlinks in course summary

Author - Kritika Sood
|
2 Comments
|

In Moodle when we create a new course we have an option to add summary/description of course. We can use this summary anywhere while showing courses. This summary could be anything. It can be simple text, image, multimedia or hyperlinks.

Hyperlinks are 2 forms:

Hyperlink launches a Read more…

How to send ical attachment via PHPMailer

Author - Kailash
|
4 Comments
|

We can send ical attachment in email using attach ical file (filename with .ics file extension).

For example, following is the object containing the information about ical like event start date and time, location, event summary etc:
$ical_content = “BEGIN:VCALENDAR
VERSION:2.0
PRODID://Drupal iCal API//EN
BEGIN:VEVENT Read more…

PHP FPDF (To generate PDF files)

Author - Tanuj
|
0 Comments
|

FPDF (To generate PDF files)
Using PHP we can generate PDF files dynamically. FPDF is a free PHP class that contains a number of PHP functions with the help of which we can create and manipulate PDFs. To get started with FPDF, we just need to download FPDF library from Read more…

An example of Ajax to display dyanamic images and text on webpage

Author - Komal

Whenever the situation occurs to rerender the page contents without reloading the whole page, we use ajax in it. By using ajax we get the response data back in the success function which we will show on the screen. Let’s have a look:

Screenshot 1

In the above screenshot Read more…

Floating Point issue in Programming Languages

Author - Ashish
|
0 Comments
|

When we pass a floating point value to a variable, then the value which we store in the variable is not the actual value but it is something approximately near to that number which transfers to that variable.

Let us understand this by a PHP example:
<?php Read more…

Cakephp 3.3 |How to execute script using Console

Author - Parminder Kaur

In Cakephp, console applications are useful in running background processes and can be run without access to web browser. The CakePHP console provides a framework for creating shell scripts.To run the cakephp functions, first of all create a shell to use in console.

For example, create a TestShell in Read more…

Call to undefined function mcrypt_encrypt()

Author - Manju Kashyap
|
0 Comments
|

Error: Call to undefined function mcrypt_encrypt()

Description: In one of our project, I was trying to save a field value in encrypted format in the database, using PHP, which could be retrieved back to its normal value, where we need to display it.

So for that Read more…

Correct way to post a form in cakephp 2.* with client side validation in JavaScript

Author - Kailash
|
0 Comments
|

If we follow cakephp rules to create a form then we can use cakephp inbuilt functionality like we don’t need to assign labels to form fields. Cakephp automatically creates a label for each form field also in case of update/insert validation error messages, the message is automatically shown Read more…

Taking Database Backup And Moving that backup from one server to another using PHP

Author - Deepika
|
0 Comments
|

While working on two servers, we can take the backup of database on one server using mysqldump command in php.

Example :
exec(‘mysqldump –host ‘.$dbhost.’ –user ‘.$dbuser.’ –password=’.$dbpass.” “. $dbname.’ > ‘.$dbname.’.sql’);

After creating dump of database, user can move the dump database file from one server to another Read more…

Scaffolding in CakePHP

Author - Ishpreet Kaur
|
0 Comments
|

Scaffolding in CakePHP

Application scaffolding in CakePHP is a technique that allows the developer to define and create a basic application that can create, retrieve, update and delete objects. Basically CRUD (create, Read, Update, Delete) data operations are common in most of the applications.

Scaffolding basically provides temporary structure or Read more…

Add virtual field in cakephp 2.* in find methods

Author - Kailash
|
0 Comments
|

How to specify an extra field (not existing in the table) while fetching data from database using find method? Solution is explained below.

Assign value to virtual field before find function call:

$this->virtualFields[‘virtual_field_name’] = ‘any value’;

Use virtual field in find function:

$result = $this – > find(‘all’,
array(
‘fields’ => array Read more…

Allowing PHP cURL to access self-signed websites without verifying the SSL certificate

Author - Richa
|
0 Comments
|

By default, each cURL request can access only SSL certified websites. However, at times it is required to access those sites which are self-signed. To verify that your cURL request is able to access self-signed websites or not, use below command:
curl <URL of the domain to Read more…

WordPress | Developing Custom scheduler in WordPress

Author - Harleen Kaur
|
0 Comments
|

Suppose you want to design a custom scheduler in wordpress plugin instead of using wordpress scheduler which has fixed values of recurrence which are ‘hourly’, ‘twicedaily’,’daily’. And if you want to make the scheduler dynamic instead of making it static i.e. instead of setting the fixed scheduler value Read more…

PHP | Only first word showing in textbox from assigned sentence

Author - Webner
|
0 Comments
|

Problem: After the first space in the string no data appears in the input field.

There is an issue when a string contains words with spaces and we want to display the whole string in an input field but after the first space, no data is displayed in Read more…

Adding custom merge tags to the Gravity forms

Author - Komal

Merge Tags in gravity forms are the tags that are used to dynamically populate the field values in the form content in gravity forms like IP address, browser name, logged in user name etc . There are many merge tags available in the gravity forms by default.

But sometimes there may Read more…

WordPress | How to retrieve query variables in plugins

Author - Harleen Kaur
|
0 Comments
|

Suppose the URL contains query string for example www.mywebsite.com/sme_page?q=12
then the value of query variable can be retrieved in PHP using the get method such as:
<?php
echo $_GET[‘q’];  
?>
While creating a plugin for WordPress, to retrieve a value of query variables Read more…

CakePHP 3.x | How to change URL of your website to hide controller/action name

Author - Richa
|
0 Comments
|

Requirement: While running the website in browser, the url path shows controller name followed by the action name and parameters list. In that case the url looks like:

www.xyz.com/User/showDetails/

We may come across two types of requirements.

Displaying only the action name without showing Read more…

Ubuntu | Remove sendmail completely

Author - Ishpreet Kaur

Problem: I installed sendmail in my ubuntu system with the help of link http://lukepeters.me/blog/getting-the-php-mail-function-to-work-on-ubuntu. I installed it to test php mail functionality on localhost for my project. It was working slow, therefore, after testing, I wanted Read more…

‹ Prev page1 2 3 4 5 6 7 8 9 10 11 ... 13 Next page ›