RSS
people

PHP generate calendar file (ics)

I am working with some Event management system recently.
The system requirement need to send out the confirmation to those registrants with a calendar ics attachment.
For this, I need to make my application to generate the ics file and attach it inside the email notification.

Below is the source to generate the ics file.
read more »

9 Comments | Tags: , , ,

PHP connect to LDAP

I am working with a project that require connect to a AD to perform the user authorization.
Before configure my application to login using the AD profile, I always using a simple PHP script to connect the AD setting that provided by my customer.

Here is a simple script that let me know that those AD setting is correct or wrong.
read more »

1 Comment | Tags: ,

PHP session problem while using iframe.

Hi guys, recently i am so busy and not able to update my website often.

But today, I face a problem on the PHP session while using iframe to include a custom php file.
The custom php file just doing some select/update command using session data.
I try my script in Google Chrome & Mozilla Firefox, everything is working fine but not Internet Explorer.
The data inside the session is not retrievable and causing the entitle script not working.

Below is my sample script

< ?php
  session_start();
  //echo session_id(); //PRINT OUT THE SESSION ID
  if(!isset($_SESSION['mydata']) && $_POST['action'] == 'update')
    die("unable to get mydata");
 
  $_SESSION['mydata'] = 'ANYTHING';
 //PERFORM SELECT/UPDATE
?>

Above just a simple sample, if you using wordpress/joomla (php applications) and iframe the custom page and using Internet Explorer to retrieve and update it. The page should display “unable to get mydata” but not perform the update statement.
After debug for sometime, I try to print out the session_id() and found that everything the iframe page refresh, it will generate another new session_id but not use the previous id (This act differently with Firefox and Chrome) and this is the main issue causing my script is not working.

Then I google a bit and find the solution below.
read more »

17 Comments | Tags: , , ,

PHP call oracle store procedure

For PHP, it is not a difficult task to connect to Oracle database.
But recently, I am working on a project that require me to execute the oracle store procedure with pass in some input & retrieve the output.

It should be pretty easy, just I never try it before.
So I write a simple Oracle Store procedure & a PHP page.

Below is my testing.
read more »

2 Comments | Tags: , ,

Apache PHP unable connect remote MySQL

Recently I am setup a new server for one of my company client.
After finish configure the server & I am trying to setup SugarCRM inside the server, I found that the database connection part is not able to connect to a remote database server.
Then I try to fill in database information to local database server & everything is working fine.

Then I googled a while & found that it is a SELinux issue. It seem like block apache connect to a remote database server.

Below is my solutions:

read more »

No Comments | Tags: , , ,