PHP Frameworks Archives - Page 8 of 13 - Webner Blogs - eLearning, Salesforce, Web Development & More

PHP | Load Data Infile to insert csv data into Mysql with PHP

Author - Webner

Problem: How to insert csv data into mysql table with mysql query in php. What problems usually you face with this and how to resolve them.

Description: I have csv file with thousands of records. I want to insert these records in mysql table with php Read more…

Moodle/Totara | Creating a new Activity Plugin

Author - Webner

Introduction: In Moodle/Totara we can add a different type of activities to a course by selecting from the list of standard activities available. As shown in the the list below:

But there might be some cases in which we need to add a custom activity to a Read more…

Selenium | Data Driven Framework to read csv data

Author - Webner

During testing, I had a test case to add multiple employees automatically with selenium script so I have implemented Data Driven Framework. Using this we have to read the data from the CSV and register all the users in the system.

Note:  We need to add a jar Read more…

WordPress | Dynamically generating ADF XML format of the form submission

Author - Komal

ADF XML FORMAT

ADF XML format stands for Auto-lead Data Format XML that is an automotive retailing industry standard data delivery format for import and export of automotive customer leads.

This format is used as a way to format the customer data so that the heterogeneous systems Read more…

PHP | core.php and some important settings

Author - Manju Kashyap

In CakePHP application, core.php is configuration file and is located at app/Config/core.php. This file contains various variable definitions and constant definitions that alter the behavior of the application. The description of some important variables and their effect on the application is given below:

Debug:Read more…

Moodle | This page should automatically redirect

Author - Shalini

In my plugin code I was trying to redirect from one page to another page using redirect as follows:
redirect(“success.php?cd=”.$id);
Redirecting to the other page was working but during redirection an intermediate page was being displayed like this:

On click of continue button, it was redirecting Read more…

HTML Media Capture

Author - Shalini

How to access Camera and upload the image/video to server?

We can achieve above requirements easily by using HTML Media Capture :
<form action=”upload.php” method=”post” enctype=”multipart/form-data”>

Capture Image: <input type=”file” name=”uploadedfile” accept=”image/*” capture=”camera”>

<input type Read more…

Moodle | How to create a scheduled task in moodle

Author - Kritika Sood

In moodle we can create scheduled tasks which will run after a defined interval. We also have cron jobs in moodle but they usually run after every minute so if we need to run a task after a particular time we need to create a scheduled task for this.

An Read more…

CakePHP 3.x or 2.x | Some important configuration settings

Author - Rita

Some important settings that can help you while working with CakePHP 3 or 2.

1. How to set Homepage for your website in CakePHP 3?

Go to the root directory of your project. You will see config folder there. Inside Config
folder, open routes.php file. Add below the line Read more…

Salesforce | Get list of Salesforce sobjects and fields in PHP

Author - Webner

Problem: How to get list of all the Salesforce sobjects in php. Also get fields of each sobject.

Solution: First we need to install Salesforce php toolkit for this. Once you have it then this is the sample code:
require_once(SFDCPHPtoolkit / soapclient / SforcePartnerClient.php ‘);
$mySforceConnection = new Read more…

phpMyAdmin | Different methods to View Table Constraints

Author - Ishpreet Kaur

How to view List of constraints of tables of Database in phpMyAdmin

There are various ways by which we can view the list of constraints applied to tables of given database in PhpMyadmin. Let’s see few methods here:

Suppose we have a database named CollegeDb Read more…

Explanation of Column3 in Moodle/Totara

Author - Kajal Marwaha

Column 3 layout in Moodle is basically dividing the screen into 3 parts .

user setting options Layout (pre )
content layout (region)
editing layout (post)

user setting options Layout (pre): In column3 layout pre region is the first column. This column is at  the left of the content. This Read more…

Purpose of Security.salt and Security.cipherSeed in CakePHP

Author - Ashish

cipherSeed in CakePHP
cipherSeed is used in Security::cipher() function to seed rand(). Seed means to give the initial value to rand() function to start and based on that the future values by rand() function are generated. In php, before 4.2.0 version, Random Number Read more…

Heroku | The datasource configuration “default” was not found in database.php

Author - Webner

Heroku throwing ERROR: “The datasource configuration “default” was not found in database.php” with database configuration already present for cakephp app.

In one of our cakephp projects hosted on Heroku we used PostgreSql database. For configuring the database to connect to app code we renamed the database.php.default file Read more…

CakePHP Security Component

Author - Manju Kashyap

CakePHP Security Component is very useful and provides an easy way to enable very tight security in our application:

1. It can restrict which HTTP methods our application accepts.
2. It provides Form Tampering Protection.
3. It can force to require that SSL must be used.
4. It Read more…

Moodle | Add and access custom elements in Blocks

Author - Kritika Sood

In Totara how to add custom HTML elements (checkboxes, input boxes etc) and then access the value selected by user on server side:

1. Adding custom elements.
2. Accessing values of custom elements.

Each problem is discussed below: Overview:

In Totara, for blocks, we have some Read more…

Shopify webhook getting fired multiple times and then getting deleted from shopify store

Author - Webner

In our Shopify store we have an order creation webhook that points to a cakephp action URL. The action that webhook points to fetches the order data and then saves this to the database.

The problem that we were facing with this webhook was that it was getting invoked multiple Read more…

WordPress | Get title and description from posts dynamically

Author - Neelam
|
0 Comments
|

In wordpress we can get title from post title and description from post content area dynamically:
<?php
$id = get_the_ID();          //get the post id.
$title = get_the_title($id);           //get title from the post.
$content = get_post_field(‘post_content’, $id);     // Get all content from post content area.
$trimmed_content = wp_trim_words( $content, 20, ‘….’ ); // This function trims Read more…

Sorting Alphanumeric Data in PHP

Author - Kritika Sood

While fetching data from database, in SQL query I had ‘order by’ clause but the results were not sorted when the data was in alphanumeric form. The reason for this is that SQL sorts character by character from left to right. So it places c10 before c2 as 1&lt Read more…

CakePHP | How to handle special characters (like apostrophes) in queries

Author - Ishpreet Kaur

Let us take an example:

We have table employees with following fields:

id int primary key,

name varchar(50),

city varchar(50)

We have following records in the table:

(1, isha, amr);

(2, Hamlet’s, ghy);

(3, éhjj, amr);

2nd and 3rd records have special characters in their Read more…

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