Jump to content

[SOLVED] A simple Question in PHP


watthehell

Recommended Posts

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...

Link to comment
Share on other sites

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>';
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.