search
top
Currently Browsing: JavaScript

Page Redirect

I have written a script for getting the files list from directory and redirecting the page on selecting option from the select box. So you will get the script for fetching all the files from current directory and redirecting page on selection. <h>Please select option</h> <?php $path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; //current directory physical path $dir_handle =...
read more

Assign PHP Array to Javascript Array

I am describing here a very useful method for getting the values of a PHP array in JavaScript. For this we need to assign the PHP array values to a array in JavaScript. <?php $a = array('A','B','C'); ?> <html> <head> <title>Assign PHP Array to Javascript Array</title> <script language="javascript"> function showValues(){ var a=new Array; <?php for($i=0;$i<count($a);...
read more

ASCII example

You might have visited many sites related to songs or movies, you might have noticed that the searching is in Alphabetical order, so what will you do if you want such listing, write all the characters from A to Z ?. There is an easy way for implementing this in PHP. We can use function ord() and chr(). ord – Return ASCII value of character. chr – Return a specific character. I am attaching a simple...
read more

top