php-general Digest 11 Jan 2010 04:40:24 -0000 Issue 6532

Topics (messages 300941 through 300959):

Re: To add the final ?> or not...
        300941 by: Michael A. Peters
        300942 by: Michael A. Peters
        300943 by: Stuart Dallas
        300944 by: Michael A. Peters
        300945 by: Jim Lucas
        300946 by: Ashley Sheridan

Re: Clean PHP 5.2.12 Build Core Dumping
        300947 by: Don O'Neil

PMCÉú²ú¼Æ»®ÓëÎïÁÏ¿ØÖÆ
        300948 by: rjotqr

Upgraded PHP now website doesn't work properly?
        300949 by: Kaya Saman
        300950 by: Ashley Sheridan
        300951 by: Ashley Sheridan
        300952 by: Kenneth Sande
        300953 by: Kaya Saman
        300954 by: Ashley Sheridan
        300955 by: Kaya Saman
        300956 by: Ashley Sheridan
        300957 by: Kaya Saman

Formatting Decimals
        300958 by: Rick Dwyer
        300959 by: Mattias Thorslund

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Daevid Vincent wrote:


What do you guys all do?

I keep it there, and just make sure not to have white space where it should not be.
--- End Message ---
--- Begin Message ---
Stuart Dallas wrote:


That's a massive assumption. There are a number of editors that
automatically add a blank line to the end of source files. I stand by
taking the option that requires the least conscious thought from your
developers - they have enough important stuff to occupy their brain
that remembering to make sure there is no whitespace at the end of
their source files should not be one of them.

-Stuart


I would suggest getting a text editor that doesn't do that then. There are text editors that don't.

There also are e-mail clients that properly wrap the body content before sending ;)
--- End Message ---
--- Begin Message ---
On 10 Jan 2010, at 14:44, Michael A. Peters wrote:

> Stuart Dallas wrote:
> 
>> That's a massive assumption. There are a number of editors that
>> automatically add a blank line to the end of source files. I stand by
>> taking the option that requires the least conscious thought from your
>> developers - they have enough important stuff to occupy their brain
>> that remembering to make sure there is no whitespace at the end of
>> their source files should not be one of them.
>> -Stuart
> 
> I would suggest getting a text editor that doesn't do that then. There are 
> text editors that don't.
> 
> There also are e-mail clients that properly wrap the body content before 
> sending ;)

I would rather not have a requirement on the tools my developers use which 
potentially (and usually) improves their productivity than impose a requirement 
that has no apparent benefit outside of XML files, and even then the benefit is 
irrelevant since it's already a file that contains both code and XML.

And if you don't like the way my emails look feel free to forward them into a 
black hole, I'll be fine with that. Alternatively talk to Apple and get them to 
change their Mail app to your idea or "properly". Either way I'm going to get 
back to worrying about things that matter. ;)

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
Stuart Dallas wrote:
On 10 Jan 2010, at 14:44, Michael A. Peters wrote:

Stuart Dallas wrote:

That's a massive assumption. There are a number of editors that
automatically add a blank line to the end of source files. I stand by
taking the option that requires the least conscious thought from your
developers - they have enough important stuff to occupy their brain
that remembering to make sure there is no whitespace at the end of
their source files should not be one of them.
-Stuart
I would suggest getting a text editor that doesn't do that then. There are text 
editors that don't.

There also are e-mail clients that properly wrap the body content before 
sending ;)

I would rather not have a requirement on the tools my developers use which 
potentially (and usually) improves their productivity than impose a requirement 
that has no apparent benefit outside of XML files, and even then the benefit is 
irrelevant since it's already a file that contains both code and XML.

And if you don't like the way my emails look feel free to forward them into a black hole, 
I'll be fine with that. Alternatively talk to Apple and get them to change their Mail app 
to your idea or "properly". Either way I'm going to get back to worrying about 
things that matter. ;)

-Stuart


I suspect that you just don't word wrap enabled in your Mail.app preferences. That use to be an option anyway (I haven't used OS X since 10.1)

Anyway, I didn't fix the wrap on this before replying just to show what happens. Each paragraph end up as a big long line instead of having a break put in.

Ah well, doesn't bother me as much as HTML mail to lists does ;)

--- End Message ---
--- Begin Message ---
Stuart Dallas wrote:
> 
> That's a massive assumption. There are a number of editors that automatically 
> add a blank line to the end of source files. 

A single \n after the final ?>  doesn't matter anyways.  Even if the following
example was two different files where the second included the first, it would
still have the same results.

Simple test:

########CONTENTS########
<?php

?>
<?php

echo (headers_sent() ? 'Yes' : 'No');

?>
########EOF########

No, as is, this will return 'No'.  But if you place /ANY/ character between the
?>
<?php

including a newline, space, tab, etc...  it will send the headers.

So, basically saying that in this particular case ?><?php === ?>\n<?php

With all that said, you CAN have a \n at the end of you file directly after the
?>.  But, you better make sure that nothing else is there along with it.

Jim Lucas

> 
> -Stuart
> 


--- End Message ---
--- Begin Message ---
On Sun, 2010-01-10 at 08:52 -0800, Jim Lucas wrote:

> Stuart Dallas wrote:
> > 
> > That's a massive assumption. There are a number of editors that 
> > automatically add a blank line to the end of source files. 
> 
> A single \n after the final ?>  doesn't matter anyways.  Even if the following
> example was two different files where the second included the first, it would
> still have the same results.
> 
> Simple test:
> 
> ########CONTENTS########
> <?php
> 
> ?>
> <?php
> 
> echo (headers_sent() ? 'Yes' : 'No');
> 
> ?>
> ########EOF########
> 
> No, as is, this will return 'No'.  But if you place /ANY/ character between 
> the
> ?>
> <?php
> 
> including a newline, space, tab, etc...  it will send the headers.
> 
> So, basically saying that in this particular case ?><?php === ?>\n<?php
> 
> With all that said, you CAN have a \n at the end of you file directly after 
> the
> ?>.  But, you better make sure that nothing else is there along with it.
> 
> Jim Lucas
> 
> > 
> > -Stuart
> > 
> 


Or if you're using a multibyte encoding in your file which isn't
correctly interpretted...

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
> > I tried adding WITHOUT_X11=yes to /etc/make.conf as well as X11BASE=
> and
> > X11BASE="", but I still get the same error.
> 
> Remove them. This makes sure they are not defined, not even
> empty (as in "#define BLA -> symbol 'BLA' is defined").
> 
> > Where to go from here? Do I have and old version of something that is
> > causing this? I get this error _right away_ before anything is even
> built.
> 
> It seems to be a check by the Makefile at port's top level.

Ok... I have no definition for X11BASE anywhere, not in my env, not in my
/etc/make.conf, nowhwere...

However, it's still complaining about X11BASE being deprecated. I tried just
adding WITHOUT_X11=yes in /etc/make, and without it. I even searched all the
Makefiles in /usr/ports, and in the /usr/ports/lang/php5 dir to find any
reference to X11, or X, or X11BASE, but nada... I don't even know where this
error message is being generated from.

I can't even do a basic make without it immediately spitting out the error:

# make
X11BASE is now deprecated.  Unset X11BASE in make.conf and try again.
*** Error code 1

Stop.

Where should I look next? Any help is appreciated. Thanks!


--- End Message ---
--- Begin Message ---
php-gene...@lists.php.net


          P M C 生 产 计 划 与 物 料 控 制 高 级 研 修 班

                时间:2010年01月14 -15日(上海)
                时间:2010年01月16 -17日(深圳)
--------------------------------------------------------------   
●对 象:生产总监、生产经理、生产计划相关人员、车间主任、物料主管
、采购主管及相关人员。

●课-程-简-介:
  各企业都期望低库存而能满足客户需求的流畅生产环境,以适应当今激
烈竞争微利时代。物料资金一般占企业营运资金55%~80%,而生产进度依时
完成,直接影响客户合作满意程度,鉴此,物料控制(俗称物控MC)和生产
控制(俗称生管PC),这个部门(PMC)掌握企业生产及物料运作的总调度和命
脉。直接涉及影响生产部、生产工程部、采购、货仓、品控部、开发与设
计部、设备工程、人力资源及财务成本预算控制等。生产及物料控制部门
和相关管理层必须充分了解:物料计划、请购、物料调度、物料的控制(收、
发、退、借、备料等)、生产计划与生产进度控制,并谙熟运用这门管理技
�X来解决问题。鼎志咨询的本课程是经过讲师十余年亲身体会揣摩凭感觉
和理论汇炼之精华。透过学员研讨和习作技能,帮助学员提升工作技能和
管理技巧。 
--------------------------------------------------------------  
●课-程-收-益:
◇建立制定完善的生产与物控运作体系
◇提升准时交货和降低库存成本 
◇预测及制定合理的短、中、长期销售计划
◇达成公司策略管理目标 
◇对自身的生产能力负荷预先进行详细分析并建立完善产品数据机制
◇协助公司建立产品工程数据
◇生产前期做好完整的生产排程和周生产计划
◇提高备料准确率,保持生产顺畅
◇配合生产计划做到良好物料损耗控制和备料
◇完善降低物料损耗机制和停工待料工时
◇对生产进度及物料进度及时跟进和沟通协调 
◇缩短生产周期,提高企业竞争力
--------------------------------------------------------------
●课-程-大-纲
一、销售计划/生产计划/物料计划协调接口管理
1)销售计划/生产计划角色和定位---订单总导演/总指挥
2)销售计划/生产计划/物料计划先进组织架构
◇东莞诺基亚公司销售计划/生产计划/物料计划组织架构
3)生产计划/物料控制五大职能----欠料分析跟进/备料功能/呆料预防
--处理
4)生产计划与销售业务链接流程
◇准时生产计划VS市场业务部VS客户“三赢”规则
◇中兴通讯销售计划/生产计划/物料计划接口职能图/资源图实例分析
◇美的滚动周计划负荷分析和三天生产计划不能变职能图
◇控制扦单、急单、补单/加单五种措施(范例)-----某公司
◇通过市场调查/信息反馈提高订单预测准确率三大做法
5)销售预测与主生产计划(MPS)与月/周生产计划/物料计划(MRP)链
接流程
◇销售预测/生产计划变化反馈和预测库存控制协调---销售预测微调制
度化降低预测库存成本原理分析
◇销售计划流程�D�D销售预测流程/销售计划流程/备货计划流程/生
产计划流程
6)制造业生产计划控制三种模式�D�D预期滚动计划系统/推进式(push)
生产控制系统/拉动式(pull)生产控制系统
◇世界五百强企业施耐德电气Schneider推进式生产控制系统
7)同一产品不同物流策略决定不同五大计划(销售/生产/物料/采购计/
库存计划)
◇华为计划管理手册分析

二、销售计划/生产计划控制流程(包括项目计划)
1)销售预测计划/生产计划控制流程七途径---讲师/学员点评某公司现
场诊断
◇提升编制销售预测计划编制准确性六大步骤
◇华润集团华晶销售预测计划编制六大步骤实例分析
◇青岛海尔新产品项目计划总体方案控制流程实例分析
◇西门子月/周/项目计划时间节点协调流程分析
◇富士康SAP系统主生产计划流程案例
◇大金空调计划控制流程ERP-ORACLE系统主界面实例分析
◇青岛海尔月/周/日项目计划协调流程实例分析
◇富士康集团(台湾)公司月度滚动产能负荷分析
◇三天生产计划不能变的滚动产能负荷分析实例分析
2)透过准时化生产机制解决订单频繁变更三种方法
◇顺德美的日用集团扦单、急单、补单/加单/生产计划紧急控制流程实
例分析
◇飞利浦扦单/急单计划紧急控制流程案例分析- Production plan cha
nge management
◇飞利浦生产查询界面、生产删改信息查询界面、产品工艺流程查询界
面、产品作业报表查询界面实例解析
3)生产计划控制管理(精益)模式---均衡化/柔性化拉动计划
◇准时化/均衡化生产方式(JIT)运用方法四大独特之处
◇准时化生产方式---柔性化与同步化与均衡化
◇某法国著名企业(拉动)一周生产计划不能变控制流程实例分析(现
场超市双箱广告牌拉动)
◇某公司拉动式生产计划控制流程实物图片系列分析
◇准时化生产方式双广告牌管理的基本原理解析
◇杭州博世(BOSCH)均衡化(拉动)一周生产计划板不能变(生产广
告牌)实例图片及说明分析
◇苏州某汽车配件公司三天均衡化生产计划板(生产广告牌)图片及说
明分析
◇在线半成品KANBAN计算 
◇负荷瓶颈库存量设定方法
◇飞利浦负荷瓶颈库存量设定实例―离散型生产模式

三、生产计划进度控制
1)缩短产品周期流程
◇西门子产品周期缩短流程价值流案例分享
◇某公司缩短产品周期电脑系统(用友)流程主界面实例分析
2)月/周生产计划产能连续滚动负荷分析制度化
◇中国某著名公司月度主排产计划制定十三依据
◇中国某著名公司三天生产计划依据制定九依据
3)月/周生产计划排程表制定与执行重点演练---上海某公司五张订单
月/周生产计划排程表制定个案演练
4)分析产能负荷七要素方面---人力负荷/机器负荷
◇广州某配件公司2007/04月产能负荷会实录文件分析
5)生产进度监控三个阶段---事前/事中/事后
◇如何统计分析生产数据
◇通过生产数据采集计算机系统图监控计划与进度---东莞某集团公司
6)协调沟通处理生产异常问题
◇八条改善措施(NCR goods management)
◇跨部门生产进度控制七步骤
7)飞利浦各部门异常工时/各部门产能损失图案例分析
◇生产能力效率表/综合效率分析
◇事后管理

四、物流计划跟进与存量管制
1、供货商交期管制十大之道-- lead time reduction 
◇伟创力(Flextronics)在物料欠料分析表实例分析
◇物料短缺八大原因和七种预防对策
2、物料管理相辅相成十四流程-- warehouse management
◇物料管理精髓三个盲点和八大死穴---伟创力美资公司呆料预防/处
理制度实例/工程更改流程分析
◇美的/一汽马自达公司/精工集团(日资)补料/损耗控制案例分析--
降低内循环成本
3.最新先进物流管理(精益)流程模式
◇物料管理---JIT三A政策六措施
◇深圳某著名台资企业(雷老师辅导)JIT供货推行十二步骤计划表实
例解析
1)内部物流配送管理流程解析--Internal logistic management 
◇格力空调JIT物料操作指导书解析--warehouse management
◇博世(BOSCH)现场利用电子标签发料实例分析
◇在线补充物料(RIP)KANBAN计算 
◇物料补充时间间隔计算
◇在线物料标识及KANBAN卡设计 
◇博世配送系统物料广告牌实物/图片实例分析
◇华晨宝马现场超市广告牌请购图片实例分析 
◇ABB/AREVA现场超市双箱广告牌请购图片实例分析
2)外部供应物流配送管理流程解析
◇通用汽车JIT供应商物流评审标准解析(SQE)
◇供应商管理库存(VMI)-某著名企业VMI协议实录分析
◇华强三洋供应商驻厂代表配送/退料/换料广告牌实物图片实例分析/
集货配送(Milk-Run)管理方法
◇供应商JIT直送工位管理方法/
◇使用条形码及与供货商进行电子数据交换(EDI)实例展示 
4、存量管制--inventory management
◇需求预测、物料计划与库存控制原理/四大策略
◇青岛海尔公司需求预测变化和库存相应调整控制流程实例
◇长虹采购订单模式实例分析----大陆标准/通用物料采购/海外lean 
time长物料采购
◇安全存量VS最高存量VS.最低存量定义
◇安全存量三种设定方法
◇ABC控制法--warehouse management
◇长周期采购批量、库存控制与销售预测的量变关系 
◇库存量降低五大方法
◇库存周转率定量计算
◇提高库存周转率的途径
◇深圳某实业有限公司物料周转速度/周转率/存料率实例
◇透过现场诊断和运用六种存量管制模式设置恰当库存管理方法(MTO 
/ROP/MOQ)降低外循环成本实例分析

◇尾声:当头棒喝―捅破窗纸:结合公司实际情况通过学员体会分享、
讲师点评、实践、活用所学五步
--------------------------------------------------------------
●讲师介绍:
   雷老师:香港理工大学MBA,香港生产力促进局特约讲师、美国管理学
会(AMA)授权专业培训师、清华大学/北京大学/中山大学EMBA班特邀实战
型讲师..北京时代光华签约...@师.2004/2005/2006年被培训论坛推誉为“
十大实战派培训师”、专业课程讲授专家、资深顾问.��任某大型日港合
资企业副总经理,拥有十几年的物料采购管理经验. 企业高层管理及课程
讲授经验非常丰富,讲授/辅导过4524家中外企业(至2006底)、融集中、
港、台多家企业经验之精华.并由北京大学出版《如何做好物料计划控制》
系列丛书和北京时代光华出版管理光盘,特别是2004/2005/2006年间定期
辅导顺德美的日用集团/富士康集团供应链管理项目(精益/JIT-生产/物料
计划/采购).“寓观念于谈笑间,蕴哲理于诙谐中”,风格生动、幽默,讲解
深入浅出或浅入深出,不仅案例丰富,且提供多种实用的解决问题之工具及
技巧.至今有四万九仟以上人次接受专业课程训练,其务实的作风深受厂
家好评如潮.
   曾经讲授及辅导过的企业有:青岛海尔,中国移动。中国北京联通。广
东移动。深圳华为。顺德/武汉美的空调.联想、南方电网。甘肃电力。长
江三峡电站。白沙集团。粤电集团、海南航空、上海日立.可口可乐.施耐
德����.上海松下半��体.西安杨森制药、苏州/上海西门子.����力(MULTE
K)/ 捷普科技(Jabil).蒙牛。河南思念食品。龙大食品集团.南京巴斯
夫。杭州/长沙博世。香港�L��集�F.东莞伟易达集团、加拿大北电.泰科
��子/卡西欧电子、上海米其林/固特异.雅居乐房地产.美赞臣。珠江啤酒、
步步高电子、格力空调.上海通用汽��.成都丰田。华晨宝马。海南马自达.
比亚迪汽��.长安汽��.郑州日产.北京ABB等多家知名企业,曾驻厂辅导(
部分名单)东莞诺基亚、北京索爱。惠州TCL、南京/成都爱立信、蒂森克
虏伯。华强三洋、三菱电机(广州)。四川长虹。苏泊尔 ,夏新电子.厦
华集�F.惠州德赛、飞利浦(上海)/苏州飞利浦、中兴通讯。武汉烽火科
技.中国长城计算机(深圳).东莞汤姆逊(电器). 顺德美的日用集团.阿波罗
卫浴。顺德乐华陶瓷(arrow). 迈瑞生物医疗。东莞伟易达。美泰玩具.恒
安纸业(心相印).森马。真维斯(旭日集团)香港启桓贸易行。溢达纺织
.晶苑制衣集团.东莞台�_��子. 富士康集�F.康佳集团等
---------------------------------------------------------------
●主办单位:中--培--信--息--网

●课程费用:2600元/人(包括教材、两天午餐、上下午茶点等)

●报名咨询:T E L: (0755) 6128 0152(深 圳)

●报名咨询:T E L: (0 2 1) 5108 3290(上 海)
----------------------------------------------------------------
                      [报  名  回  执  表] 

        F A X:(07 55) 61 28 01 53 或 (0 2 1) 51 08 32 96

我单位共___人报名参加2010年___月_____日在□上海、□深圳举办的:

【PMC生产计划与物料控制高级研修班】;

单位名称:_________________________________ 参会人数:_________人 

联系人:______________ 电 话:__________ 传 真:_________________

参会费用 ¥:__________元               邮 件:_________________

参 会 人:_____________________________________________________

付款方式: □1、现金 □2、转帐 □3、电汇

预订项目:□是、□否 住宿(请选择打“√”)

备注:请您把报名回执回传我司,��确保您报名无误,请您再次电话确认!

--- End Message ---
--- Begin Message ---
Hi,

I am hoping someone can help me??

I currently run Fedora 11 on an Apple PowerMac G4 and recently performed an upgrade to it which rendered my site completely unsee able for a while but then after re-saving it showed up through my browsers however my menu bar was slightly altered probably due to lack of formatting.

Apache error logs claim this:

[Sun Jan 10 23:06:23 2010] [error] [client 192.168.1.110] PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/optiplex-networks/links.php on line 20, referer: http://co111w.col111.mail.live.com/mail/InboxLight.aspx?n=454360575

I have attempted to enable PHP debugging but nothing is being shown!

To give an idea of where things are going wrong this is the start of the file:

<?php # Script 3.4 - index.php

// Set the page title and include the HTML header.
$page_title = 'Optiplex Networks';
include ('./header.inc');
?>

<?php

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

echo '


<table width="100%" align="center" border="0" bgcolor="#CCCCCC">
<tr><td align="center"><font size="4"><strong>Contributors to Optiplex Networks:</strong></font></td></tr>
</table>

<p>If it weren't for these projects Optiplex Networks would not have happened. My thanks and regards to everyone involved!</p>


<table width="95%" border="1" align="center">
 <tr>

<td width="15%"><div align="center" class="style2"><strong>Name</strong></div></td> <td width="20%"><div align="center" class="style2"><strong>Address</strong></div></td> <td width="*"><div align="center" class="style2"><strong>Description</strong></div></td>
 </tr>


Line 20 is the line beginning with <p>If it weren't for.......

I don't understand why this should be an error as it's basic html!

The only php part I have used is just echoing the html out.

As shown the echo ' is closed off at the bottom of the file with:

';

?>

which is fine according the book I read about php.

Obviously something is wrong but I can't figure it out, if anyone can give me a hand I'd very much appreciate it!

Many thanks,

Kaya

--- End Message ---
--- Begin Message ---
On Mon, 2010-01-11 at 02:52 +0200, Kaya Saman wrote:

> Hi,
> 
> I am hoping someone can help me??
> 
> I currently run Fedora 11 on an Apple PowerMac G4 and recently performed 
> an upgrade to it which rendered my site completely unsee able for a 
> while  but then after re-saving it showed up through my browsers however 
> my menu bar was slightly altered probably due to lack of formatting.
> 
> Apache error logs claim this:
> 
> [Sun Jan 10 23:06:23 2010] [error] [client 192.168.1.110] PHP Parse 
> error:  syntax error, unexpected T_STRING, expecting ',' or ';' in 
> /home/optiplex-networks/links.php on line 20, referer: 
> http://co111w.col111.mail.live.com/mail/InboxLight.aspx?n=454360575
> 
> I have attempted to enable PHP debugging but nothing is being shown!
> 
> To give an idea of where things are going wrong this is the start of the 
> file:
> 
> <?php # Script 3.4 - index.php
> 
> // Set the page title and include the HTML header.
> $page_title = 'Optiplex Networks';
> include ('./header.inc');
> ?>
> 
> <?php
> 
> ini_set('display_errors',1);
> error_reporting(E_ALL|E_STRICT);
> 
> echo '
> 
> 
> <table width="100%" align="center" border="0" bgcolor="#CCCCCC">
> <tr><td align="center"><font size="4"><strong>Contributors to Optiplex 
> Networks:</strong></font></td></tr>
> </table>
> 
> <p>If it weren't for these projects Optiplex Networks would not have 
> happened. My thanks and regards to everyone involved!</p>
> 
> 
> <table width="95%" border="1" align="center">
>   <tr>
> 
>     <td width="15%"><div align="center" 
> class="style2"><strong>Name</strong></div></td>
>     <td width="20%"><div align="center" 
> class="style2"><strong>Address</strong></div></td>
>     <td width="*"><div align="center" 
> class="style2"><strong>Description</strong></div></td>
>   </tr>
> 
> 
> Line 20 is the line beginning with <p>If it weren't for.......
> 
> I don't understand why this should be an error as it's basic html!
> 
> The only php part I have used is just echoing the html out.
> 
> As shown the echo ' is closed off at the bottom of the file with:
> 
> ';
> 
> ?>
> 
> which is fine according the book I read about php.
> 
> Obviously something is wrong but I can't figure it out, if anyone can 
> give me a hand I'd very much appreciate it!
> 
> Many thanks,
> 
> Kaya
> 


The main issue I can see is that the single quote string delimiter that
you're using is also being used in the HTML text! Have you considered
using heredoc syntax instead?

echo <<<OUTPUT

your html goes here

OUTPUT;

The only thing to watch out for here is that the OUTPUT; line is all on
it's own, and is preceeded with no whitespace at all. Also, the word
OUTPUT in this example can be whatever you feel like. The main advantage
ti heredoc is that you can use any quote characters you like within the
text and you can output any PHP variables in the text also as if you had
a double quoted string.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Mon, 2010-01-11 at 02:52 +0200, Kaya Saman wrote:

> Hi,
> 
> I am hoping someone can help me??
> 
> I currently run Fedora 11 on an Apple PowerMac G4 and recently performed 
> an upgrade to it which rendered my site completely unsee able for a 
> while  but then after re-saving it showed up through my browsers however 
> my menu bar was slightly altered probably due to lack of formatting.
> 
> Apache error logs claim this:
> 
> [Sun Jan 10 23:06:23 2010] [error] [client 192.168.1.110] PHP Parse 
> error:  syntax error, unexpected T_STRING, expecting ',' or ';' in 
> /home/optiplex-networks/links.php on line 20, referer: 
> http://co111w.col111.mail.live.com/mail/InboxLight.aspx?n=454360575
> 
> I have attempted to enable PHP debugging but nothing is being shown!
> 
> To give an idea of where things are going wrong this is the start of the 
> file:
> 
> <?php # Script 3.4 - index.php
> 
> // Set the page title and include the HTML header.
> $page_title = 'Optiplex Networks';
> include ('./header.inc');
> ?>
> 
> <?php
> 
> ini_set('display_errors',1);
> error_reporting(E_ALL|E_STRICT);
> 
> echo '
> 
> 
> <table width="100%" align="center" border="0" bgcolor="#CCCCCC">
> <tr><td align="center"><font size="4"><strong>Contributors to Optiplex 
> Networks:</strong></font></td></tr>
> </table>
> 
> <p>If it weren't for these projects Optiplex Networks would not have 
> happened. My thanks and regards to everyone involved!</p>
> 
> 
> <table width="95%" border="1" align="center">
>   <tr>
> 
>     <td width="15%"><div align="center" 
> class="style2"><strong>Name</strong></div></td>
>     <td width="20%"><div align="center" 
> class="style2"><strong>Address</strong></div></td>
>     <td width="*"><div align="center" 
> class="style2"><strong>Description</strong></div></td>
>   </tr>
> 
> 
> Line 20 is the line beginning with <p>If it weren't for.......
> 
> I don't understand why this should be an error as it's basic html!
> 
> The only php part I have used is just echoing the html out.
> 
> As shown the echo ' is closed off at the bottom of the file with:
> 
> ';
> 
> ?>
> 
> which is fine according the book I read about php.
> 
> Obviously something is wrong but I can't figure it out, if anyone can 
> give me a hand I'd very much appreciate it!
> 
> Many thanks,
> 
> Kaya
> 


I also forgot to mention, it's worth getting an editor that comes with
syntax highlighting, as this would have shown you the problem right
away.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---

Ashley Sheridan wrote:
On Mon, 2010-01-11 at 02:52 +0200, Kaya Saman wrote:

Hi,

I am hoping someone can help me??

I currently run Fedora 11 on an Apple PowerMac G4 and recently performed an upgrade to it which rendered my site completely unsee able for a while but then after re-saving it showed up through my browsers however my menu bar was slightly altered probably due to lack of formatting.

Apache error logs claim this:

[Sun Jan 10 23:06:23 2010] [error] [client 192.168.1.110] PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/optiplex-networks/links.php on line 20, referer: http://co111w.col111.mail.live.com/mail/InboxLight.aspx?n=454360575

I have attempted to enable PHP debugging but nothing is being shown!

To give an idea of where things are going wrong this is the start of the file:

<?php # Script 3.4 - index.php

// Set the page title and include the HTML header.
$page_title = 'Optiplex Networks';
include ('./header.inc');
?>

<?php

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

echo '


<table width="100%" align="center" border="0" bgcolor="#CCCCCC">
<tr><td align="center"><font size="4"><strong>Contributors to Optiplex Networks:</strong></font></td></tr>
</table>

<p>If it weren't for these projects Optiplex Networks would not have happened. My thanks and regards to everyone involved!</p>


<table width="95%" border="1" align="center">
  <tr>

<td width="15%"><div align="center" class="style2"><strong>Name</strong></div></td> <td width="20%"><div align="center" class="style2"><strong>Address</strong></div></td> <td width="*"><div align="center" class="style2"><strong>Description</strong></div></td>
  </tr>


Line 20 is the line beginning with <p>If it weren't for.......

I don't understand why this should be an error as it's basic html!

The only php part I have used is just echoing the html out.

As shown the echo ' is closed off at the bottom of the file with:

';

?>

which is fine according the book I read about php.

Obviously something is wrong but I can't figure it out, if anyone can give me a hand I'd very much appreciate it!

Many thanks,

Kaya



The main issue I can see is that the single quote string delimiter that
you're using is also being used in the HTML text! Have you considered
using heredoc syntax instead?

echo <<<OUTPUT

your html goes here

OUTPUT;

The only thing to watch out for here is that the OUTPUT; line is all on
it's own, and is preceeded with no whitespace at all. Also, the word
OUTPUT in this example can be whatever you feel like. The main advantage
ti heredoc is that you can use any quote characters you like within the
text and you can output any PHP variables in the text also as if you had
a double quoted string.

Thanks,
Ash
http://www.ashleysheridan.co.uk



Yup, and the single quote shows up right in this line:

<p>If it weren't for these projects Optiplex Networks would not have

Ken Sande/KC8QNI

--- End Message ---
--- Begin Message ---



I also forgot to mention, it's worth getting an editor that comes with syntax highlighting, as this would have shown you the problem right away.

Thanks,
Ash
http://www.ashleysheridan.co.uk


Thanks for both comments Ashley!

I will attempt it now. An editor with syntax checking?? Currently my data center is in the UK and I am in Turkey so am having to SSH in and my current text editor is nano. Are there any good CLI based editors that will do highlighting something hopefully not in the vi/vim categories as I really don't get on with them!
--- End Message ---
--- Begin Message ---
On Mon, 2010-01-11 at 03:06 +0200, Kaya Saman wrote:

> >>
> >>     
> >
> > I also forgot to mention, it's worth getting an editor that comes with 
> > syntax highlighting, as this would have shown you the problem right away.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> Thanks for both comments Ashley!
> 
> I will attempt it now. An editor with syntax checking?? Currently my 
> data center is in the UK and I am in Turkey so am having to SSH in and 
> my current text editor is nano. Are there any good CLI based editors 
> that will do highlighting something hopefully not in the vi/vim 
> categories as I really don't get on with them!


I use Kate which comes with KDE on Linux. With KDE's Kioslaves I can
edit files directly over SSH via the SFTP protocol.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---


I use Kate which comes with KDE on Linux. With KDE's Kioslaves I can edit files directly over SSH via the SFTP protocol.

Thanks,
Ash
http://www.ashleysheridan.co.uk


Thank you for the suggestion!

Your idea about using echo <<<OUTPUT

worked and I now have access to the files again :-)

I am not quite sure why the menu comprising of: portal, unix, login etc.... has become so messed up - totally left aligned as it was fine before my upgrade. (I guess use editor like you say which may highlight the problem; just hope it works with .inc files as well)

Regards,

Kaya

--- End Message ---
--- Begin Message ---
On Mon, 2010-01-11 at 03:15 +0200, Kaya Saman wrote:

> >
> > I use Kate which comes with KDE on Linux. With KDE's Kioslaves I can 
> > edit files directly over SSH via the SFTP protocol.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> Thank you for the suggestion!
> 
> Your idea about using echo <<<OUTPUT
> 
> worked and I now have access to the files again :-)
> 
> I am not quite sure why the menu comprising of: portal, unix, login 
> etc.... has become so messed up - totally left aligned as it was fine 
> before my upgrade. (I guess use editor like you say which may highlight 
> the problem; just hope it works with .inc files as well)
> 
> Regards,
> 
> Kaya
> 


The Kate editor can syntax highlight in literally dozens of different
languages. If it doesn't recognise one right away, you can configure it
to recognise a new extension, or just pick the language from a list once
the file is opened.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---



Depending on the latency and bandwidth you could use X11 forwarding (granted the server supports it) so you could use a non-CLI editor. I think "joe" has some syntax highlighting, but I've never edited PHP files with it. If you are coming from a windows machine, you can use Cygwin or Xming to set up an X server on the box before SSHing to your data center w/X11 forwarding enabled.

-Ken Sande
Many thanks to everyone!

I currently use a mixture of FreeBSD, Linux, and Solaris/OpenSolaris as operating systems so X11 forwarding is not a problem but maybe quite slow considering the distance between me and my data center right now, and also I have only 1Mbps upstream as the data center uses ADSL which is a restriction on my behalf.

Am using SFTP to transfer non-html related stuff and using simple nano or copy-paste from the Gnome terminal.....

Yeah many options available I know and I guess that's what makes things fun :-)

Anyway I'm sure I'll work something out, at worst case I could always VPN once I get a Cisco router out here and get an IPsec tunnel going and do things over NFS mount??

Regards,

Kaya

--- End Message ---
--- Begin Message ---
Hello List.

Probably an easy question, but I am not able to format a number to round up from 3 numbers after the decimal to just 2.

My code looks like this:

$newprice = "$".number_format($old_price, 2, ".", ",");

and this returns "$0.109" when I am looking for "$0.11".


I tried:

$newprice = "$".round(number_format($old_price, 2, ".", ","),2);
But no luck.

Any help is appreciated.

Thanks,

 --Rick



--- End Message ---
--- Begin Message ---
Testing this out a little:

matt...@mumin:~$ php -r 'echo "\$".number_format(0.109, 2, ".", ",")."\n";'
$0.11
matt...@mumin:~$ php -r 'echo "$".number_format(0.109, 2, ".", ",")."\n";'
$0.11
matt...@mumin:~$ php -r 'echo "$".number_format("0.109", 2, ".", ",")."\n";'
$0.11

I think the $ should be escaped with a backslash when enclosed within double quotes, but even the second and third tries return the correct result for me. Using PHP 5.2.10.

Cheers,

Mattias

Rick Dwyer wrote:
Hello List.

Probably an easy question, but I am not able to format a number to round up from 3 numbers after the decimal to just 2.

My code looks like this:

$newprice = "$".number_format($old_price, 2, ".", ",");

and this returns "$0.109" when I am looking for "$0.11".


I tried:

$newprice = "$".round(number_format($old_price, 2, ".", ","),2);
But no luck.

Any help is appreciated.

Thanks,

 --Rick





--- End Message ---

Reply via email to