Category Archives: PHP

PHP

Recover Your Joomla Administrator Password

logo Recover Your Joomla Administrator PasswordJoomla is very popular CMS, it’s easy to setup and require only working php and mysql installation.

A problem may arise when your administrator password lost or forgot.

Can I recover my admin password or create a new one ?

It’s common question in "Setting your own Content Management System" workshop.

Use php md5() function !

Here’s the steps :

1. Open your php ide and type this code :

$my_new_password =’my_joomla_administrator_password’;
$my_md5_password=md5($my_new_password);
echo "My New Joomla Administrator Password is : $my_md5_password";

save this snippet as joomla.php and run it in browser.

2. Copy paste your md5 generated password.

3. Open phpmyadmin and select joomla database.

4. Select user table (jos_users) and find administrator entry, click edit icon.

edit Recover Your Joomla Administrator Password

5. Replace your password with password in step 2

edit2 Recover Your Joomla Administrator Password

6. Save your changes

edit3 Recover Your Joomla Administrator Password

7. Done, try login to administrator page with new password.

PHP

Year Validation with PHP

This code snippet validate user input from a form :

$year=strip_tags($year);

if(empty($$year) || is_numeric($year) || strlen($year)!=4 || $year

  1. strip all html tags ( handle by strip_tags )
  2. make sure the year in 4 digit (with strlen help)
  3. make sure its number not character (is_numeric)
  4. not empty (php empty function)
  5. force user enter year of birth not less than 1970

More information about those function, read php manual or search from php.net

PHP

Regex, nightmare for newbie

buddy Regex, nightmare for newbieRegex (Regular Expression) is nightmare for me, validation email, pattern recognizing task always depend on regex.

A few software out there will help us (newbie) to learn regex faster with “experience mentor”

I like these software :

1. Regexbudy
A lot of video demo
PHP section

2. Regexcouch
For medium level, since I’m totally newbie icon smile Regex, nightmare for newbie

Mastering regex book also helpfull, I just forgot the title, but in my amazon wishlist.

I just spend some money for openbsd books icon smile Regex, nightmare for newbie

Other good source :

PHP Manual on Regex Section

Happy learning icon smile Regex, nightmare for newbie

PHP

Configure another extension for php file

apache Configure another extension for php fileWhile surfing in internet my student see "strange" file extension .love

He asked me : "How it could be ?"

Well, I told him about another feature of httpd.conf

Just open httpd.conf , find this line :

AddType application/x-httpd-php .php

Change it into

AddType application/x-httpd-php .php .love .dear .whatever

Save httpd.conf and restart apache

You can save your php file as filename.love or filename.dear

httpd Configure another extension for php file

PHP

PHP 5.2 released

PHP News

  • PHP 5.2 release
  • PHP Manual (chm, last update 5 Sep 2006)

NetBSD 3.1 release,
NetBSD 3.1 contains many bug fixes, security updates, new drivers and new features like support for Xen3 DomU

Wait XAMPP for update to last version icon smile PHP 5.2 released

PHP Web Server

Testing mail() function with agrosoft mail server 2

In my last post I have introduce about Agrosoft mail server (AMS) . Since this day isn’t end yet, I’ll start by word “Lets continue today lesson” icon smile Testing mail() function with agrosoft mail server 2

I start by opening MS-Frontpage then make simple form mail which generate HTML code for me and I save it as contact.htm

Code in send_mail.php :

<?php

mail(“alamster@localhost”,”Form Mail”,”$message”,”From: tes@localhost”);

echo “Got your message ! Thank You very much “;

?>

Save both file in htdocs or www directory.

Call it from browser :

http://localhost/contact.htm

read more »

PHP Web Server

Testing mail() function with agrosoft mail server …

logo argo Testing mail() function with agrosoft mail server …Soon or later every people who learn php will meet PHP lovely function for sending email mail()

Unfortunately many beginner who install only PHP, MYSQL and Apache in windows don’t know how to test their email script like contact form, mailing list etc.

Today, I’ll show how to install mail server software available in internet called Argosoft Mail Server.

Pre requirement :

- Working WAMP application ( I use XAMPP Lite Portable)

Ok, now go to Argosoft website and download Mail Server ( Choose Freeware)

Important Argosoft Mail Server ( AMS ) feature that we need:

1. POP3 server

POP3 server responsible for retrieving email from server

2. Built-in web server with webmail

We need to check our script result

Step by step :

Install exe file by double click

install argo1.0 Testing mail() function with agrosoft mail server …

Click setup

install argo2.0 Testing mail() function with agrosoft mail server …

Click Install tab to begin installation process

Start running your mail server

Just double click AMS icon in desktop to start this application

New instance of AMS will start and reside on tray

To make sure no service conflict , click the AMS icon on the tray to find out

install argo4.0 Testing mail() function with agrosoft mail server …

As you see there is error message “address already in use”, by default web server will use port 80

We do have apache running in that port , click CTRL + O to configure new port for AMS web server. (choose PORTS tab)

install argo5 Testing mail() function with agrosoft mail server …

Change Web Interface port from 80 to anything you want , I already have port 8080 for Oracle port so I choose 8083

Exit from AMS and start again

install argo6 Testing mail() function with agrosoft mail server …

Now web server run on port 8083

Try open from browser :

http://localhost:8083

install argo7 Testing mail() function with agrosoft mail server …

If You see this page it means your job is finish, You have working mail server plus webmail .

Next time I’ll continue on adding new user and testing script for mail() function.

See You

Update : part II is compelete, also with video.

PHP Web Server

OpenBSD 4.0 is Out

fbsd.0 OpenBSD 4.0 is OutI just realized that today is November 1 and a few big thing release :

My Freebsd 6.1 need upgrade and so my openbsd box ( 3.7)

I still new in CI , CI attract me for its active development and huge support of supportive fan.

I decide to move PCT to version 2.0 with CI as framework now still in learning phase , setup coding guideline for teamwork etc.

Need to sleep now

It’s wget time icon smile OpenBSD 4.0 is Out

PHP Web Server

Easy PHP Installer , XAMPP or WAMP ?

php Easy PHP Installer , XAMPP or WAMP ?
In my recent study to help me study PHP5, I’m looking forward for “easy php installer” that can help me to code in PHP4 (production) and then easily change to PHP5 (learning OOP).

I used to use Appserv in my laptop or office PC but now it can’t help me any longer with PHP5 and PHP4 since I have to choose between appserv for PHP5 OR PHP4 .

Searching with uncle google help me find two solutions for my need :

1. XAMPP ( http://www.apachefriends.org/en/xampp.html)
2. WAMP (http://www.wampserver.com/en/)

XAMPP has two version :

Full and lite version

Full version has following feature :

  • Apache
  • MySQL
  • PHP + PEAR
  • MiniPerl
  • OpenSSL
  • phpMyAdmin
  • XAMPP Control Panel
  • Webalizer
  • Mercury Mail Transport System
  • FileZilla FTP Server
  • SQLite
  • ADODB
  • Zend Optimizer
  • XAMPP Security

Plus other “important feature” for installation

  1. Method A: Installation with the Installer
  2. Method B: “Installation” without the Installer

Full version is my choice since it come with PHP4 and PHP5

Lite version come with PHP5 and no PHP4

WAMP is great too , almost same as XAMPP BUT I have to install it to my computer

Since I must doing presentation to friends, my boss etc . I choose to use XAMPP because it’s portable , can reside in my Flash disk .

Draw back of these installer for me is MYSQL version .
I’m a fan of MYSQL 4.0x since my hosting company still use it in production .

But later I’ll switch to MYSQL4.1 or MYSQL 5 which is recomended by MYSQL AB company .

I’ll explore interesting facility in XAMPP like Mercury Mail Transport System for mail(), how to use it in local environtment etc.

See you

PHP Web Server

Do You Use PHP5 in Production?


php5 Do You Use PHP5 in Production?PHP 5 is getting mature , last version according to php.net is 5.1.6 but still many people (specially me) tend not to use in production scale . Why ?

1. As newbie , I’m afraid of OOP
PHP 5 support “real OOP” , person who has background with C++ or Java or Delphi has no problem with OOP . I’m not – not an easy task to switch from procedural to OOP style

2. Web hosting in general still use PHP4
Cpanel or other script for hosting management still using “stable” version which is PHP4
There’s no reason why “reinvent the wheel” to support minority customer who like to use PHP5 than average customer that like to see their hard work which is working flawlessly in PHP4

3. Is my application still work if I’m migrate to PHP5 ?
It’s my personal question to myself and fortunately I’m to lazy to find it out

4. I’m a lamer
I like to see other people code and study how it work , and when I see sample code that use PHP5 . Whoa … OOP in action , help…help . No “hello world” tutorial in PHP5 ? Wake me up please icon smile Do You Use PHP5 in Production?

Finally, Now I’m to lazy but wait, I’ll change to look after You all guys .

I’ll learn and we’ll see then