watthehell Posted September 7, 2007 Share Posted September 7, 2007 hi, Can we write <?php $_SESSION['myday'];?> tag inside PHP echo <?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">[b]<?php echo "I WANT TO WRITE HERE?>[/b]</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>'; ?> thanks again... Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/ Share on other sites More sharing options...
sasa Posted September 7, 2007 Share Posted September 7, 2007 try <?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['myday'],'</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>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343527 Share on other sites More sharing options...
recklessgeneral Posted September 7, 2007 Share Posted September 7, 2007 Yes, you can do that, just make sure the session has been started. <?php session_start(); ?> Then, to output the session data: <?php echo $_SESSION['myday'];?> Cheers, Darren. Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343528 Share on other sites More sharing options...
watthehell Posted September 7, 2007 Author Share Posted September 7, 2007 hi again, what i mean is i just want to store that value of $i in $_SESSION['myday'] and dont want to display it. This code displays the value of $i also actually what i want is echo '<table><tr><td>.'$i.'</td> <td> <?php $SESSION['myday'] = $i ?> </td> </tr> </table>' i just need to know how to write that <?php ?> inside <td> writing like .'<?php ?>.' didnt work inside td thnks Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343532 Share on other sites More sharing options...
noidtluom Posted September 7, 2007 Share Posted September 7, 2007 writing like .'<?php ?>.' didnt work inside td You mean concatenation? Why don't you just do echo '<table><tr><td>.'$i.'</td> <td> '; $SESSION['myday'] = $i echo ' </td> </tr> </table>'; Sorry if I misunderstand your question. Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343557 Share on other sites More sharing options...
watthehell Posted September 7, 2007 Author Share Posted September 7, 2007 yes it is concatenation, but not working properly what i have is a loop value for $i The value of $i is from 1 to 30 and it has a hyperlink for every numbers from 1 to 30 and what I need is when clicking on any number the value of $i has to pass to a pop up... The value of $i is inside echo '<table>.......$i is here inside td and what i I did is that in another TD i kept <?php store the value of $i in a Session;?> inside this echo </table>'; but it is not working it shows parse error, i think there is problem in concatenation anybody can help on this please... Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343566 Share on other sites More sharing options...
noidtluom Posted September 7, 2007 Share Posted September 7, 2007 Well, even though I still am confused with your question, I think for a start that you can do something like <?php <?php ?> ?>...basically, don't put another <?php inside a <?php. Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343577 Share on other sites More sharing options...
watthehell Posted September 7, 2007 Author Share Posted September 7, 2007 Well, even though I still am confused with your question, I think for a start that you can do something like <?php <?php ?> ?>...basically, don't put another <?php inside a <?php. Ok, finally I got it... thanks any way ... This was the problem <?php <?php.....?> ?> ;) Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343579 Share on other sites More sharing options...
noidtluom Posted September 7, 2007 Share Posted September 7, 2007 Wow I actually answered somebody else's question online. That's a first for PHP. Well, considering this is my first PHP forum. Quote Link to comment https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/#findComment-343592 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.