How To Insert HTML, Javascript, PHP Code Into Joomla 1.5 Administrator Page
It begins when i found that my client have problem to contacting me because she do’nt have Yahoo Messenger account, and i only accept any consultation through Yahoo Messenger. Then i was thinking about inserting Yahoo Messenger Pingbox or simply contact form inside her Joomla 1.5 Administrator Page area so she can contacting me every time she needed help with her Joomla site.
Here are default of Joomla 1.5 Administrator Page screen shot (click image to enlarger):
We can insert HTML, or Javascript, or PHP, even Flash embed into that area:
- Prepare your code / script, i give an example from PHP form (this is just example, you can add anything):
<?php
if (isset($_REQUEST[‘email’]))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST[‘email’] ;
$subject = $_REQUEST[’subject’] ;
$message = $_REQUEST[‘message’] ;
mail( "test@just-test", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for contacting me";
}
else
//if email is not filled out, display these form
{
echo "<form method=’post’ action=’mailform.php’>
Email: <input name=’email’ type=’text’ /><br />
Subject: <input name=’subject’ type=’text’ /><br />
Message:<br />
<textarea name=’message’ rows=’15′ cols=’40′>
</textarea><br />
<input type=’submit’ />
</form>";
}
?> - Open this file (Joomla cpanel administrator) on your Joomla site:
/administrator/templates/khepri/cpanel.php
And find these on line 80:<jdoc:include type="component" /> - Now we can add any code / script below that line, i will give example by insert PHP form above, so the code will shown:
<jdoc:include type="component" />
//start insert custom code
<?php
if (isset($_REQUEST[‘email’]))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST[‘email’] ;
$subject = $_REQUEST[’subject’] ;
$message = $_REQUEST[‘message’] ;
mail( "test@just-test", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for contacting me";
}
else
//if email is not filled out, display these form
{
echo "<form method=’post’ action=’mailform.php’>
Email: <input name=’email’ type=’text’ /><br />
Subject: <input name=’subject’ type=’text’ /><br />
Message:<br />
<textarea name=’message’ rows=’15′ cols=’40′>
</textarea><br />
<input type=’submit’ />
</form>";
}
?>
//end of custom code - After inserting that php code, so our Joomla 1.5 administrator page will shown like this (click image to enlarger):
Thats all, you can change my PHP form code example into HTML, javascript (like adsense code), iframe (like shoutmix chat box) or flash embed (like youtube or yahoo pingbox).
Related posts:












January 3rd, 2010 at 6:49 pm
[...] the rest here: How To Insert HTML, Javascript, PHP Code Into Joomla 1.5 … By admin | category: joomla, joomla site | tags: every-time, form-inside, joomla site, [...]http://joom.com.cn/how-to-insert-html-javascript-php-code-into-joomla-15/
January 5th, 2010 at 2:16 pm
It’s very good thing that you always keep your eyes on the problem of your clients and give some better solution as like this.
January 5th, 2010 at 5:39 pm
Thanks for the info .
January 7th, 2010 at 2:11 am
this is very interesting. and veroy good explained especially with the pictures that are included.
January 8th, 2010 at 9:42 am
Thanks for the lesson & the pictures, it’s easier for me to understand now.
January 18th, 2010 at 2:50 pm
Gr8 explanation, It was very helpful to learn something new i bookmarked this post.
January 25th, 2010 at 2:50 pm
the entry is good!
March 7th, 2010 at 5:01 pm
Nice post and your screenshots are wonderful. They had help in the tutorial very much.