Wednesday, May 7, 2014

How To Write PHP Code In Joomla Article

-----
How To Write PHP Code In Joomla Article

INTRODUCTION

This tutorial uses the following packages:
1) uWamp as the Window-Apache-MySQL-PHP package. (For further info, follow this link, http://setup-steps.blogspot.com/2014/03/uwamp-221.html)
3) Joomla DirectPHP Plug-in (Download from here, https://drive.google.com/file/d/0B86b-ALn-1MGZXpzZXpGSlY3UWs/edit?usp=sharing )

STEPS

0) Setup the uWamp.

1) Extract the Joomla Package content.

Extract to ..\uwamp\www\joomla31\...

2) Create database “joomla31”.

Run phpmyadmin.
Create a database “joomla31”.

3) Browse http://localhost/joomla31 

3.1) You will be redirected to http://localhost/joomla31/
There are 3 steps that you need to follow to setup Joomla 31 successfully.
Step1: Configuration
Enter details and click Next.
Step 2: Database.
Enter the database configuration details and click Next.
Step 3: Finalisation
Click Install.
Installation Done.
Click “Remove installation folder” button.

4) Browse http://localhost/joomla31 again.

You should get Joomla Front Page.

5) Browse http://localhost/joomla31/administrator.

You should get Joomla Back-end Login page.
Enter your admin login credential (refer step 3.1).
You should see Joomla Control Panel page.

6) Install DirectPHP Plug-in

6.1) You need DirectPHP plug-in (download from here, https://drive.google.com/file/d/0B86b-ALn-1MGZXpzZXpGSlY3UWs/edit?usp=sharing )
6.2) Go to menu Extensions/Extension Manager.
6.3) Choose the DirectPHP plug-in and click Upload & Install.
6.4) You should get a success message.
6.5) Go to menu Extensions/Plug-in Manager.
6.6)  Type “DirectPHP” in the search box. Click the button in the Status column to enable it.
6.7) You should get a success message.
6.8) Next, disable Tiny MCE Editor plug-in.
7) Create PHP Content.
7.1) Go to menu Content/Article Manager/Add New Article.
7.2) Create a new article.
Title= PHP Test
Content=
<?php
echo “Hello Joomla!”;
?>
Click Save & Close button.
7.3) When Joomla shows you the article lists, click the star button for the above article.
It should be like this now:
The article that you have just created should appear on the Front Page and it displays “Hello Joomla!”
-----

No comments:

Post a Comment

Labels