Archive for June, 2009

PHP Session not being passed from a web site to WordPress

Recently I had this case where a PHP session ($_SESSION) was not being passed from a web site to WordPress.

Basically, WordPress was installed and configured to be part of a web site and there was the need to use Sessions to control the login/logout process of the site.

Although the session_start() had been defined to WordPress, the latter did not recognize the session values and therefore simply ignored if a user was logged on.

After some research and some brainstorming with some great experts on the field, I realized that the problem was in the WordPress URL itself.

The problem was that although the domain was the same, WordPress was suppressing the “www” from the URL which caused the $_SESSION values not to be recognized.

Example:

Site URL: http://www.this-is-an-example.com

WP URL: http://this-is-an-example.com  (missing the “www.”)

Solution:

By adding the “www.” to the WordPress domain name the problem was solved:

  1. Login to WordPress Admin area
  2. Go to SettingsGeneral
  3. Add “www.” to the WordPress address (URL) and Blog address (URL).
  • email
  • Add to favorites
  • Facebook
  • Twitter
  • MySpace
  • del.icio.us
  • LinkedIn
  • Digg
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • IndianPad

11 Comments

Update Linklist dynamically

Some people dread the idea of having to update the Linklist dynamically but in fact it’s a very simple process:

  1. Update the PROGxx member that your system uses from PARMLIB:
    • Add/remove libraries as required
    • Change the LNKLSTnn reference to LNKLSTnn+1
  2. Issue the following MVS commands:
    • SETPROG LNKLST,UNALLOCATE
    • P LLA
    • SET PROG=xx
    • S LLA,SUB=MSTR
    • SETPROG LNKLST,ALLOCATE
    • SETPROG LNKLST,UPDATE,JOBNAME=*
  3. To make sure the libraries have been added /removed from the Linklist, issue the MVS command: D PROG,LNKLST

Example:

Let’s suppose your system is using SYS1.PARMLIB(PROG00) and the Linklist area in use is LNKLST00.

These would have to be the steps to follow:

  1. Edit SYS1.PARMLIB(PROG00) and add/remove the libraries you want from the Linklist area.
  2. Change all LNKLST00 references in SYS1.PARMLIB(PROG00) to LNKLST01.
  3. Issue the following MVS commands:
    • SETPROG LNKLST,UNALLOCATE
    • P LLA
    • SET PROG=00
    • S LLA,SUB=MSTR
    • SETPROG LNKLST,ALLOCATE
    • SETPROG LNKLST,UPDATE,JOBNAME=*
    • D PROG,LNKLST

Note:

Click here to check why we need to stop LLA and unallocate the LNKLST.

  • email
  • Add to favorites
  • Facebook
  • Twitter
  • MySpace
  • del.icio.us
  • LinkedIn
  • Digg
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • IndianPad

19 Comments

Display PARMLIB concatenation

An LPAR can have more then one PARMLIB dataset defined to it’s concatenation.

The PARMLIB concatenation is defined on the LOADxx member and we can use the MVS command “D PARMLIB”to list it.

Example:

“D PARMLIB” command returns:

RESPONSE=LP1T
IEE251I 08.54.47 PARMLIB DISPLAY 825
PARMLIB DATA SETS SPECIFIED
AT IPL
ENTRY  FLAGS  VOLUME  DATA SET
1      S    LPCT01  SYS1.PARMLIB
2      S    LPCT01  CPAC.PARMLIB
3      S    LPRS01  SYS1.IBM.PARMLIB

  • email
  • Add to favorites
  • Facebook
  • Twitter
  • MySpace
  • del.icio.us
  • LinkedIn
  • Digg
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • IndianPad

No Comments

Work with records older then x days

For the sake of this example, let’s assume that:

  1. we want to work with records older then 60 days
  2. the table name is ‘table’ (how original!)
  3. the table field with dates is called date_field :-)

DELETE FROM table WHERE date_field < DATE_SUB(CURDATE(),INTERVAL 60 DAY)

This MySQL command deletes all table rows whose date is older then 60 days from current date – CURDATE() -.


SELECT something FROM table WHERE date_field< DATE_SUB(CURDATE(),INTERVAL 60 DAY)

This MySQL command selects all table rows whose date is older then 60 days from current date – CURDATE() -.


Explanation:

DATE_SUB(date,INTERVAL expr unit) -> Subtracts two dates

CURDATE() -> Returns the current date

unit can be:

  • MICROSECOND
  • SECOND
  • MINUTE
  • HOUR
  • DAY
  • WEEK
  • MONTH
  • QUARTER
  • YEAR
  • SECOND_MICROSECOND
  • MINUTE_MICROSECOND
  • MINUTE_SECOND
  • HOUR_MICROSECOND
  • HOUR_SECOND
  • HOUR_MINUTE
  • DAY_MICROSECOND
  • DAY_SECOND
  • DAY_MINUTE
  • DAY_HOUR
  • YEAR_MONTH
  • email
  • Add to favorites
  • Facebook
  • Twitter
  • MySpace
  • del.icio.us
  • LinkedIn
  • Digg
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • IndianPad

No Comments