Archive for the ‘PHP’ Category

PHP Mail Fuction

July 2nd, 2013, posted in PHP
Share

php mail fuciton,php mail,mail fuction,php cc and bcc,send mail by php,hotmail,gmail, gmail SMTP, mail configuration, mail issues, mail sending issues, php, php mail sending, Send Email Using Gmail as my SMTP from XAMPP (PHP), SMTP, XAMPP,html,

This is very good link to learn with examples about PHP fuction :

http://php.net/manual/en/function.mail.php

php mail fuciton,php mail,mail fuction,php cc and bcc,send mail by php,hotmail,gmail, gmail SMTP, mail configuration, mail issues, mail sending issues, php, php mail sending, Send Email Using Gmail as my SMTP from XAMPP (PHP), SMTP, XAMPP,html,

Share

Using PHP To Keep Copyright Footer Year Current

June 6th, 2013, posted in PHP
Share

Using PHP To Keep Copyright Footer Year Current,using php,copyright,current year,year,php coding,copyright-symbolUsing PHP to keep Copyright footer year current

Here’s the start of the Web Development series as part of the new addition to my Blog, including code tutorials and code snippets free for use. This article includes a small snippet of code that you can add to your site to ensure your footer PHP date is always at the current year. I’m sure the eagle-eyed users of the web are still seeing sites stuck on ‘© 2011 Copyright’ – so here’s a few easy ways to overcome it, forever !!

First thing you’ll need is a PHP web page. If your server handles PHP, then use the code below to insert into your website’s footer. Please note this will only work with PHP web pages not static HTML. Read more on PHP here.

Single Year Display

This literally just pulls in the current date using server technology, and is really easy to implement instead of manually typing the year (and forgetting about it).

&copy; <?php echo date("Y"); ?> Copyright.
Gives you: © 2013 Copyright.


Website Start and Current Year

Little longer PHP snippet – in which you set the date your website was launched, and let the PHP automatically keep the current year up to date. See below and example for details : Using PHP To Keep Copyright Footer Year Current,using php,copyright,current year,year,php coding,copyrightdate,copyright date,copyright

&copy; <?php
$copyYear = 2008; // Set your website start date
$curYear = date('Y'); // Keeps the second year updated
echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
?> Copyright.
Gives you: © 2008-2013 Copyright.
Share

How to change XAMPP server port?

April 9th, 2013, posted in PHP, Windows
Share

How to change XAMPP server port?,port,xampp,xamp,wamp,windows,php,html,website making,website desiginning,ServerName

To Change The XAMPP Server Port Number

  1. Stop the XAMPP server, if it is running already.
  2. Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf.
  3. Now search for the string *Listen 80 *(I’m assuming that your XAMPP was using the port 80. Otherwise, just search for the string ‘Listen’). This is the port number which XAMPP uses. Change this 80 to any other number which you prefer.
  4. Then search for the string ‘ServerName‘ and update the port number there also.
  5. Now save and re-start XAMPP server and you are done.

Why do we need to change the port number? Because, these days, it is very common that a web developer needs to have multiple web servers running, all at the same time. For example, an XAMPP server can be used to run the local WordPress blog, while a JBoss server also needs to be up for testing a java web applications. In such scenarios, if two or more servers are trying to use the same port number, then the late comer will fail to get the port. So, it becomes necessary to change any one server’s port number to avoid the conflict.

How to change XAMPP server port?,port,xampp,xamp,wamp,windows,php,html,website making,website desiginning,ServerName,port number

Share

PHP and HTML Marquee Tag

March 13th, 2013, posted in PHP
Share

This is one the best link to put marquee tags.
Helped mE a lot…
I hope will do to you guys as well…
Cheers..
😉

Link 1 : http://www.way2tutorial.com/html/html_marquee_tag.php

Link 2 : http://www.tutorialehtml.com/en/extras/marquee.php

Share

Oracle : Activate Oracle on XAMPP for Windows : OCI8 : XAMPP ORACLE CONFIGURATION

March 1st, 2013, posted in Oracle, PHP
Share

If you want to connect with Oracle database using PHP script you will have to do some effort. Because with the default installation of XAMPP for Windows, we don’t get PHP Oracle connectivity enabled. This can be enabled easily when you need to connect to a Oracle Database from your PHP application/script. PHP has got the OCI8 extension, which provides Oracle connectivity to PHP application, and OCI8 uses Oracle Instant Client Package to get Oracle specific functions.

I had the need to connect to a Oracle Database from a PHP script in one of my recent projects, the following is what I did to enable Oracle connectivity in XAMPP for Windows.

1. In your XAMPP Start Page, go to phpinfo, look for string oci8. If string found it indicate that connection to oracle is available, otherwise to activate connection do the following steps:
2. Open the currently used php.ini file by looking at the phpinfo, from the XAMPP folder.
3. Find string ;extension=php_oci8.dll. Remove the semicolon (;) ahead of the string to activate the oracle extension.
4. Save the php.ini file.
5. Download the “Instant Client Package – Basic” for Windows from the OTN Instant Client page. Unzip it to c:instantclient_11_1
6. Edit the PATH environment setting and add c:instantclient_11_1 before any other Oracle directories. For example, on Windows XP, follow Start -> Control Panel -> System -> Advanced -> Environment Variables and edit PATH in the System variables list.
7. Set desired Oracle globalization language environment variables such as NLS_LANG. If nothing is set, a default local environment will be assumed. See An Overview on Globalizing Oracle PHP Applications for more details.
8. Unset Oracle variables such as ORACLE_HOME and ORACLE_SID, which are unnecessary with Instant Client (if they are set previously).
9. Restart XAMPP (or Start if its not already started).
10. To make sure that connection to oracle database has successfully activated, go to phpinfo. Find string: oci8. If found, then XAMPP can now communicate with Oracle Database.

The steps to do the same on Linux are almost similar, except there you will use the Linux versions of the packages and setting PATH variables would be different.

To test the connection you can use this script

<?php
$conn = oci_connect('username', 'password', 'host:port/servicename');
$query = 'select table_name from user_tables';
$stid = oci_parse($conn, $query);
oci_execute($stid, OCI_DEFAULT);
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
foreach ($row as $item) {
echo $item." | ";
}
echo "
n";
}
oci_free_statement($stid);
oci_close($conn);
?>

*****************************************************************************************

If you need to configure your xampp installation (on winXP) to connect to the oracle

– first you need to download oracle basic instant client for windows

– After unzipping the instant client on a selected directory (i.e. c:/instantclient_11_1) you need to copy all dlls from this directory to “xampp/apache/bin/”

– Add instant client directory to windows system variable’s path : follow Start -> Control Panel -> System -> Advanced -> Environment Variables and edit PATH in the System variables list

– now open up php.ini from “xampp/php” and remove semicolon from this line “;extension=php_oci8.dll”

all you have to do is restarting apache and you’re all set

Another wonderful link for this topic is : http://me2learn.wordpress.com/2008/10/18/connect-php-with-oracle-database/

Share