How to parse XML with PHP SimpleXML, DoM and Xpath

The easiest way to parse the XML in PHP is SimpleXml . It is using the Dom parsing model internally. The Xml document that we are going to parse must be well format it means that it has to have a root element. and the nodes with opening an closeting tag all in inside it.

The well format Xml can be simple as this

<?xml version="1.0"?> <message>Hello World</message>

and the Valid Xml should be like this. it does not matter to have valid xml PHP can parse it as long as it be well format

<?xml version="1.0"?> <!DOCTYPE message SYSTEM "message.dtd"> <message>Hello, World!</message>

How to Execute Javascript on Ajax return

Ajax is a nice technology to develop more interactive web pages and enhance user experience. with Ajax you can send a request to your web server with JavaScript and get the response, and show it on your page without refreshing the page .

The popular problem for developer regarding to use of Ajax is when you need to some JavaScript in your web server response to be run. for example when you want to check the user input in a form\'s field and return a message by JavaScript alert function if its wrong, but because of that JavaScript code just import or innerHTML to your page like some text it doesn\'t not not actually execute to show an alert .

How to parse the RSS and RSS Items in Java

these codes have been used in a spring framework project. So I have a RSS and RSS Item objects in my RSS domain package, and here I am trying to read XML from remote page to parse and save it in my database. Some of my fields in database are not null so I have to check them if there is a value for them in RSS page or not (for example does the XML page has Rating tag or not)

How to create a screen shot from a website by PHP without any external web service

For creating a screen shot from a website in this solution we are using a JAR file that can open the default web Brower on web server and browse the target website and when it opened the JAR file creates the screen shot and save it in given address on web server.

The Jar File accepts two arguments the first one is the address of target website and the second one is place for saving the image...

htaccess tips and tricks part one

The .htaccess file is a very powerful configuration tool for those users that use Apachi server. Here are some information and samples of usage about how an .htaccess file can be placed in the various directories of your web server to provide specific handling of various Apache web server options for that directory.

what are the most usage of .htaccess

  • Specify custom error documents
  • Add special document handlers and MIME types
  • Set environment variables
  • Redirect URLs from one to another
  • Rewrite one URL into another
  • Restrict documents to specific people

Create a nice and easy to use blog (xhost.co)

In this fast growing world every things are going to be computerized and internet plays a significant role. People need engage to websites to find out information they are looking for. In the recent years a new concept has been introduced which rocked the world and its called Blogging platforms. This Project aimed to create a new blogging platform from scratch which focused on standard and usability. The designed platform lets the user to create a blog in less than minute and start publishing on the internet without having any knowledge about web design of programming. Platform provides different ways for a publisher to receive feedback from reader, feedback could be in the form of comment for a post, rate to article or sending a message. A template engine has been implemented which makes the user able to manipulate each part of blog such and as logo, header, footer and etc. Professional photo gallery is another facility of this website which allows the users to categorize pictures in pre defined albums and published them on the internet.

Statistic page for each blog could show the number the unique visitors, hits and source of the traffic all in different type of diagram which will create on the fly by website and lots of the features that would encourage the website visitors to become member and for those who already have blog transfer it to this platform.

  1  

Copyright Yasha Asadpoor | 2010 - 2011 | Http://www.Yasha.Co