Archive for 'php'
How to use post and get method in ajax
Posted on 23. Apr, 2009 by admin.
Using GET method
Now we open a connection using the GET method.
var url = “get_data.php”;
var params = “lorem=ipsum&name=binny”;
http.open(“GET”, url+”?”+params, true);
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(null);
I really hope that this much is clear for you – I am assuming that you know a bit of Ajax [...]
Continue Reading
How to create rss using php – some easy steps
Posted on 23. Apr, 2009 by admin.
Step 1: Find your content.
An RSS feed should probably list all the content items in your main section. For example, if you run a blog, you can have an RSS feed of all your latest posts. If you run a small download site, consider a feed of your latest releases. Whatever content you choose, make [...]
Continue Reading
Parse Xml using jquery
Posted on 23. Apr, 2009 by admin.
Suppose we have a file name xml file as below
<?xml version=“1.0″ encoding=“utf-8″ ?>
<RecentTutorials>
<Tutorial author=“The Reddest”>
<Title>Silverlight and the Netflix API</Title>
<Categories>
<Category>Tutorials</Category>
<Category>Silverlight 2.0</Category>
<Category>Silverlight</Category>
<Category>C#</Category>
<Category>XAML</Category>
</Categories>
<Date>1/13/2009</Date>
</Tutorial>
<Tutorial author=“The Hairiest”>
<Title>Cake PHP 4 – Saving and Validating Data</Title>
<Categories>
<Category>Tutorials</Category>
<Category>CakePHP</Category>
<Category>PHP</Category>
</Categories>
<Date>1/12/2009</Date>
</Tutorial>
<Tutorial author=“The Tallest”>
<Title>Silverlight 2 – Using initParams</Title>
<Categories>
<Category>Tutorials</Category>
<Category>Silverlight 2.0</Category>
<Category>Silverlight</Category>
<Category>C#</Category>
<Category>HTML</Category>
</Categories>
<Date>1/6/2009</Date>
</Tutorial>
<Tutorial author=“The Fattest”>
<Title>Controlling iTunes with AutoHotkey</Title>
<Categories>
<Category>Tutorials</Category>
<Category>AutoHotkey</Category>
</Categories>
<Date>12/12/2008</Date>
</Tutorial>
</RecentTutorials>
The first thing you’re going to have to do is write some jQuery to request [...]
Continue Reading
Remotely login script throw curl in php
Posted on 21. Apr, 2009 by admin.
As we know php doesnt cum up with curl support by default for this u have to download a separte module libcurl which is basically for php. Using curl you can login to another site , grab the data and then log it off , just like a simple user do , you can use [...]
Continue Reading
PHP interview question part 4
Posted on 03. Apr, 2009 by admin.
1. How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
2. How can we destroy the session, how can we unset the variable of a session?
session_unregister () Unregister a global variable from the current session
session_unset () Free all session variables
3. How can we destroy the [...]
Continue Reading
PHP interview Quesion Part 3
Posted on 03. Apr, 2009 by admin.
1. How can we encrypt the username and password using php?
It all depends upon either you want to decode the password or not if u dont want to decode the password then the best way is to use the md5 function but if you want to decode as well either use baase_enocde function or use [...]
Continue Reading
Php interview Questions – part II
Posted on 03. Apr, 2009 by admin.
1. What is the differences between GET and POST methods in form submitting?
- On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
On the client side, the difference [...]
Continue Reading
Interview question — Part 5
Posted on 03. Apr, 2009 by admin.
1. What is the purpose of the following files having extensions 1) frm 2) MYD 3) MYI. What these files contains?
In MySql, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file [...]
Continue Reading
Interview questions For PHP
Posted on 03. Apr, 2009 by admin.
What does a special set of tags <?= and ?> do in PHP?
Its called short tag , in this case the output is directly displayed on the browser without using the echo or print statement.
What’s the difference between include and require,include_once and require_once? – In case of include and require it differ in how [...]
