I have called web services in php by using curl function. In below I have given one example. I have sent XML Request by using curl function.Because My web services return data on XML Format. $xml_data = ”; //pass parameter…
How to call webservice in php?
Blog Archives
how to display article intro image in joomla module?
Article display by yourtheme/html/com_content/article/tmpl/default.php file. you can use module mod_articles_latest so edit mod_articles_latest/tmpl/default.php file. <?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @copyright Copyright (C) 2005 – 2014 Open Source Matters, Inc. All rights reserved. * @license GNU…
Export the database table as CSV format using PHP
This code need some files those files are, 1.db.php 2.export.php 3.index.php as in the db.php file, make this. database name –> wallstreet table name–> export_table column names –> id,name,place and as you, here i just declare what i have given…
How to use login() function in joomla?
You can use Below code during develop module and component with login functionality, get your username and password dynamically and put in array function. when you call registration successfully function just add this code for autologin functionality. $credentials = array( ‘username’…
Sending HTML Email with PHP
<?php // multiple recipients $to = ‘receiver@example.com’ ; // subject $subject = ‘Simple Html Email’; // message with HTML body $message = ‘<html> <head> <title>Html Email With php</title> </head> <body> <div>”. strip_tags($_POST[‘name’]) . “</div> <div>”. strip_tags($_POST[’email’]) . “</div> <div>”. strip_tags($_POST[‘message’]) . “</div> </body> </html>’; // To send HTML mail, the Content-type header must be set $headers = ‘MIME-Version: 1.0’ . “rn”; $headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “rn”; // Additional headers $headers .= ‘To: hello <receiver@example.com>’ . “rn”; $headers .= ‘From: hello <sender@example.com>’ . “rn”; $headers .= ‘Cc: web@example.com’ . “rn”;…
How to use mail() function in php?
mail() function <?php $to = ‘receiver@example.com’; $subject = ‘the subject’; $message = ‘hello’; $headers = ‘From: sender@example.com’ . “rn” . ‘Reply-To: sender@example.com’ . “rn” . ‘X-Mailer: PHP/’ . phpversion(); mail($to, $subject, $message, $headers); ?> Note:- $to, $subject, $message parameters are require for send mail and headers are optional parameter, you con use header parameter for add additional body mail.
How to Retrieve Input data in joomla?
Use jinput Method you can use this code $jinput = JFactory::getApplication()->input; Get the Value using jinput $name = $jinput->get(‘varname’, ‘default_value’, ‘filter’); Get Multiple value Retrieve multiple values you can use getarray() method: $fooValues = $jinput->getArray(array(‘var1’ => ”, ‘var2’ => ”,…
How to upload image in wordpress
if(isset($_POST[‘submit’])&&$_POST[‘submit’]==’SUBMIT’){ //This is the directory where images will be saved $target = WP_CONTENT_DIR.”/upload/”; you have to create folder name upload in root directory(path: wp-content/upload/..) $target = $target . basename($_FILES[‘photo’][‘name’]); //This gets all the other information from the form //…
How to validate email id using checkdnsrr() function in PHP
Are you tired of dummy email id’s being used on your website. Like test@test.com, abc@abc.com etc ? You can use PHP function checkdnsrr() It checks whether the dns value is valid or not. Only the email id with valid domain…