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
https://forums.phpfreaks.com/topic/68319-solved-a-simple-question-in-php/
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>';
?>

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

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

 

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

 

?>

;) ;) ;)

Archived

This topic is now archived and is closed to further replies.

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