Your Open Source

PHP

Browse

XML Parser in PHP

The XML parser that can be used to read and manipulate XML and SaveTagValue() and GetTagValue() used to save and get the data into the xml file.

  • views 3868
  • datetime Jun 17 08 02:16:06
  • author Sekar
  • rating

Who is IPs / Domain lookup tools

This scripts used to get the domain information. its very easy to handle for programmers.

  • views 6076
  • datetime Jun 17 08 03:08:48
  • author Sekar
  • rating

Array in PHP

To print a array value print_r($arrayname);syntax:print_r( name );

  • views 248
  • datetime Jun 18 08 01:30:57
  • author Damu
  • rating

How to create a random string in php

Random String Generation :-               Function random_gen() is used to generate random string with ten characters

  • views 265
  • datetime Jul 03 08 03:01:23
  • author Psbharathy
  • rating

How to create a file in PHP

How to create a file in PHP ?:  You can use the Linux commands to create a new file in PHP. exec()  is execute the external function from PHP code. The Linux CAT command used to create a new file.The Syntax is ---------------------------exec( commands );commands > is a string -----------------------------

  • views 388
  • datetime Jun 20 08 02:14:15
  • author Sekar
  • rating

How to stroed / get a array data into SESSIONs

PHP array data values you can stored into a SESSION and you also get the array values from SESSION. It will most helpful for programmers because If you need to create a page bar without fetch data from the database, you can use this method to get the array values from the SESSION variable.

  • views 331
  • datetime Jun 23 08 04:03:32
  • author Sekar
  • rating

Create a Captcha or Verification code image in PHP

How to Create a Captcha or Verification code image in PHPYou can develop the Cpatcha or Image verification code.  CAPTCHA acronym for Completely Automated Public Turing test to tell Computers and Humans Apart, its an image of letters is dynamically generated. If you use the CAPTCHA,  difficult for a spambot or other computer program ..

  • views 6837
  • datetime Jul 03 08 06:00:31
  • author Sekar
  • rating

How to store array values in php

ARRAY :array() is a language construct used to represent literal arrays, and not a regular function. Function array_to_database($arr) is used to store the array values( In array format ) in table " array " Function get_array_from_db() is used to retrieve values( In array formate ) from table " array " Notes : var_export() function ret..

  • views 396
  • datetime Jun 23 08 04:07:46
  • author Sam
  • rating

Regular experssions

 Regular expressions is a string that represents  pattern. Regular expressions functions compares string  pattern with another string.PHP support 2 types of Regular expressions POSIX and pearl compatible Syntax  preg_match ( string pattern, string subject [, array matches [, int flags]] ) preg_match('{class}','This is ..

  • views 244
  • datetime Jun 24 08 10:16:39
  • author Psbharathy
  • rating

How to Parse the Xml Using Simple xml element

to parse the xml using SimpleXMLElement()

  • views 235
  • datetime Jul 07 08 02:05:31
  • author Damu
  • rating

Send E-Mail via GMAIL or YAHOO

You can send the mail through in your gmail and yahoo. Look as following code

  • views 313
  • datetime Nov 25 08 02:44:52
  • author Sekar
  • rating

How to setup Date in server:

How can I set the system date and time from the command prompt (bash shell)? I don't have GUI installed and I am login over ssh session.A. Use date command to display the current date and time or set the system date and time over ssh session.This is useful if the Linux server time and/or date is wrong, and you need to set it to new values from..

  • views 237
  • datetime Jun 30 08 10:51:52
  • author Gary
  • rating

How to convert date to timestamp

mktime()  function used to convert the date to timestamp in PHP. The syntax is :------------------  mktime(int hour, int min, int sec, int mon, int day, int year) ;

  • views 316
  • datetime Jul 01 08 11:27:44
  • author Sekar
  • rating

What is PUT method in PHP

PUT Method :- This is a standard input stream to read the contents from the HTTP PUT method. its similar then file uploads and look likes as follows PUT /path/filename.html HTTP/1.1

  • views 300
  • datetime Jul 01 08 02:57:19
  • author Sekar
  • rating

Remove the HTML tags from the strings

Remove the HTML tags from the contents :- You can remove the HTML tags in PHP using strip_tags() function.The Syntax is---------------------strip_tags ( string str [, string allowable_tags )

  • views 317
  • datetime Jul 03 08 08:11:40
  • author Sekar
  • rating

How to send mails with attachment in php

How to send mails with attachment in php :- You can send the email with attachment using PHP mail() function.

  • views 14400
  • datetime Jul 08 08 04:23:20
  • author Sekar
  • rating

FFMPEG - Convert video files to FLV using FFMPEG command and Downloads ffmpeg.exe file

What is FFMPEG ?FFMPEG is a used to convert audion, video and images from one formats to another one and also supports grabbing and encoding in real time from a TV card.  FFMPEG is a gross platform and FFMPEG is developed under Linux. Note: Here you can download the ffmpeg.exe for windows Convert FLV vidoe to jpg image The following comma..

  • views 3592
  • datetime Nov 13 08 12:21:31
  • author Sekar
  • rating

Creloaded Arabic Language pack downloads

Cre loaded Arabic Lang pack downloads :-  You can download the CRE Loaded Arabi Language pack here. You just extract the zip files and copy to /inlcudes/languages folder. If you need more information about it, please read readme.html file.

  • views 300
  • datetime Nov 27 08 07:36:24
  • author Sekar
  • rating

How to Give Add To faviroute list in ur site

this code is used to add the site in to your browser add to favorties list.

  • views 7526
  • datetime Jul 08 08 10:18:32
  • author Damu
  • rating

Call the another controller function in cakephp

In cakePHP,Use the requestAction() function if you need to call a one method from the another controller, The example code given below, class NotesController extends AppController { function test() { $damu= $this->requestAction('/Stores/read'); $this->set('data', $damu); } } ================== class StoresController extends Ap..

  • views 1572
  • datetime Feb 25 09 09:14:41
  • author Damu
  • rating

Simplexml_load_file function

simplexml_load_file :- Its is interprets an XML file into an object. You can easily get the xml values by using the simplexml_load_file() function.The Syntax is : simplexml_load_file ( string $url ).The Example as follows,

  • views 315
  • datetime Jul 09 08 04:53:00
  • author Sekar
  • rating

How to view cached google pages of your site using PHP

How to view cached google pages of your site using PHP :- You can get the google cached pages on your site by using the following PHP script. Here also available demo and download for the script. Please check it out here.

  • views 1017
  • datetime Jul 10 08 01:11:40
  • author Sekar
  • rating

How to get the current execute file in php

How to get the current execute file in php You can get the current file name with extension by use the following codes

  • views 191
  • datetime Jul 16 08 11:00:40
  • author Damu
  • rating

Contact us page With Verification Image

Contact us page With Verification Image :-You can get the simple Contact us page with verification image ( CAPTCHA CODE). Its very easy to handle it. Here also available for demo and downloads. Please check it now..

  • views 221
  • datetime Jul 14 08 03:39:00
  • author Sekar
  • rating

How to get the last week starting and end date

How to get the last week starting and end date:- You can get the last week day and you can get starting / end day of the month by using MYSQL query. The PHP code given below,

  • views 215
  • datetime Oct 30 08 07:11:37
  • author Damu
  • rating

How to export the mysql data in to Excel file

hi need to export the  data's  in to excel file .  i create a class to export the data. call the function here two ways to take you give the field name means the particular fields only export or take the  full table.

  • views 217
  • datetime Jul 19 08 07:51:57
  • author Damu
  • rating

Replace the content in the particular directory

Replace the particular content in the directory :-You can the replace the particular content in the directory file.

  • views 188
  • datetime Jul 21 08 03:00:23
  • author Sekar
  • rating

YouTube grabber the embed code source download

YouTube grabber the embed code : - You can easily grab the embed and images from the youtube site. The following links to you can get the code. Click the Download link as follows.

  • views 1876
  • datetime Jul 24 08 10:38:18
  • author Sekar
  • rating

How to Turning OFF or ON PHPSESSID

Turning off PHPSESSID Check your php.ini file, and if it is not there, add the following line session.use_trans_sid = Off Alternativly, add this to your scripts: ini_set('session.use_trans_sid', 0);

  • views 167
  • datetime Jul 24 08 03:26:18
  • author Psbharathy
  • rating

Paypal Payment Gateway Script Downloads

Paypal Payment Gateway Script Downloads The Paypal class use to easy to integrate the your site. The code as follows, <?php class paypal extends payments { var $gatewayName='Pay Pal'; var $gatewayId ='paypal'; function paypal($cartID=''){ $sql =&sql(); $this->cart_id = $cartID; $this->data['currecy_code'] = 'USD'; $this->data['..

  • views 411
  • datetime Jul 25 08 01:56:33
  • author Sekar
  • rating

Clear or Remove all sessions in the domain

How to Clear or Remove all sessions in the domain :- session_destroy() function is used to clear the all session in the domain. The Syntax as follows: session_destroy() Example :- <?php // Initialize the session. session_start(); //create a new session for this domain $_SESSION['user'] = 'youropensource.com'; //destroy the ses..

  • views 153
  • datetime Jul 28 08 03:35:00
  • author Sekar
  • rating

IIF function

IIF function :-IIF stands for Immediate IF, this is a well-known function in most languages but unfortunately PHP does not contain such a function. PHPkit provide the functon as follows,Syntax :-IIF(condition , true statment , false statment ) ;

  • views 4528
  • datetime Jul 17 08 03:43:58
  • author Sekar
  • rating

String Comparison In PHP

String Comparison in php strcmp() is used to compare the given strings Syntax: strcmp(string1,string2); and it Returns < 0 if string1is less than string2; > 0 if string1 is greater than string2, and 0 if they are equal. Note : strcmp comparison is case sensitive //String Comparison $string1="This is an Example "; $string2="This is"; $str..

  • views 170
  • datetime Jul 29 08 06:52:11
  • author Psbharathy
  • rating

Str_replace :: String Replace Function in PHP

How to Replace the text with a variable in PHP ? str_replace() function used to replace the string. The syntax is, str_replace($find ,$replace , $content ) Example :- <?php $content = 'some world in the content.'; $find = 'some world' ; $replace = 'Some World'; echo str_replace($find ,$replace , $content ); ?> Output is : Some World in t..

  • views 175
  • datetime Jul 29 08 03:58:08
  • author Sekar
  • rating

How to compare the 2 strings with the specifed no of characters ?.

strncmp() Description Binary safe string comparison of the first n characters This function is similar to strcmp(), with the difference that you can specify the (upper limit of the) number of characters from each string to be used in the comparison. Note that this comparison is case sensitive Syntax strncmp ( string $str1 , string $str2 ..

  • views 205
  • datetime Jul 31 08 11:43:27
  • author Eric
  • rating

How to get the chnaged content iside the text area

Test Name

  • views 143
  • datetime Jul 31 08 02:39:17
  • author Damu
  • rating

Get the unmatched word in two string

How get the unmatched word in two string PHP :- You can get highlights unmatched word to compare the two string.. Example: $str = 'You are great!'; $str2 = 'You are really great!'; $arr1 = explode(" ",$str); $arr2 = explode(" ",$str2); $decr =0; for($i=0; $i

  • views 152
  • datetime Aug 01 08 03:25:00
  • author Sekar
  • rating

301 Moved Permanently in PHP Script

The following code the redirect the URL " http://www.yourdomain.com/page " to " http://yourdomain.com/page ". Example : $url = "http://$_SERVER[HTTP_HOST]/$_SERVER[REQUEST_URI]"; youropensource.com= parse_url($url); youropensource.com= $host[host]; if(substr($host,0,4) == 'www.'){ $url = str_replace("www.",'',$url); Header( "HTTP/1.1 301 Moved Permanently" );..

  • views 188
  • datetime Aug 04 08 02:21:38
  • author Sekar
  • rating

How to display the PHP errors in .htaccess

.htaccess to you can show the PHP errors, you write the following code in .htaccess file. php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on Or In PHP file to show the errors in your site, the code as follows, <?php error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?>

  • views 201
  • datetime Aug 06 08 11:18:51
  • author Sekar
  • rating

New PHP Template Parser

YourOpenSource PHP Template The YourOSTemplate class used to you can use the php variables in the HTML code. The PHP script as follows : <?php include_once('template.php'); $tpl = new YourOSTemplate(); $tpl->setValue('SAM','Great Your OpenSource PHP Template Code..'); $tpl->setBlockValue('LIST', array("NAME" => "Ryan","ROW" =>1,..

  • views 371
  • datetime Aug 06 08 03:36:57
  • author Sekar
  • rating

Call culate the Year and month Between the tow dates

To calculate the total years and months between the two different dates // fiind the year and month between the two dates in php $fromdate = "2007-12-06"; $curdate = date('Y-m-d'); $datediffrence = diffYearMonth($fromdate,$curdate); echo $datediffrence; function diffYearMonth($fromdate,$todate) { $from_dt = explode('-',$fromdate); $to_dt =..

  • views 204
  • datetime Aug 07 08 05:16:17
  • author Damu
  • rating

Show file name and size when uploding the files or images

Hi Folks, See below link, for display file size and name, when upload files or images using Jquery. http://www.pixeline.be/experiments/jqUploader/test.php

  • views 267
  • datetime Aug 08 08 12:13:03
  • author Ajoydhas
  • rating

PHP and Java Configuration in Windows

PHP & Java ConfigurationYou must to install the Java VM on your machine and use this extension. Windows User:- You must enable the php_java.dll in php.ini file. The first action you need to add the following line to the extensions section in php.ini file extension=php_java.dll Then, You need to create a new JAVA section in php.ini file, ..

  • views 188
  • datetime Aug 09 08 02:55:07
  • author Sekar
  • rating

Word Count in PHP

Word Count in PHP , WordCount function used to get the words of the sentence. Word_Count() function used to search the particular word in the string and return the no of words found in the string. The code as follows, <?php function wordcount($str) { return count(explode(" ",$str)); } function word_count($str,$word){ $str = str_repl..

  • views 447
  • datetime Aug 21 08 02:44:01
  • author Sekar
  • rating

Regular Expression Tricks

remove the space between the content $noPunc = preg_replace('/[^a-zA-Z-`]/', '', $content); ------------------------------------------------------------------------------- clean the start of the content $start= preg_replace('/ [-`]*/', '', $content); -------------------------------------------------------------------------------

  • views 164
  • datetime Aug 21 08 02:46:54
  • author Damu
  • rating

To order the recrods depends ont the word count

<?php // SAME FOR USING DB TO GET GET THE VALUES AND DISPLAY DEPEND ON THE WORD COUNT // DAMU function wordcount($str) { return count(explode(" ",$str)); } function word_count($str,$word){ $str = str_replace(". "," ",$str); $words = explode(" ",$str); $count=0; foreach($words as $key=>$value){ if($value == $word){ $count+..

  • views 192
  • datetime Aug 22 08 04:56:50
  • author Damu
  • rating

Autmatically Login into the PHPBB3 forum from the your primary site

If the member login to your site, automatically logged in the your phpBB forum in backend, so If the member goto the forums, they wont logged in again. Usage:- Create a new file and store in the PHPBB home directory and use the PHPBB class in your primary site. good luck! Requirements, PHPBB3 <?php global $phpbb_root_path,$phpE..

  • views 13602
  • datetime Aug 25 08 05:07:19
  • author Sekar
  • rating

Parsing Query strings

$str=$_SERVER['QUERY_STRING']; parse_str($str,$array); print_r($array) //returns the name value pair

  • views 147
  • datetime Aug 26 08 05:26:28
  • author Nimalan
  • rating

PHP vs ASP.NET

Difference between PHP and ASP.Net No ASP.NET PHP 1 ASP.NET has a lot of options for new development, Here you can use languages such as c# ,J# & VB.NET etc., Minimum language support eg, Java etc., 2 Development Environment :- ASP.NET has only one choice, Visual Studio whic..

  • views 217
  • datetime Sep 12 08 12:22:57
  • author Sekar
  • rating

SYMFONY FRAME WORK INSTALLATION

here is the step by step guide to install the SYMFONY frame work

  • views 168
  • datetime Oct 02 08 02:49:18
  • author Damu
  • rating

Email Indication when opened or read the mail

How to get the Email Indication when opened or read the mailSend the html message and put a 1px image, that image hosted on your server and your server will recored when the image is loaded. For example :- If anyone opened the mail, you get the indication to the mail_image.php with mail_id. that's all

  • views 160
  • datetime Oct 03 08 09:56:55
  • author Sekar
  • rating

PHP ONE FUNCTION TO GET THE DATAS FROM TABLE

function getuserval() { $con = mysql_connect('localhost', 'myuser', 'mypassword'); // Performing MYSQL QUERY SQL query $result = query_execute('SELECT name, password FROM usertable', 'blog_db', $con); // Filling up the array $resul = array(); while ($row = fetch_results($result)) { $result[] = $row; } // Closing ..

  • views 148
  • datetime Oct 01 08 11:14:19
  • author Damu
  • rating

What is Direct Checkout

DirectCheckout :- Direct Checkout is an innovative ordering system that provides the fastest possible way to checkout for a single page. list out the following information for the single page 1. Cart information, here customer can change the quantity of the products 2. Shipping information 3. Confirm Order ( display tax,shipping charges and ..

  • views 150
  • datetime Oct 02 08 09:49:11
  • author Sekar
  • rating

How to identify the spam email

Get the Spam email :- The is_spam_email() function to identify the mail is spam or not. The PHP function as follows, <?php function is_spam_email($email){ if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ return true; }else return false; } ?> Example :- <?php $email = "spam.....@youropensource.com"; if(!is_spam_ema..

  • views 228
  • datetime Sep 15 08 03:29:51
  • author Sekar
  • rating

URL REDIRECT CODE FOR ALL

IN PHP ===== <?php header("location:http://www.test.com/index.html"); exit; ?> IN JS ==== document.location.href='www.test.com/index.php'

  • views 142
  • datetime Sep 23 08 10:01:18
  • author Damu
  • rating

Advanced PHP Security

What is Security ?Security is a measurement, not a characteristic. It’s is also an growing problem that requires an continually evolving solution. A good measure of secure application is it’s ability to predict and prevent future security problems, before someone devises an exploit. As far as application design goes, security must be cons..

  • views 210
  • datetime Oct 05 08 01:10:06
  • author Sekar
  • rating

PHP and Security

PHP keeps on growing as a language, making headway into enterprise and corporate markets.Consequently PHP applications often end up working with sensitive data. Unauthorized access to this data is unacceptable. To prevent problems a secure design is needed >

  • views 219
  • datetime Oct 05 08 01:04:10
  • author Sekar
  • rating

Get the Directory Size

How to get the Directory Size ? The getDirectorySize() function used to get the exact size of the folder. The syntax is getDirectory(string directory_name); <?php echo getDirectorySize("dating"); function getDirectorySize($dir){ $size = dirsize($dir); return ConvertBytes($size); } function dirsize($dir,$buf=2) { static $buffer; ..

  • views 186
  • datetime Oct 04 08 06:25:50
  • author Sekar
  • rating

Security:: Input Validation

One of the key concepts you must accept is that user input is unreliable and not to be trusted.Partially lost in transmission between server & client.Corrupted by some in-between process.Modified by the user in an unexpected manner.Intentional attempt to gain unauthorized access or to crash the application.Which is why it is absolutely essenti..

  • views 237
  • datetime Oct 05 08 01:11:08
  • author Sekar
  • rating

Security:: Accessing Input data

As of PHP 4.1, there are a series of super-globals that offer very simple access to the input data.$_GET – data from get requests. $_POST – post request data. $_COOKIE – cookie information. $_FILES – uploaded file data. $_SERVER – server data $_ENV – environment variables $_REQUEST – combination of GET/POST/COOKIE >

  • views 224
  • datetime Oct 06 08 11:00:11
  • author Sekar
  • rating

Security:: Register Globals

Arguably the most common source of vulnerabilities in PHP applications. Any input parameters are translated to variables. ?foo=bar >> $foo = “bar”; No way to determine the input source.Prioritized sources like cookies can overwrite GET values.Un-initialized variables can be “injected” via user inputs. if (authenticated_user()) { $auth..

  • views 205
  • datetime Oct 06 08 11:08:45
  • author Sekar
  • rating

Solutions To Register Globals

Disable register_globals in PHP.ini. Already done by default as of PHP 4.2.0 Code with error_reporting set to E_ALL. Allows you to see warnings about the use of un-initialized variables. Type sensitive validation conditions. Because input is always a string, type sensitive compare to a Boolean or an integer will always fail.if ($authorized ==..

  • views 158
  • datetime Oct 06 08 11:25:50
  • author Sekar
  • rating

Security:: $_REQUEST and $_SERVER

$_REQUEST The $_REQUEST super-global merges data from different input methods, like register_globals it is vulnerable to value collisions. PHP.ini: variables_order = GPCSecho $_GET['id']; // 1 echo $_COOKIE['id']; // 2 echo $_REQUEST['id']; // 2 $_SERVER Even though the $_SERVER super-global is populated based on data supplied by the webserver..

  • views 234
  • datetime Oct 06 08 11:26:52
  • author Sekar
  • rating

Security :: Validation in String and Path

Numeric Value Validation All data passed to PHP (GET/POST/COOKIE) ends up being a string. Using strings where integers are needed is not only inefficient but also dangerous.// integer validation if (!empty($_GET['id'])) { $id = (int) $_GET['id']; } else $id = 0; // floating point number validation if (!empty($_GET['price'])) { $price = (float)..

  • views 377
  • datetime Oct 06 08 11:44:43
  • author Sekar
  • rating

Magic_quotes_gpc and Magic Quotes Normalization

magic_quotes_gpc PHP tries to protect you from attacks, by automatically escaping all special characters inside user input. ( ‘, “, \, \0 (NULL) ) Slows down input processingWe can do better using casting for integers.Requires 2x memory for each input element.May not always be availableCould be disabled in PHP configuration. Generic soluti..

  • views 196
  • datetime Oct 06 08 11:44:05
  • author Sekar
  • rating

Test Credit Card (CC) Numbers

List of Testing CC Numbers :-Card TypeNumberMaster Card 5105 1051 0510 5100 5555 5555 5555 4444Visa 13 Digits - 4222222222222 16 Digits 4111 1111 1111 1111 4012 8888 8888 1881 American Express3782 8224 6310 005 3714 4963 5398 431 Discover 6011 1111 1111 1117 6011 0009 9013 9424 JCB3530 1113 3330 0000 3566 0020 2036 0505

  • views 2553
  • datetime Oct 13 08 10:22:24
  • author Sekar
  • rating

Session Test Code

The following code to you can test the session is working or not in your domain. <?php session_start(); if($_GET[test] ==1){ if(isset($_SESSION[test]) && $_SESSION[test] == 1) echo "Session is working fine on your server.."; else echo "Session is not working . please contact your server adminstrator.."; }else{ $_SESSION[test] = 1; ..

  • views 144
  • datetime Oct 15 08 06:03:50
  • author Sekar
  • rating

Cake php for Beginner Part II (Starting Simple code)

cake php for Beginner Part II (Starting Simple code) following steps to start the code with cake php database and other configuration refer the link ----------------------------------------------------------- http://youropensource.com/projects/173-Cacke-PHP-Guide-For-beginner-Part-1-Configuration --------------------------------------------..

  • views 219
  • datetime Oct 18 08 04:20:37
  • author Damu
  • rating

Abstract Class

Abstract Class: Abstract class sample : abstract class aaa { //In abstract class a method must be declared as abstract. //For abstract methods there will be no body i.e. There is no implementation. //The Abstract methods can declare with Access modifiers(public,internal,protected etc )But //when implementing in subclass same access mo..

  • views 158
  • datetime Oct 30 08 07:34:57
  • author Damu
  • rating

OOPS Concepts in PHP

OOPS CONCEPTS IN PHP Access control modifiers: `````````````````````` Public: used from anywhere in the script Private: only be used by the object it is part of; it cannot be accessed elsewhere Protected: used by the object it is part of, or descendants of that class Final: This variable or function cann..

  • views 513
  • datetime Oct 30 08 09:22:45
  • author Damu
  • rating

SESSION WITH MYSQL TABLE

SESSION WITH MYSQL TABLE: handle the session with mysql table: <?php class Session { /** * a database connection resource * @var resource */ private $_sess_db; /** * Open the session * @return bool */ public function open() { if ($this->_sess_db = mysql_connect(SESSION_DB_HOST, ..

  • views 163
  • datetime Oct 30 08 09:43:10
  • author Damu
  • rating

Joomla Tempalte Helps

used to ech the my name in the page: <?php echo JText::_('Damu'); ?> IMAGE PATH :

  • views 181
  • datetime Nov 21 08 07:54:52
  • author Damu
  • rating

JavaScript Popup Windows

Popup windows are additional browser window opened from a web page. The popups are opened programmatically using JavaScript. Changing the features of the Popup You can control the features of the popup using the last argument to the window.open method. The following code opens a window with a status bar and no extra features. window.open ("h..

  • views 238
  • datetime Nov 17 08 10:40:48
  • author Psbharathy
  • rating

To Get the month name from given number in php

hi You have the number you need to find the corresponding month means <?php $number = 1; echo date("M",mktime(0,0,0,$number,15,2000)); ?>

  • views 671
  • datetime Jul 10 09 12:09:16
  • author Damu
  • rating

How to use check box , Option Button , Imagefiled like form fields in CakePHP?

CAKE FORM FIELDS : INPUT FIELD in cake php <?php echo $html->input('controllername/tablefieldname', array('size' => '25')); ?> HIDDEN FIELDS IN cake php > <?php echo $html->hidden('Professional/userid', array('size' => '25','value'=>"$loginusrid")); ?> TEXT AREA <?php echo $html->textarea('Professional/industry', ..

  • views 342
  • datetime Nov 21 08 07:46:04
  • author Damu
  • rating

What is different between in PHP4 and PHP5

PHP 4xPHP 5x 1PHP 4 objects weren't references<?php class YOS{ var $name ="YourOpenSource"; function getName() { return $this->name; } function setName($name) { $this->name = $name; } function change(&$obj,$name){ $this->setName($name); return $obj->getName(); } } $yos = new YOS(); $yos->change($yo..

  • views 262
  • datetime Nov 21 08 01:02:14
  • author Sekar
  • rating

How to get all the methods inside the calss

<?php class damu { function sekar() { return $name ="hi am sekar"; } function angapparaj() { return $name ="hi am angappa"; } } $d = new damu(); $first = $d->sekar(); $methods = get_class_methods($d); print_r($methods); ?>

  • views 175
  • datetime Nov 25 08 02:26:44
  • author Damu
  • rating

Gets the properties of the given object in the CLass in php

<?php class damu { private $a; public $b = 2; public $name = "damu"; function __constructor() { echo "hai"; } function sekar() { return $name ="hi am sekar"; } function angapparaj() { return $name ="hi am angappa"; } } $d = new damu(); $first = $d->sekar(); $methods = get_object_vars($d); print_r($methods); // out..

  • views 149
  • datetime Nov 25 08 02:39:07
  • author Damu
  • rating

Php function to remove the duplicate values in array

$array = attay("damu","sekar","damu") array_unique($array);

  • views 334
  • datetime Nov 26 08 10:53:04
  • author Damu
  • rating

Time delay in the Javascript

function closeme(id) { document.getElementById(id).innerHTML = "now ok "; } function wait() { setTimeout ( "closeme('add_form')", 1000 ); } content etnetnetn entententetn

  • views 187
  • datetime Nov 27 08 07:24:34
  • author Damu
  • rating

Convert the special char to unicode in PHP

The utf8_encode() or decode function to convert the unicode <?php echo $code = utf8_encode("Götte"); echo ""; echo $code = utf8_decode($code); ?> The output given below, Götte Götte

  • views 175
  • datetime Jan 28 09 03:26:27
  • author Sekar
  • rating

I want to Zero Fill and Decimal fields is also

The zeroFill() function used to you can fill the zero what you given the target. <?php echo zeroFill(16,5); function zeroFill($in, $target){ // by sekar if(strlen($in) The output as follow, 00016

  • views 168
  • datetime Jan 29 09 01:52:08
  • author Sekar
  • rating

How to check the valid ip using the regular expression

hi if you need to check the enter ip address is valid ip or not -- Using the Regular Expression. $my_ip = $_REQUEST['my_ip']; if (!preg_match("/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$/i", $my_ip)) { echo "invalid ip"; return false; }

  • views 110
  • datetime Mar 06 09 12:57:31
  • author Damu
  • rating

How to get the ip for the particular host

get the ip address for the given host name : sample Code: $host_ name = 'www.youropensource.com'; $ip = gethostbyname($host_ name); echo $ip ; Definition : gethostbyname() — Get the IP address corresponding to a given Internet host name string gethostbyname ( string $hostname ) Returns the IP address of the Internet host specified..

  • views 107
  • datetime Mar 06 09 01:03:47
  • author Damu
  • rating

How to get the Host Name for the website

Hi How to get the host name for the particular Web site address <?php youropensource.com= "www.youropensource.com"; // get the ipp adress for the url $ip = gethostbyname('www.youropensource.com'); // get the hostname for the url $hostname = gethostbyaddr($ip); echo $hostname; ?>

  • views 96
  • datetime Mar 06 09 01:18:32
  • author Damu
  • rating

How to get the Server Operating System Name Using th php

hi , How to get the Operating system name using the php Code echo $os = strtoupper(PHP_OS);

  • views 169
  • datetime Mar 06 09 01:52:06
  • author Damu
  • rating

Zip into a particular file

ZipArchive is a predefined class in PHP, so use this class to can create a zip files in PHP. This example opens a ZIP file archive test.zip and add the file /path/to/index.txt. as newname.txt. <?php $zip = new ZipArchive; if ($zip->open('test.zip') === TRUE) { $zip->addFile('/path/to/index.txt', 'newname.txt'); $zip->close(); ..

  • views 124
  • datetime Mar 13 09 03:32:39
  • author Sekar
  • rating

File Downloads script in PHP

In header() function used to download the file by using "Content-Disposition" attributes, and need to specify the type of file and charset is an optional. $filename="sekar.xml"; header('Content-type: application/xml; charset="ISO-8859-1"',true); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile($filename);

  • views 631
  • datetime Mar 20 09 12:53:24
  • author Sekar
  • rating

What is different between mysql_connect and mysql_pconnection

MYSQL Connect() 1. Open a new connection 2. We can close the connection 3. Opened new connection when page loaded. MYSQL pconnect() 1. persistent connection to a MySQL server. 2. We cant close this connection. 3. No need to open new connection until host,username and password is not different.

  • views 108
  • datetime Jun 18 09 08:27:52
  • author Sekar
  • rating

Get Current location/URL

The getURL() function used to get the CURRENT page location with query strings etc., the function as follows, function getURL(){ $url = 'http://'.$_SERVER['HTTP_HOST']; if($_SERVER['QUERY_STRING'] !='') $url .= $_SERVER['SCRIPT_NAME'] .'?'.$_SERVER['QUERY_STRING']; else $url .= $_SERVER['REQUEST_URI']; return $url; }

  • views 126
  • datetime Jul 04 09 04:59:09
  • author Sekar
  • rating

Pause() function in PHP

we can pause the php execution while running the php process by using sleep() function. The pause() function given below, function pause($seconds){ sleep($seconds); } delays or pause the program execution for the given number of seconds. In HTML, need to use meta tags,

  • views 2676
  • datetime Jul 08 09 09:51:50
  • author Sekar
  • rating

Convert date to timestamp php

<?php $indate= '2009-07-24'; cinverttimestamp($indate); function cinverttimestamp($indate){ list($year, $month, $day) = explode('-', $indate); $timestamp = mktime(0, 0, 0, $month, $day, $year); return $timestamp; } ?>

  • views 426
  • datetime Jul 08 09 01:56:16
  • author Damu
  • rating

How to get monday date if the given date is friday in php

how to calculate the next day date other then the day is Saturday or Sunday $str = '2009-07-12'; echo calculate_saturdaysunday ($str); Function for getting the next date if the given date is Saturday or Sunday function calculate_saturdaysunday($curent_dates){ // SATURDAY SUNDAY CALCULATION $time_stamp = convert_timestamp($curent_..

  • views 123
  • datetime Jul 08 09 02:42:48
  • author Damu
  • rating

PHP redirect

The redirect() function used to redirect the page without having errors. function redirect($url){ if (!headers_sent()){ //If headers not sent yet... then do php redirect header('Location: '.$url); exit; }else{ //If headers are sent... do java redirect...if java disabled, do html redirect. echo ''; ..

  • views 73
  • datetime Jul 28 09 10:58:34
  • author Sekar
  • rating

Arrays

What are Arrays? Arrays are special variables that can hold more than one value.These are special datatypes which allows to store a group of related datas in a structured table like format. How to create an array? Arrays can be created using array function. Syntax: <?php $array_name=array() print_r($array_name); ?> code: ..

  • views 91
  • datetime Jul 30 09 07:22:49
  • author Karthika
  • rating

Google Chart API

how can i show the Chart display in my web site using the Google Chart API http://chart.apis.google.com/chart?cht=p3&chd=s:hW&chs=250x100&chl=Direct|SEO http://chart.apis.google.com/chart? - this is the URL to the Chart API & - separates the parameters cht=p3 - specifies the chart type chs=250x100 - specifies the dimensions of th..

  • views 89
  • datetime Jul 31 09 01:51:34
  • author Damu
  • rating

PHP Cheat Sheet

I found this PHP cheat sheet at http://www.addedbytes.com/download/php-cheat-sheet-v2/pdf/ and I find it very helpful specially when you're in a hurry doing PHP programs and you want everything at your side for easy access.

  • views 54
  • datetime Aug 02 09 05:56:13
  • author Lazywriter
  • rating

How can i translate my web site content to another language

In my site i need to translate the site content into some other languishes how can i do ?? <?php /******************************************************************************* ** Class: googleTranslateTool ** Purpose: Translate text using Google language tools ** Filename: googleTranslateTool.class .php ** Author: Gabriel Solomon ** ..

  • views 96
  • datetime Aug 02 09 02:21:39
  • author Damu
  • rating

Stock Quoute using PHP

Hi How can we use the yahoo to show case the Particular stock value in our web sites , here i give one class to get the stock quote values from the finance.Yahoo.com <?php Class yahoostack { function get_yahoo_stock_quote($symbol){ $url = sprintf("http://finance.yahoo.com/d/quotes.csv?s=%s&f=sl1d1t1c1ohgv" ,$symbol); $fp = f..

  • views 53
  • datetime Aug 03 09 01:37:01
  • author Damu
  • rating

GetState in Google API

Getting Statename by using GOOGLE api The following method to get the state name or state code by given location. $location = "Ambasamudrum ,Tirunelveli"; $address = "http://maps.google.com/maps/geo?q=" . urlencode($location) . "&output=js"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $address); curl_setopt($ch, CUR..

  • views 88
  • datetime Aug 04 09 07:17:16
  • author Sekar
  • rating

Get MetaTags from the site

GetMetaTags The GetMetaTags function used to get the all the metatags from the given site or domain. function getMetaTags($domain=''){ $content =file_get_contents($domain ); $find ='/

  • views 57
  • datetime Aug 04 09 07:32:06
  • author Sekar
  • rating

PDF Comparison

i have a sample pdf file in a format of a application.user will upload a pdf in sample format.system should compare sample pdf file and the user upload file.and should tell if there is any mismatch.is there any pdf parser classes available for it.should be easier to use

  • views 83
  • datetime Sep 01 09 05:23:56
  • author Pavi.pmv
  • rating

Different between mysql_connect or mysql_pconnect

what is different between in mysql_connect and mysql_pconnect ?Mysql_connect opens a new connection each time a PHP page is called up, and closes the connection down again at the end of the request.Mysql_pconnect will also open a new connection when a PHP page is called up (at any rate, it will the first time after a server reboot), but it wil..

  • views 46
  • datetime Sep 09 09 02:53:43
  • author Sekar
  • rating

Getclass vs instance

Difference between getclass vs instancegetclass()----------Just give the name of the class of the given object . instance()----------Get the instance of the object, so if you want to access the all functions or variable with in the class, you need to calll instace() to create a instance of the object.

  • views 57
  • datetime Sep 09 09 03:04:51
  • author Sekar
  • rating

JUser and JUserTable class in Joomla

JUser and JTableUser class in JoomlaIf you want to add one or more fields in the registration, you need to add the variable in the following classesmJUserJTableUserFor JUser class, path is located at/libraries/joomla/user/user.phpFor JUserTable class, path is located at /libraries/joomla/database/table/user.php

  • views 94
  • datetime Sep 15 09 07:39:37
  • author Tech
  • rating

PHP Warning: Module \'mysql\' already loaded in Unknown on line 0

PHP Warning: Module 'mysql' already loaded in Unknown on line 0 It seems like you are trying to load the mysql module twice in your extensions.ini. Take a look at /usr/local/lib/php.ini or /home/user/public_htmlphp.ini. Which is your php.ini point for your domain. You may have duplicate module entries. You are on Windows, please take a lo..

  • views 161
  • datetime Sep 18 09 01:00:04
  • author Gopal
  • rating

How to create mail account from PHP script?

Email Accounts from PHP script :-The following code to you can create a email account on your server.function createEmailAC($cpuser,$cppass,$email,$epass,$equtoa='250'){    $f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$edomain&password=$epass&quota=$equota..

  • views 233
  • datetime Oct 01 09 04:13:33
  • author Sekar
  • rating

Auto_load

Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). In PHP 5, this is no longer necessary. You may define an __autoload function which i..

  • views 132
  • datetime Oct 08 09 07:42:51
  • author Vickeey2003
  • rating

Url validation in php

A function to validate URL (website name)I wrote the following function to validate the given url<?//url validation$url = validate_url('http://www.youropensource.com');  //is a  valid URL and returns TRUE$url = validate_url('https://www.youropensource.com');  //is a  valid URL and returns TRUE$url = validate_url('htt://w..

  • views 338
  • datetime Nov 06 09 07:16:35
  • author Psbharathy
  • rating

Cron Jobs in PHP

Hi all i need help for cron jobs in php. The technical Issue is if we send 100 emails in php. how can we send it . we have to create cron job to send emails page if anyone know that pls send ur codes  Thanks in Advance

  • views 88
  • datetime Nov 23 09 12:41:34
  • author Phpkarthic
  • rating

Cron Jobs

Hi , This is karthic working as web developer . can anyone post codes for cron using php. As perviously sekar sir told the good idea .its very useful and then how to make cron job in php .i know little bit using exec command through we can do that.but i didn't idea about that.so pls post the codes related like that.Thanks in Advance .

  • views 65
  • datetime Nov 24 09 11:13:21
  • author Phpkarthic
  • rating

.htaccess issue

Hi . How to use htaccess in localhost .I am using wamp server. Thanks in Advance

  • views 110
  • datetime Nov 24 09 11:19:24
  • author Phpkarthic
  • rating

Htaccess seo friendly urls

Hi,How to  make seo friendly urls using htaccess files .my Url : http://www.demo.com/success.php?id=2 http://www.demo.com/success/2 can anyone pls post codes..Thanks in Advance.

  • views 146
  • datetime Nov 25 09 06:30:37
  • author Phpkarthic
  • rating

SMTP commands authentication

Sending mail SMTP AuthSMTP-AUTH can be used to allow users to relay mail while denying relay service to unauthorized users, such as spammers. The following commands to able sending the mail from Telnet.C:>Telnet youropensource.com 25Telnet> HELO mail.youropensource.comTelnet> Ehlo YOSTelnet> AUTH PLAIN aEbeFegHRDseYOs1245aYu=Telnet..

  • views 99
  • datetime Dec 10 09 03:43:47
  • author Sekar
  • rating

Serialize() and unserialize() in php

serialize() and unserialize() :-Serialize :- This is useful for storing or passing PHP values around without losing their type and structure. For example stored the data like session data. The stored the data format like a:1:{s:5:"title";s:71:"This is simple example of the serialize and unserialize function in php";} Unserialize :- single s..

  • views 117
  • datetime Dec 11 09 05:53:32
  • author Sekar
  • rating

How to let PHP to create subdomain automatically for each user

Hi, How do I create subdomain like http://user.mywebsite.com ? Do i have to access htaccess somehow? Is it actually simply possible to create it via pure php code or I need to use some external script-server side language

  • views 43
  • datetime Mar 04 10 05:30:04
  • author Phpkarthic
  • rating

Mysql

How to lock the particular table in database.. Give me the executed query.

  • views 26
  • datetime Mar 10 10 06:22:18
  • author Anand78758
  • rating

How to convert web application to windows applications

Hi.. I can develop project in php and mysql. I want to convert these as window application.

  • views 29
  • datetime Mar 10 10 08:51:17
  • author Anand78758
  • rating

How to convert web application to windows applications

Hi.. I can develop project in php and mysql. I want to convert these as window application.

  • views 18
  • datetime Mar 10 10 08:51:25
  • author Anand78758
  • rating

Featured
Top User's
sekarSekar
Posts 172
$103.18 USD
tjrambabuTjrambabu
Posts 145
$17.96 USD
damuDamu
Posts 67
$16.75 USD
lazywriterLazywriter
Posts 24
$3.11 USD
psbharathyPsbharathy
Posts 24
$4.19 USD