khan kaka Posted August 2, 2004 Share Posted August 2, 2004 hi every one can any one tell me how i can add the value of javascript to session variable. here is my code. the calender output from javascript is in foreign language. soo i need to add the value to php session. ****************************** <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="javascript" src="date.js" type="text/javascript"></script> </head> <body><table width="63%" border="1"> <tr> <td bgcolor="#CC3300"><script language=""> document.write(dayf+" "+roozf+" "+mahf+" " + sal); </script> <?php $vari= "value"; $_SESSION['FirstName'] = $vari; ?> ********************************************************** how can i assign the value of ( $vari )with output from <script language=""> document.write(dayf+" "+roozf+" "+mahf+" " + sal); </script> ************************************************************ </td> </tr> </table> <p><a href="secound.php">next </a></p> <p> </p> </body> </html> *********************************************** thanks in advance Link to comment https://forums.phpfreaks.com/topic/1909-adding-javascript-value-to-session/ Share on other sites More sharing options...
Danno13 Posted August 3, 2004 Share Posted August 3, 2004 You could mabye try this. <?php echo "<script>"; $vari = echo "document.write(dayf+" "+roozf+" "+mahf+" " + sal);"; echo "</SCRIPT>; $_SESSION['FirstName'] = $vari; ?> Link to comment https://forums.phpfreaks.com/topic/1909-adding-javascript-value-to-session/#findComment-6217 Share on other sites More sharing options...
khan kaka Posted August 3, 2004 Author Share Posted August 3, 2004 it gaves me an error message soo its not working. Link to comment https://forums.phpfreaks.com/topic/1909-adding-javascript-value-to-session/#findComment-6218 Share on other sites More sharing options...
khan kaka Posted August 3, 2004 Author Share Posted August 3, 2004 You could mabye try this. <?php echo "<script>"; $vari = echo "document.write(dayf+" "+roozf+" "+mahf+" " + sal);"; echo "</SCRIPT>; $_SESSION['FirstName'] = $vari; ?> its not working Link to comment https://forums.phpfreaks.com/topic/1909-adding-javascript-value-to-session/#findComment-6219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.