I’m posting data to a page and after that I want to navigate to another page at the same time. I’m using a javascript to post the data and I checked it be echoing its values and it works fine when I send only post data but when I’m redirecting to another page and try to access those post data it seems to be not set.
and by the way what I have written is a javascript like this
function getsupport ( selectedtype )
{
document.folderCreation.supporttype.value = selectedtype ;
document.folderCreation.submit() ;
document.location.href=”../../index.php”;
}
and in the form :
<form action="index.php" name="folderCreation" method="POST" >
<input type="hidden" name="supporttype" /><?php
while($row = mysql_fetch_array($rs))
{
$filePath=$row['pathFromImages'];
$id=$row['id'];
?>
<a href="javascript:getsupport('<?php echo $filePath;?>')" ><?php echo $filePath;?></a>
</br>
<?php
this form values are posted correctly when the line :document.location.href=”../../index.php”; is not there. Why is this not working?..
Thanks in advance.
This piece of code should work:
javascript function: