Homepage
I, Me and Myself
Portfolio
Mindfolio
Blog
Guestbook

Typical WML File Structure

Posted on April 28, 08 @ 05:32 am under WML and WAP and has no comments.

<!-- The xml notation -->
<?xml version="1.0"?>

<!-- DOCTYPE specification -->
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">

<!-- Starting of WML Deck (set of cards) -->
<wml>

<!-- Starting of Card (screen displayed at once) -->
<card id="welcome" title="Welcome">

<!-- Everything has to be in paragraphs -->
<p>Welcome to WAP Content!!!</p>
<p><a href="page2.wml">Sample Link </a></p>
<p><a href="#contact">Contact Webmaster</a></p>

<!-- ... much more content ... -->

<!-- End of card -->
</card>

<!-- More cards if needed -->
<card id="contact" title="Contact Webmaster">
<p>Webmaster: Krishna Srikanth (a@b.c)</p>
</card>

<!-- End of WML deck -->
</wml>

April 28, 08

Posted on April 28, 08 @ 05:07 am under Diary and has no comments.

Every one in this world is so busy, except me. So busy that they dont want to talk atleast for a few minutes. Every one is sitting so quietly that I cannot bare this silence.

April 27, 08

Posted on April 26, 08 @ 04:18 pm under Diary and has no comments.

Today I installed the latest Ubuntu 8.04 Linux on my Windows drive (wubi installation). I am also able to connect to BSNL internet using ADSL router and am posting this message from Ubuntu. No doubt, Ubuntu will replace the Windows just in few years.

April 9, 08

Posted on April 09, 08 @ 09:10 pm under Diary and has no comments.

I found the real power of Orkut today. I found one of my old school friend and my school batch from Orkut. Guess what, there are few more Krishna Srikanths around the world (as seen in Orkut). One is in Atlanta GA, second in Bangalore, third in Visakhapatnam, fourth in Kakinada. I dont know if there are any more. Yes, Orkut should be given a prize for its concept. But the only problem is with names, most of which are very weird.

April 07, 08

Posted on April 07, 08 @ 08:15 am under Diary and has no comments.

Svasti sri chandramana sarvadhari naama samvatsara ugadi subhakankshalu. Wishing my relatives, well-wishers, friends and everyone, a happy and prosperous Ugadi. I hope this new year will bring peace all over the world as well as in the minds of everyone.

March 31, 08

Posted on March 31, 08 @ 07:46 pm under Diary and has no comments.

Today I gave training on PHP in TCS. There were six students. The way I started was some what different. I stuffed alot of information in my mind, but I forgot everything when I started telling. On the whole, I gave only 45% of what I have prepared. My colleagues said not to worry, as it was my first training program.

Today I also understood how insulting it would be for a faculty, when one of the trainees goes away while the class is going on. One of the student (a girl) went away talking on the phone, and came back after the session ended. I don't think she might have talked for two and half hours on the phone. Any way, I felt some what insulted. And she did not showed up for the second half of the session.

Second half was somewhat satisfactory. I showed the participants the application I was designing currently. I explained the Jasmine Framework which I have prepared. I think the participants were impressed by the programming style I follow.

I understood how difficult it is to explain a subject, though we are expert in it. Programming a script is different from explaining how it works. Really, this day has to be remembered in my life.

Windows Shortcuts

Posted on March 30, 08 @ 12:39 am under For Your Information and has no comments.

Hibernation:
rundll32.exe PowrProf.dll, SetSuspendState
(Make sure hibernation is enabled)

To clear auto logon
rundll32 netplwiz.dll,ClearAutoLogon

Getting Apache's ModRewrite to work

Posted on March 30, 08 @ 12:26 am under Webservers and has no comments.

Apache ModRewrite module makes the URLs to be rewritten in a search engine friendly manner. ModRewrite means Rewrite Module. For example, Drupal uses the ModRewrite to change the appearance of URLs. To use this functionality, ModRewrite should be enabled on the Apache server. This tutorial is based on Apache 2.2.8 on Windows. The same process can be applied to other versions.

First of all the rewrite module has to be enabled on the server. For this, in httpd.conf, uncomment the following line and restart the server.

<code>LoadModule rewrite_module modules/mod_rewrite.so</code>

Once it is done, its left to applications to use this feature. Applications need to turn on this feature in .htaccess file. For this, add following line to .htaccees file.

<code>RewriteEngine on</code>

Finally the rewrite condition has to be specified in .htaccess.



Calculating world times for PHP scripts

Posted on March 30, 08 @ 12:22 am under PHP and has no comments.

Some websites show timings of different places all over the world. This improves user interface. Often programmers find this tricky. So I thought to articulate this for future references.

Calculating time differences is done in two steps.
1. Calculating the time difference between the server zone and the GMT.
2. Calculating the time difference between GMT and requested place.

Suppose this server is in Arizona, i.e -7:00 Hrs from GMT. So first the difference needs to be calculated.

$gmt=time() + 25200;

The value 25200 comes from 7 x 1hrs (60 mins) = 420mins x 60sec/min = 25200 secs. Now this value is added to current time on server, got by time(). Now the GMT time (in secs) is calculated.

Next, we need to add/subtract the required location from the GMT time. The final time would be our required time.

Here are some of the examples and their difference (in seconds) from GMT .

$hawaii=$gmt-36000;
$alaska=$gmt-32400;
$arizona=$gmt-25200;
$mexico=$gmt-21600;
$santiago=$gmt-14400;
$indiana=$gmt-18000;
$brasilia=$gmt-10800;
$london=$gmt;
$paris=$gmt+3600;
$cairo=$gmt+7200;
$moscow=$gmt+10800;
$kabul=$gmt+16200;
$karachi=$gmt+17000;
$india=$gmt+19800;
$bangkok=$gmt+25200;
$singapore=$gmt+28800;
$hongkong=$gmt+28800;
$sydney=$gmt+36000;

Using FCKEditor in PHP websites

Posted on March 30, 08 @ 12:21 am under PHP and has no comments.

Many times, especially when it comes to content management systems, FCKEditor will be a useful thing. It generates html, that can be directly inserted into database, and can be displayed in relevant pages. This will be a reference of how to use FCKEditor in websites.

<strong>Compacting the FCK editor </strong>
The version supplied by the fckeditor.net contains other scripts for asp, cfm, etc. and language related messages contained in javascripts. The whole turns out to be around 3 mb or so. You can delete all these extra files and compact the editor, to be easily uploaded into FTP. For this, you can delete
- Other than PHP scripts in the fckeditor folder.
- Language messages other than English, located in editor/lang folder.
- Delete other than PHP connectors in editor/filemanager/connectors
- You may also want to keep only one theme which you like in editor/skins. I prefer the silver theme.
Now the folder size comes down around 1.8 MB, and its reasonable.

<strong>Knowing the files to be used</strong>
FCK can be centrally included by including fckeditor/fckeditor.php. The FCK object becomes available then and you can directly use it.

<code>include('fckeditor/fckeditor.php'); </code>

<strong>Creating the Editor</strong>
Once the environment is setup, you need to start using the FCKE. For this, just create an object, show the base path to fckeditor folder, and create() it. You can give the instance a name, while instantiating the object. In this case, myFCKE is the name given.
<code>
$fcke = new FCKeditor('myFCKE') ;
$fcke -> BasePath = 'fckeditor/';
$fcke -> Create() ;
</code>
Giving the Basepath relative to the fckeditor.php is a must, or else the icons will not be shown. This will generate the iframe window with necessary elements in it.

<strong>Uploading the files via FCKE</strong>
While inserting images, you may want to upload the newer ones via fck, for this, you need to enable this configuration in editor/filemanager/connectors/php/config.php. In this file, turn on the config by giving true for $Config['Enabled'].
<code>
$Config['Enabled'] = true ;
</code>
But be careful. Turning this On on a publicly accessible FCKE opens a risk of file uploads by anonymous users. It is recommended to login control the FCKE after enabling this.

Next you need to specify where the uploaded files reside. You can specify the path relative to document root in $Config['UserFilesPath'];
<code>
$Config['UserFilesPath'] = '/FCKEFiles/' ;
</code>
Note: The directory specified here must be writeable.

<strong>Using images and other objects in FCKE</strong>
The images uploaded via FCKE can be accessed at the time of inserting images.

<strong>Storing the value in database</strong>
The output of FCKE will be posted back as a normal form post, along with the other form fields, if any. You can capture this value from $_POST['myFCKE']. This value contains the html code with properly escaped quotes and other things. So you can directly put in database.

<strong>Getting back the FCKE value</strong>
For displaying in HTML
As the output of FCKE is HTML itself, the value retrieved form database can be directly echoed on the HTML page.

For editing back in FCKE
The HTML generated by FCKE can be understood by FCKE, so this HTML can be directly assigned to the $Value property of the object before create()ing it.
<code>
$fcke -> Value = $db->rows[0]['Content'];
$fcke -> Create();
</code>
Once the editing is finished, it can be directly inserted into database as briefed out previously.

Pages: 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - [22] - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35

•   Databases (6)
•   Diary (117)
•   HTML and Javascript (2)
•   For Your Information (18)
•   iSpecial Jokes (13)
•   Java related (1)
•   Javascript (1)
•   Jokes (41)
•   Mind Views (22)
•   My Observations (8)
•   Open Source Tech. (7)
•   PHP (6)
•   My Poetry (10)
•   Reviews (2)
•   Sing Along (21)
•   Sankaracharya Stotras (3)
•   My Talent (1)
•   Uncategorized (27)
•   Webservers (3)
•   Websites to see (28)
•   WML and WAP (3)
•   Zend Framework (10)

•   It is my personal site. Content included here is according to my wish. If you don't like my site, close it and go away.
•   'Mind Views' and 'My Observations' are purely opinions of mine and not others. If something in this site hurts you, control
     your mind and send me a mail. We will discuss. If you go to court of law, it's your wish. Every citizen has a right to express, so do I.
•   Some content in this site might not be appropriate for some audience, whose opinions differ with me. So don't try to argue with me.
•   Important: Don't try to judge me just by glancing this website. I am different outside.
•   This is a time-pass site. Reading it in a hurry will be useless.