Forum Moderators: coopster
<?php include('file.inc');?>
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='my'>some text</td>
<td align='right' class='my'>"; print $variable; echo"</td>
</tr>
</table>\n";
It shows no error and now working either. (error reporting is on)
If i remove the HTML tags and put it in a clean empty file, it works, so there must be something wrong :(
Thanks in advance.
echo $variable;
echo "<table cellpadding='0' cellspacing='0' width='100'>\n<tr>
<td class='my'>some text</td>
<td align='right' class='my'>"; print $variable; echo"</td>
</tr>
</table>\n";
[edited by: Borgscan at 3:55 am (utc) on June 18, 2007]
Anyway, it doesn't make any sense. Just out of curiosity, can you try the code that doesn't work again and this time view the source of the page that it creates. If it is in there, then your formatting is incorrect. Other than that, I cannot explain what is going on with that.
That's odd that that is the 'problem'; even odder that you thought to remove it ;)
I just experimented with it, eliminating small bits are a time. :) I don't know what I changed, but its working now. :P
Source:
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='my'>some text</td>
<td align='right' class='my'>Hello world!</td>
</tr>
</table> Script:
<?php$variable = "Hello world!";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='my'>some text</td>
<td align='right' class='my'>"; print $variable; echo"</td>
</tr>
</table>\n";
?>
Asson, if it still doesn't work for you, can you show us the code from file.inc, please.
[edited by: Borgscan at 5:08 am (utc) on June 18, 2007]
<?
//first we define the week names in an array$weekDays = Array("یه‌ك‌شه‌ممه", "دووشه‌ممه", "سێ‌شه‌ممه", "چوارشه‌ممه", "پێنج‌شه‌ممه", "هه‌ینی", "شه‌ممه");
// kurdish month names in an array
$kurdmonth = Array("ڕێبـــه‌ندان", "ڕه‌شــه‌مه", "خاكه‌لێوه", "بانـه‌مـــه‌ڕ", "جۆزه‌ردان555", "پووشپه‌ڕ", "گه‌لاوێژ", "خه‌رمانان", "ڕه‌زبه‌ر", "گه‌ڵاڕێزان", "سه‌رماوه‌ز", "به‌فرانبار", "به‌فرانبار" );
//defining date variables and $s the leapyear
$today = date("d, m, Y");
$timenow = date("d, m, Y");
$currmonth = date("n");
$curryear = date("Y");
$currday = date("d");
$s = date("L");
$totaldays = date("z")+1;
$dayintheweek = date("w");
//counting weather the previouse year was a leapyear
$leapyearplus=$curryear+$s;
if ($curryear == $leapyearplus)
{
$z=1;
}
else
{
$z=0;
}
// printing month names and days
if ($totaldays >= 21 && $totaldays <= 50 )
{
$kurdmonth= $kurdmonth[0];
if ($currday > 20-z-s)
{$kurdday = $currday - 20+$z+$s;}
else
{$kurdday = $currday + 11+$z+$s;}
}
if ($totaldays >= 51 && $totaldays <= 79 )
{
$kurdmonth= $kurdmonth[1];
if ($currday > 20-z-s)
{$kurdday = $currday - 19+$z;}
else
{$kurdday = $currday + 9+$z+$s;}
}
if ($totaldays >= 80 && $totaldays <= 110 )
{
$kurdmonth= $kurdmonth[2];
if ($currday >= 21-$s)
{$kurdday = $currday - 20+$s;}
else
{$kurdday = $currday + 11+$s;}
}
else if ($totaldays >= 111 && $totaldays <= 141)
{
$kurdmonth= $kurdmonth[3];
if ($currday > 21-$s)
{$kurdday = $currday - 20+$s;}
else
{$kurdday = $currday + 10+$s;}
}
else if ($totaldays >= 142 && $totaldays <= 172)
{
$kurdmonth= $kurdmonth[4];
if ($currday >= 22-$s)
{$kurdday = $currday - 21+$s;}
else
{$kurdday = $currday + 10+$s;}
}
else if ($totaldays >= 173 && $totaldays <= 203)
{
$kurdmonth= $kurdmonth[5];
if ($currday >= 23-$s)
{$kurdday = $currday - 21+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 204 && $totaldays <= 234)
{
$kurdmonth= $kurdmonth[6];
if ($currday >= 23-$s)
{$kurdday = $currday - 22+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 235 && $totaldays <= 265)
{
$kurdmonth= $kurdmonth[7];
if ($currday >= 23-$s)
{$kurdday = $currday - 22+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 266 && $totaldays <= 295)
{
$kurdmonth= $kurdmonth[8];
if ($currday >= 23-$s)
{$kurdday = $currday - 22+$s;}
else
{$kurdday = $currday + 8+$s;}
}
else if ($totaldays >= 296 && $totaldays <= 325)
{
$kurdmonth= $kurdmonth[9];
if ($currday >= 23-$s)
{$kurdday = $currday - 22+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 326 && $totaldays <= 355)
{
$kurdmonth= $kurdmonth[10];
if ($currday >= 22-$s)
{$kurdday = $currday - 21+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 356)
{
$kurdmonth= $kurdmonth[11];
if ($currday >= 22-$s)
{$kurdday = $currday - 21+$s;}
else
{$kurdday = $currday + 9+$s;}
}
else if ($totaldays >= 1 && $totaldays <= 20)
{
$kurdmonth= $kurdmonth[12];
if ($currday >= 22-$s-$z)
{$kurdday = $currday - 21+$s+$z;}
else
{$kurdday = $currday + 10+$z;}
}
// a statement for Newroz
if ($currday == 21 && $currmonth == 3)
{
$h = " <a href='http://www.kur
ditgroup.org'>
نه‌ورۆزتان پیرۆز </a> ";}
else
{$h = "";}
// year calculation
if ($currmonth <= 1)
{
$kurdyear = $curryear + 699;
}
if ($currmonth == 2 && $currday <= 20-$s )
{
$kurdyear = $curryear + 699;
}
if ($currmonth == 2 && $currday >= 21-$s )
{
$kurdyear = $curryear + 700;
}
if ($currmonth >= 3 )
{
$kurdyear = $curryear + 700;
}
// day of the week names
$wd = $weekDays[$dayintheweek ];
// dump all variables in one string
$kurddate= "$wd $kurdday $kurdmonth $kurdyear $h";
?>
Thanks