PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
php in cell Posted by andreabrauchi on 25 Nov 2002 at 8:00 AM
i am wandering why this script doesn't work. i tested the php script on a different page were it wasn't inserted into a table cell.

the $joketext comes from a different page using a hyperlink that takes this value.

is there something special when i want to use it in a table?

thank you in advance:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<P align="center">
<img border="0" src="http://www.sales.zartzart.com/mall/shop_left.gif" width="152" height="203"><img border="0" src="http://www.sales.zartzart.com/mall/left_store.gif" width="665" height="203"></P>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="818" id="AutoNumber1">
<tr>
<td width="150">
<p align="center">&nbsp;</td>
<td width="500">&nbsp;

<?php
echo($joketext);
?>
</td>
<td width="197">&nbsp;</td>
</tr>
</table>
<p>
</body>
</html>
Report
Re: php in cell Posted by Mark Strijbos on 26 Nov 2002 at 12:34 AM
: i am wandering why this script doesn't work.
did you save it as a .HTML or a .PHP file?

and you could try this:

<?php
if( isset( $joketext ) )
echo $joketext;
else
echo "No joketext";
?>

this should always render _something_ so if it doesn't you know the
PHP code doesn't run.



Report
Re: php in cell Posted by andreabrauchi on 26 Nov 2002 at 9:27 AM
The file is saved as .php so this should be fine. i inserted the text you gave to me but there is still nothing in the cell. Maybe there is a problem to insert something into a table cell? when i have the code without the table it is working? maybe i need to rewrite a table cell in php??? this is my first project and i am very lost. i was so excited when i could do this on a plain page and i thought that php can't be that complicated. but i guess it can... thank you for your help.

andrea

: : i am wandering why this script doesn't work.
: did you save it as a .HTML or a .PHP file?
:
: and you could try this:
:
: <?php
: if( isset( $joketext ) )
: echo $joketext;
: else
: echo "No joketext";
: ?>
:
: this should always render _something_ so if it doesn't you know the
: PHP code doesn't run.
:
:
:
:

Report
Re: php in cell Posted by Mark Strijbos on 27 Nov 2002 at 12:38 AM
: Maybe there is a problem to insert something into a table cell?

yes, there can be - depending on your browser, the "rendering" of active elements inside a table cell can be very problematic.
a solution would be to also use php to 'draw' the table; like

echo '<TABLE BORDER=1>';

etc etc





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.