Se241 Web Tech Lab
Se241 Web Tech Lab
5. (a) Write a PHP script to delay the program execution for the
given number of seconds.
(b) From an XML document (tree.xml), suggest three different
ways to retrieve the text value ‘John’ using the DOM
6. (a) Write a PHP script to read the current directory and return
a file list sorted by last modification time. (using
filemtime())
(b) Write a program that connects to a MySQL database and
retrieves the contents of any one of its tables as an XML
file. Use the DOM.
2 50436(P)/SE241
8. (a) From an XML document (email.xml), write a program to
retrieve and print all the e-mail addresses from the
document using XML.
(b) Write a PHP script, which changes the colour of the first
character of a word.
13. (a) Write a PHP script to read a file, reverse its contents, and
write the result back to a new file.
3 50436(P)/SE241
14. (a) Write a PHP script to look through the current directory
and rename all the files with extension .txt to extension
.xtx.
15. (a) From an XML document (tree.xml), suggest three different ways
to retrieve the text value ‘John’ using the DOM.
(b) Write a PHP program to compute the sum of first n given prime
numbers.
20. (a) From a XML document (tree.xml), suggest three different ways
to retrieve the text value ‘John using the DOM
(b) Write a PHP script to delay the program execution for the
given number of seconds
4 50436(P)/SE241
22. (a) Write a program that connects to a MySQL database and
retrieves the contents of any one of its tables as an XML
file. Use the DOM.
(b) From an XML document (email.xml), write a program to
retrieve and print all the e-mail addresses from the
document using XML
23. (a) Write a PHP script, which changes the colour of the first
character of a word.
(b) Write a program that connects to a MySQL database and
retrieves the contents of any one of its tables as an XML
file. Use the DOM.
5 50436(P)/SE241
29. (a) Write a PHP script to delay the program execution for the
given number of seconds.
(b) Write a PHP script, which changes the colour of the first
character of a word
———————
6 50436(P)/SE241