You are here: Very Weird Behavior « PHP Programming Language « IT news, forums, messages
Very Weird Behavior

Posted by Alan Little on 11/06/05 16:38

I started with the following code in an included file:

$CompanyBlock =
"$Company (Booth#: $Booth)\n".
"$Address\n".
"$City, $State $PostalCode\n".
"$Website\n".
"$Contact1, $Title1\n".
"Tel: $Phone\n".
"Fax: $Fax\n".
"Email: $Email1\n".
"Products/Services: $ProductService\n".
"Objectives: ";

I wanted to make some of the items conditional, but in so doing, I forgot
to change some of the . to ; and ended up with:

$CompanyBlock = $Company;
if ($Booth) $CompanyBlock.= " (Booth#: $Booth)";

$CompanyBlock.=
"\n".
"$Address\n".
"$City, $State $PostalCode\n";

if ($Website) $CompanyBlock.= "$Website\n";
if ($Contact1) $CompanyBlock.= "$Contact1";
if ($Title1) $CompanyBlock.= ", $Title1"; $CompanyBlock.= "\n";
if ($Phone) $CompanyBlock.= "Tel: $Phone\n".
if ($Fax) $CompanyBlock.= "Fax: $Fax\n".
if ($Email1) $CompanyBlock.= "Email: $Email1\n".
if ($ProductService)
$CompanyBlock.= "Products/Services: $ProductService\n".

$CompanyBlock.= "Objectives: ";

The result? The file returns with no execution, not even of code before
the problem, and with no error message, not so much as a notice. It took
me a good while to narrow it down and spot the problem (there's quite a
bit of code before this in the file). I knew the file was being called,
but even an echo statement at the very beginning produced no output. The
execution of the main script was not affected.

I thought this might save someone else a bit of time if they happen to
have the same problem.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация