Search found 35 matches

by phpkiller
Sun Jun 12, 2016 9:58 pm
Forum: Your Scripts
Topic: Posting JSON data with PHP cURL
Replies: 0
Views: 4167

Posting JSON data with PHP cURL

You have to add JSON content type with your request header just like below example: $post_data = array("OS" => "Android", "version" => "5.1"); $json_string = json_encode($post_data); $ch = curl_init('http://myapi/opeartingsystems/ver'); // request URL curl_setopt($ch, CURLOPT_POST, TRUE); curl_setop...
by phpkiller
Tue Sep 29, 2015 11:16 pm
Forum: PHP coding => General
Topic: Clear all the form fields using jquery
Replies: 1
Views: 460

Clear all the form fields using jquery

On any event call this piece of code: $(':input','#yourformID') .not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected'); You can also use this code block: $(':input').not(':button, :submit, :reset, :hidden').removeAttr('checked').removeAttr('selected').not(':ch...
by phpkiller
Wed Sep 23, 2015 1:32 am
Forum: PHP coding => General
Topic: Star rating on click of Star image
Replies: 1
Views: 661

Star rating on click of Star image

1. First create a table in database. 2. Upload images in image folder (images in attachment) <!-- Star rating Start --> <script type="text/javascript"> $(document).ready(function(){ // star rating form submit $(".star").click(function(){ //alert('star clicked'); $("#submit_rating").trigger("click");...
by phpkiller
Mon Aug 03, 2015 12:59 am
Forum: PHP coding => Images
Topic: Submit form on click of image using javascript
Replies: 0
Views: 936

Submit form on click of image using javascript

On submit of form you have to use "_x" with the name of the submit image button. For e.g.: <?php if (isset($_POST['submit_x'])) { echo "<pre>"; print_r($_POST); echo "<br>"; } ?> <script type="text/javascript"> function submitform() { document.myform.submit(); } </script> <form enctype="multipart/fo...
by phpkiller
Wed Jul 01, 2015 4:55 am
Forum: PHP Scripts
Topic: Refresh or redirect page after some delay in PHP
Replies: 0
Views: 844

Refresh or redirect page after some delay in PHP

If we want to refresh our page or we want to redirect it to another page after some delay, we can use a simple code block: echo "<meta http-equiv=\"refresh\" content=\"5;URL=inbox.php\">"; By using this page will be redirected to the specified URl after 5 seconds as per provided in 'Content' paramet...
by phpkiller
Mon May 19, 2014 11:48 pm
Forum: Your Scripts
Topic: form validation (client side) using jquery
Replies: 0
Views: 1437

form validation (client side) using jquery

Here is the code: <html> <head> <title>login page validation using jQuery</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> <!-- This is suggested that you must use the latest jQuery code here --> </script> <script type="text/javascript"> $...
by phpkiller
Wed Apr 16, 2014 3:42 am
Forum: PHP Scripts
Topic: Page view counter using PHP
Replies: 1
Views: 1037

Page view counter using PHP

The logic is to create a file and read it. Now put a incremented value in it. Next time when you need the counter value just read it again and get the counter value. <?php define("HITCOUNT", "hitcounter.txt"); function addOne() { $fh = fopen(HITCOUNT, "r"); $count = fread($fh, filesize(HITCOUNT)); f...
by phpkiller
Tue Feb 25, 2014 1:06 am
Forum: PHP Scripts
Topic: Copy files using UBUNTU terminal
Replies: 0
Views: 932

Copy files using UBUNTU terminal

We can copy the content of a folder /source to another existing folder /dest with the command cp -a /sourcepath/. /destinationpath/ The -a option is an improved recursive option, that preserve all file attributes, and also preserve symlinks. The . at end of the source path is a specific cp syntax th...
by phpkiller
Tue Feb 25, 2014 12:57 am
Forum: PHP Scripts
Topic: Submit a form using jQuery in PHP
Replies: 1
Views: 1789

Re: Submit a form using jQuery in PHP

Appreciate your input...

Thanks,
by phpkiller
Thu Feb 13, 2014 2:11 am
Forum: PHP Scripts
Topic: Add extra field to aceshop/opencart component in joomla
Replies: 1
Views: 1324

Re: Add extra field to aceshop/opencart component in joomla

In firts point after adding variable add this code block to display thae value in database to that same field: At line 710: /* Added code for new field */ if (isset($this->request->post['external_link'])) { $this->data['external_link'] = $this->request->post['external_link']; } elseif (isset($produc...
by phpkiller
Sun Dec 08, 2013 11:36 pm
Forum: PHP General
Topic: Difference between self and this keyword in PHP
Replies: 0
Views: 873

Difference between self and this keyword in PHP

As we are using OOPS concepts here are the difference:- -self refers to the current class -self can be used to call static functions and reference static member variables -self can be used inside static functions -self can also turn off polymorphic behavior by bypassing the vtable -$this refers to t...
by phpkiller
Fri Nov 22, 2013 1:28 am
Forum: PHP Scripts
Topic: Submit a form using jQuery in PHP
Replies: 1
Views: 1789

Submit a form using jQuery in PHP

<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> </head> <body align="center"> <div align="center"> <h1>Jquery Form Submit Demo</h1> <form name="myForm" id="testForm" method="POST" action="send.php"> UserName: <input type="...
by phpkiller
Thu Nov 07, 2013 6:37 am
Forum: PHP Scripts
Topic: how to get value using javascript in a select option box
Replies: 0
Views: 936

how to get value using javascript in a select option box

First use this javascript code block: <script type="text/javascript"> function selectItemByValue(elmnt, value){ for(var i=0; i < elmnt.options.length; i++) { if(elmnt.options .value === value) { elmnt.selectedIndex = i; break; } } } </script> This is how u can call it: selectItemByValue(document.get...
by phpkiller
Wed Oct 23, 2013 10:54 pm
Forum: PHP Scripts
Topic: how to get number of rows in Joomla mysql quey
Replies: 0
Views: 825

how to get number of rows in Joomla mysql quey

$db = &JFactory::getDBO();
$checkQuery = "SELECT * FROM table";
$db->setQuery($checkQuery);
//$rowsAG = $db->getNumRows();
$check = $db->query();

print_r($check->num_rows);
by phpkiller
Wed Oct 16, 2013 5:15 am
Forum: PHP Scripts
Topic: Add extra field to aceshop/opencart component in joomla
Replies: 1
Views: 1324

Add extra field to aceshop/opencart component in joomla

1. Add this line to getForm() method in admin/controller/catalog/product.php :- $this->data['entry_external_link'] = $this->language->get('entry_external_link'); 2. Add same variable in language file i.e. admin/language/english/catalog/product.php :- $_['entry_external_link'] = 'External Link'; 3. A...
by phpkiller
Thu Sep 12, 2013 9:49 pm
Forum: Server installation and configuration
Topic: format pendrive with ubuntu terminal
Replies: 0
Views: 1348

format pendrive with ubuntu terminal

First of all type the below command for know the name of your pen drive or memory card" 1.) dmesg | tail Then unmount your pen drive using the following command. 2.) sudo umount /dev/sdb1 (here sdb1 is your pendrive name) Then enter the following command to format your pen drive with FAT32 partition...
by phpkiller
Tue Sep 03, 2013 11:25 pm
Forum: Your Scripts
Topic: Find count of products and total price for added in cart
Replies: 0
Views: 1415

Find count of products and total price for added in cart

The solution is for opencart. Add session variable in catalog/controller/checkout/cart.php like this: Find this line: $this->data['products'] = array(); Add this code block //count no of products added to cart if(count($this->cart->getProducts())){ $_SESSION['count_2'] = count($this->cart->getProduc...
by phpkiller
Tue Aug 27, 2013 4:56 am
Forum: Your Scripts
Topic: How to display categories in filter pro module.
Replies: 0
Views: 1273

How to display categories in filter pro module.

Once you download or purchase filter pro module for Aceshop, you want to display the list of categories falling under some parent category. But aceshop may not successful somtimes. So what you have to do is simple go to the path: your_project/components/com_aceshop/opencart/catalog/view/theme/defaul...
by phpkiller
Tue Aug 20, 2013 12:02 am
Forum: PHP General
Topic: How to recursively remove .svn metadata folders?
Replies: 1
Views: 1011

Re: How to recursively remove .svn metadata folders?

Here you can learn how to insert database using terminal. 1. First create a database and have one .sql file to insert or upload into it. 2. Now put that .sql file into home folder. 3. Run this command on terminal: mysql -u root -p dbname < dbname.sql and press enter. It will ask for database passwor...
by phpkiller
Wed Jul 03, 2013 5:01 am
Forum: PHP coding => Images
Topic: Open image in popup while click on text
Replies: 2
Views: 2450

Open image in popup while click on text

First Put This code in your page: <script language="javaScript" type="text/javascript"> function runme(priceval){ newprice1 = 0; if(document.getElementById("option_oc_range").value != ''){ newprice1 = eval(parseInt(priceval)+parseInt(document.getElementById("option_oc_range").value)); } else { newpr...
by phpkiller
Thu Jun 27, 2013 12:14 am
Forum: PHP General
Topic: How to recursively remove .svn metadata folders?
Replies: 1
Views: 1011

How to recursively remove .svn metadata folders?

You will have to move to desire folder using cd command then write following command:

find -type d -name '.svn' -exec rm -rfv {} \;

This will remove the all svn files from current and sub-directories.
by phpkiller
Fri May 31, 2013 6:24 am
Forum: PHP General
Topic: Joomla 2.5 change or remove text from joomla administration
Replies: 0
Views: 1637

Joomla 2.5 change or remove text from joomla administration

First go to:

Joomla/administrator/language/en-GB/en-GB.com_login.ini

Change variable:
COM_LOGIN_JOOMLA_ADMINISTRATION_LOGIN="Joomla! Administration Login"

to the value you want to apply.
by phpkiller
Thu May 09, 2013 12:38 am
Forum: PHP coding => General
Topic: Joomla2.5 - How to open popup on click for menu item
Replies: 0
Views: 780

Joomla2.5 - How to open popup on click for menu item

Use JCE Utilities. For example: your link is http://www.mytestlink.com Create a menu item with type "external link" and in the link area for that menu item put your link in this manner: http://www.mytestlink.com" class="jcebox Place a double quote than space tha add class="jcebox. Remember to omitt ...
by phpkiller
Fri Mar 22, 2013 4:05 am
Forum: PHP General
Topic: How to use logout script
Replies: 4
Views: 1411

How to use logout script

Create a link or button for logout and below is the logout script:

<a href="logout.php">Logout</a>


logout.php:

<?PHP

session_start();
session_destroy();

?>
by phpkiller
Mon Mar 18, 2013 3:35 am
Forum: PHP coding => General
Topic: How to show popup while click on text
Replies: 1
Views: 1037

How to show popup while click on text

Here is the method to open popup window with fading effect. You can also put image on the place of text. Code: <style> #mask { position:absolute; left:0; top:0; z-index:9000; background-color:#000; display:none; } #dialog { border: 5px solid gray; width:570px; height:auto; padding:10px; background-c...