...

View Full Version : add html code into php code.



ggp
02-23-2007, 10:42 AM
Hi.
I have this set of php code and I need to add the next set of html code in the php code.
What ever I try, it giveme errors.
Could you help me with this plzzzz?

Thanks.





<?php

if (!isset($_POST['submit']) or trim($_POST['searchstring']) === '' )
{
if(trim($_POST['searchstring'] === ''))
{
include ('error.php');
}
?>
<form
</form>
<?php
}
else
{

HERE I NEED TO ADD THE HTML CODE

}
?>








<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=#ffcc00 border=1>
<TBODY>
<TR vAlign=top>
<TD width="20%">
<TABLE width="100%"border=1>
<TBODY>
<TR>
<TD class=w align=middle width="20%" >Categories </TD></TR>
<TR>
<TD class=c width"20> </TD></TR></TBODY></TABLE></TD>
<TD width=9 bgColor=#ffffff><IMG height=1 alt="" src="t.gif" width=19></TD>
<TD width="60%">
<TABLE cellSpacing=2 cellPadding=1 width="100%" border=1>
<TBODY>
<TR>
<TD class=w align=middle bgColor=#ffcc00>Shop.com Top 5</TD>
</TR></TBODY></TABLE>



<TD width="20%"> <TABLE border=1 width="100%"> <TBODY><TR><TD class=w align=middle width="20%">ADVERTISE</TD><TR><TD>GFGF</TD></TR></TR></TBODY></TABLE></TD>
</TR></TBODY></TABLE><BR>
<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=#ffcc00 border=0>
<TBODY>
<TR>
<TD class=c align=middle width="100%" bgColor=#fff3ac colSpan=3>


</TD></TR></TBODY></TABLE></BODY></HTML>

BonRouge
02-23-2007, 11:09 AM
else {
echo '
the text goes here
';
}

ggp
02-23-2007, 11:27 AM
I got this error:
Parse error: parse error, expecting `','' or `';'' in C:\Program Files\Online Services\Apache2\htdocs\textimage201.php on line 91

line 91:
echo '
<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=#ffcc00 border=1>
<TBODY>
<TR vAlign=top> LINE 91
<TD width="20%">







<?php

}

else
{

echo '
<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=#ffcc00 border=1>
<TBODY>
<TR vAlign=top>
<TD width="20%">
<TABLE width="100%"border=1>
<TBODY>
<TR>
<TD class=w align=middle width="20%" >Categories </TD></TR>
<TR>
</TR></TBODY></TABLE></TD>
<TD width=9 bgColor=#ffffff><IMG height=1 alt="" src="t.gif" width=19></TD>
<TD width="60%">
<TABLE cellSpacing=2 cellPadding=1 width="100%" border=1>
<TBODY>
<TR>
<TD class=w align=middle bgColor=#ffcc00>TutyShop.com Top 5</TD>
</TR></TBODY></TABLE>



<TD width="20%"> <TABLE border=1 width="100%"> <TBODY><TR><TD class=w align=middle width="20%">ADVERTISE</TD><TR><TD>GFGF</TD></TR></TR></TBODY></TABLE></TD>
</TR></TBODY></TABLE><BR>
<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=#ffcc00 border=0>
<TBODY>
<TR>
<TD class=c align=middle width="100%" bgColor=#fff3ac colSpan=3> </TD></TR></TBODY></TABLE>
';



}
?>

BonRouge
02-23-2007, 11:32 AM
Strange... I don't see a problem. :confused:

mlseim
02-23-2007, 02:29 PM
You would think you could do this, with quotes like this ...

echo'
<img src="myphoto.jpg">
';

But, I would still switch all of them around like this ...

echo"
<img src='myphoto.jpg'>
";

rafiki
02-23-2007, 02:38 PM
<?php
}
else
{
?>
add your html her as normal?
<?php
}
?>

aedrin
02-23-2007, 05:41 PM
Rafiki's suggestion seems the best out of all.


You would think you could do this, with quotes like this ...

echo'
<img src="myphoto.jpg">
';

But, I would still switch all of them around like this ...

echo"
<img src='myphoto.jpg'>
";

Actually, I recommend that you do it like this:



echo '<tag value="something" />';


As there are certain things that are easier (for instance javascript in onclick, etc.) when you have a single quoted string.

Not to mention it is faster.

ggp
02-24-2007, 01:49 AM
Thanks guys it got fix. You really help me. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum