This is my php file in which I want to validate only numeric input for my text-boxes , with ids = Mobile & Home:
$elementids = array("Mobile","Home");
$serialized = rawurlencode(serialize($elementids));
$testvar='validatenumbers.php?elementids='.$serialized ;
<script type="text/javascript" src="only-numbers.php?elementids=<?php echo $serialized ; ?>"></script>
Then , the other file : validatenumbers.php :
$testvar = unserialize(rawurldecode($_GET['elementids']));
echo "<pre>";
print_r($testvar);
echo "</pre>";
It displays nothing , i.e. there is nothing in the '$testvar' array.
----EDIT------ When am checking $_GET, then it shows :
$_GET['elementids'] ---- a:2:{i:0;s:24:\"Mobile\";i:1;s:20:\"Home\";}
rawurldecode($_GET['elementids']) ---- a:2:{i:0;s:24:\"Mobile\";i:1;s:20:\"Home\";}
unserialize(rawurldecode($_GET['elementids'])) = **empty**