watthehell Posted September 9, 2007 Share Posted September 9, 2007 hi all, I got this code: This is for the calendar what i have made, it works fine... the value of $i is the daycount (1..30 or 31), What i did is when i saved the value of $i in $_SESSION['mydate']= $i; It works fine, but what i need is when i mouse over the calendar day i need to pass the dayvalue to another pop up window from where i can fetch the data from the database for that day.. Is it possible to do this with Javascript and PHP (without using AJAX). <?php echo "<td class=".$class_bg."> <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips)\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; ?> This code is copied from above.. altered the javascript On mouse over i am passing the variable for day... it did not work <?php<tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips+".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr>?> thnks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/68575-help-on-php-saving-value-in-session-and-retrieving-in-popup-window/ Share on other sites More sharing options...
pranav_kavi Posted September 9, 2007 Share Posted September 9, 2007 <td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips+".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td> i think u shud try it as,if ur passing $i as a seperate parameter to javascript fn. <td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, msgTips,".$i.")\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td> Quote Link to comment https://forums.phpfreaks.com/topic/68575-help-on-php-saving-value-in-session-and-retrieving-in-popup-window/#findComment-344702 Share on other sites More sharing options...
watthehell Posted September 9, 2007 Author Share Posted September 9, 2007 IT shows error while doing that.. cause the javascript is like this function doTooltip(e, msg) { if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return; Tooltip.clearTimer(); var tip = document.getElementById? document.getElementById(Tooltip.tipID): null; if ( tip && tip.onmouseout == null ) { tip.onmouseout = Tooltip.tipOutCheck; tip.onmouseover = Tooltip.clearTimer; } Tooltip.show(e, msg); } Quote Link to comment https://forums.phpfreaks.com/topic/68575-help-on-php-saving-value-in-session-and-retrieving-in-popup-window/#findComment-344705 Share on other sites More sharing options...
pranav_kavi Posted September 9, 2007 Share Posted September 9, 2007 so tat means javascript fn parameter-'msg' holds the value of $i.so ur code preferably shud b, <td align="right\" valign=\"top\" class=".$date_class."><a href=\"#\" onMouseOver=\"doTooltip(event, \'".$i."\')\" onmouseout=\"hideTip();\" class=".$date_class.">".$i."</a></td> Quote Link to comment https://forums.phpfreaks.com/topic/68575-help-on-php-saving-value-in-session-and-retrieving-in-popup-window/#findComment-344708 Share on other sites More sharing options...
watthehell Posted September 9, 2007 Author Share Posted September 9, 2007 javascript function MEssage hold this value : var msgTips = mytoday+'<font color="white"><strong>Reserved Time For </strong></font> <?php echo @$_SESSION['mycurrdate'];?><hr><?php $tbl=new Model; $tbl->_table_name=RESERVATION_TABLE; $sSqlQuery3="select * from ".RESERVATION_TABLE." WHERE 0=0"; $row3=$tbl->find_query_all($sSqlQuery3); foreach($row3 as $res3){ echo "From:".$res3->user_reserve_time_start." "; echo "To:".$res3->user_reserve_time_end." <hr>"; //echo "On:".$res3->user_reserve_date."<hr>"; } ?><br><hr><a href="#">Reserve Now</a>'; Quote Link to comment https://forums.phpfreaks.com/topic/68575-help-on-php-saving-value-in-session-and-retrieving-in-popup-window/#findComment-344711 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.