php-general Digest 15 Apr 2006 12:59:59 -0000 Issue 4073

Topics (messages 234025 through 234035):

½ðÅÆ¹ÜÀí-Åàѵ-²ß»®-ÓªÏú-×ÊÁÏ-17:21:26
        234025 by: iblzx1

Re: 2 questions: Search in array and detect JS
        234026 by: Stut
        234035 by: Ryan A

Apache 2.2 problems to protect folder with mod_authz_host
        234027 by: Dennis Neetix
        234028 by: chris smith

Re: how should MS Access DATETIME be handled in PHP?
        234029 by: chris smith

refresh PHP page via onclick event
        234030 by: Alain Roger
        234031 by: chris smith
        234032 by: Alain Roger
        234033 by: Richard Davey
        234034 by: afan.afan.net

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
http://www.wkvv.com

■■■您可从以下10张光盘共26000多份资料中,任选一份资料免费分享,以证明我们资料的真实性■■■

尊敬的先生/女士:
    您好!

对不起,冒昧发信打搅您了!

金牌资料网-管理-培训-策划-营销-资料   名企内部资料:

知名企业内部资料首次大解密!汲名企之精华,创事业之颠峰!中国企业500强内部资料,职业经理人的必备宝典;职业晋升的助手参谋,馈赠亲朋老板的最好礼品

市场策划方案:
著名营销策划机构的经典之作,中国企业前100强内部资料营销策划广告人的必备宝典,畅销产品背后的策划内幕,

本网历时半年,呕心沥血精心搜集整理完成共10张光盘。现我网2006年特价销售,每张光盘只需要150元

第一张光碟资料 详细文件列表..进入 http://www.wkvv.com/index1.htm   
第二张光碟资料 详细文件列表..进入 http://www.wkvv.com/index2.htm
第三张光碟资料 详细文件列表..进入 http://www.wkvv.com/index3.htm  
第四张光碟资料 详细文件列表..进入 http://www.wkvv.com/index4.htm
第五张光碟资料 详细文件列表..进入 http://www.wkvv.com/index5.htm  
第六张光碟资料 详细文件列表..进入 http://www.wkvv.com/index6.htm
第七张光碟资料 详细文件列表..进入 http://www.wkvv.com/index7.htm  
第八张光碟资料 详细文件列表..进入 http://www.wkvv.com/index8.htm
第九张光碟资料 详细文件列表..进入 http://www.wkvv.com/index9.htm  
第十张光碟资料 详细文件列表..进入 http://www.wkvv.com/index10.htm

http://www.wkvv.com

■■■您可从以下10张光盘共26000多份资料中,任选一份资料免费分享,以证明我们资料的真实性■■■
      
  有些朋友在向我们咨询时,表示愿意购买,但又担心我们的资料和网站上公布的不符,为消除这些朋友的担心,我们特别推出“免费索取一份资料的活动”;

  
请注意:一.索取资料时,需要留下您的联系方式,包括:1.您的联系地址;2.公司名称;3.姓名;4.电话;5.邮箱;没有留下联系方式的索取资料信,我们将不予理会。因为,从两万多份资料里,找出一份资料发给需要的朋友,这是我们对您的诚意,也希望索取资料的您,表示一下您的诚意;

       二. 请索取资料时,一定要注明该资料的“标题”、该资料在第几张光盘里;以提高我们的效率;


联系我们:
联 系 人:李亚中
服务热线:13539507947
服务邮箱: [EMAIL PROTECTED]  
服 务 QQ:79833916


银行付款帐号
中国农业银行
金穗通宝卡号:95599 8114 60313 03415
户名:李亚中



http://www.wkvv.com

部分资料目录,资料在不断增加中

北大纵横 - ××销售系统人力资源诊断报告(中期报告).ppt  
北大纵横 - XXX公司组织结构诊断报告.ppt  
北大纵横--××集团人力资源战略.ppt  
北大纵横――LNJC电子股份有限公司人力资源诊断报告.ppt  
北大纵横--XX公司组织结构及管理流程设计报告.ppt  
北大纵横-北京东环置业财务诊断报告.ppt  
北大纵横管理咨询公司为某公司做的-业务流程报告.ppt  
北大纵横-江苏牧羊集团战略和组织结构报告.ppt  
北大纵横--某环保科技有限公司关键管理流程设计报告.ppt  
北大纵横人力资源咨询(书).doc  
北大纵横为某公司做比较详细的-问卷调查分析报告PPT122页.ppt  
玩具类商品验收标准.doc  
玩具类主管任职资格及岗位职责标准.doc  
为顾客服务时站姿标准.doc  
维修班长任职资格及岗位职责标准.doc  
维修人员任职资格及岗位职责标准.doc  
文体用品柜组长.doc  
文体用品类主管任职资格及岗位职责标准.doc  
物价员任职资格及岗位职责标准.doc  
物价质检职能标准.doc  
物品还原人员.doc  
宝钢接受天价进口铁矿石原因分析.doc  
钢材市场营销方案制定浅议.doc  
国内外钢铁成本分析.doc  
戚向东-2005年中国钢铁工业运行态势及钢材市场价格走势分析.ppt  
有色金属深加工投资机会研究咨询报告(中).ppt  
中国钢铁产业报告(正文).doc  
专家对中国钢铁企业并购的分析.doc  
管理咨询及IT规划项目人力资源管理培训.ppt  
国有企业产权制度改革调查报告与XXX发展产权制度改革建议书.ppt  
惠丰医药集团管理制度体系咨询项目建议书.ppt  
江苏省广播电视总台(集团)发展战略咨询项目建议书.ppt  
某大型咨询公司图片模板.ppt  
某某餐饮战略咨询项目建议书.pdf  
239某某宝洁经营部应收帐款内部对帐流程(样本).doc  
240某某百货集团公司宝洁经营部应付帐款流程(样本).doc  
241某某宝洁经营部应付帐款内部对帐流程(样本).doc  
242某某宝洁经营部应付帐款外部对帐流程(样本).doc  
243某某宝洁经营部现金流量计划流程(样本).doc 

--- End Message ---
--- Begin Message ---
Ryan A wrote:
1) Is it possible to detect JavaScript via php... and yes I do know that JS
is client side while PHP is server...but how else to do it?
The reason I ask is before serving an AJAX page I would like to make sure JS
is enabled, if not, serve the other "normal page"... I am sure I am not the
first person to come accross this little problem, how did you solve it?

The way I do this is to serve the 'notmal page' first, but with the following snippet of JS in it...

<script language="javascript">
<!--
    location.href = '/url/for/ajax/page.php';
-->
</script>

That way if they have JS enabled they'll get sent to the AJAX page. If not they stay on the 'normal page'.

2) How can I search in an array for a particular word?

eg: in an array "movie" I have this kind of data:
movie_name=> some movie
cast=> Jim Carrey, Richard Pryor, Eddie Murphy

I want to search on either "Richard" or "Richard Pryor" (must be case
insensitive too)
something like a SELECT with a LIKE %% statement

I have been fooling around with in_array() but not getting anywhere
fast..... am I on the right track?
Links, code examples or advise would be as always....appreciated.

You should be able to craft some combination of array_walk and a custom function that checks each element with stristr to do what you need.

-Stut

--- End Message ---
--- Begin Message ---
Hey Stut,
Thanks for replying.

-------------------


The way I do this is to serve the 'notmal page' first, but with the
following snippet of JS in it...

<script language="javascript">
<!--
     location.href = '/url/for/ajax/page.php';
-->
</script>----------------------Makes sense and pretty easy, this was
suggested a while back, since you have supported itI think I'll start using
this method.------------------- You should be able to craft some combination
of array_walk and a custom
function that checks each element with stristr to do what you need.
-------------Actually, I solved this thanks to Richard from the list who
suggested strpos, a function I had never usedbefore ( Tedd from the list
gave me the same suggestion as you to use stristr, I didnt want to use
stristr as its a bit expensive esp with a really large array) the problem I
ran into was that strpos is a php5 function....but reading the user
contributed articles on strpos at thephp site I got the code that does
exactly that in 2-3 linesCheers!

--- End Message ---
--- Begin Message ---
Hello,

We're having some trouble with upgrading our webserver from apache 2.0 to 
apache 2.2. Everything is working fine except one thing:

We have created one alias (outside the web root folder). On this folder 
nobody from the internet should have access to it. Only the webserver should 
have access to this folder. On Apache 2.0 it was no problem to configure 
this in the httpd.conf. We loaded the module mod_access (which is now 
mod_authz_host) and created the alias:

Alias /abc "c:/apache/xyz/"

Options Indexes MultiViews ExecCGI
DirectoryIndex index.php
Order deny,allow
Deny from all
Allow from 127.0.0.1

But with this configuration it is possible to get access to our protected 
folder in Apache 2.2. Where is the error?

Best regards.

Dennis

PS: I don't want to protect this folder with .htaccess, if anybody is 
asking. 

--- End Message ---
--- Begin Message ---
On 4/15/06, Dennis Neetix <[EMAIL PROTECTED]> wrote:
> Hello,
>
> We're having some trouble with upgrading our webserver from apache 2.0 to
> apache 2.2. Everything is working fine except one thing:

Ask the apache mailing list: http://httpd.apache.org/lists.html

They will be able to give you a much quicker answer than we will.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
On 4/14/06, Bing Du <[EMAIL PROTECTED]> wrote:
> > While all the data-munging in PHP is very interesting...
> >
> > Might I suggest that you just use MySQL's date_format() function to
> > ask MySQL to give you the data you want in the first place?
> >
> > Some purists would claim that the database is not the place to put
> > presentation logic, of course.
> >
> > And for a large-scale library where other users might want to skin a
> > different format, I couldn't agree more.
> >
> > But, really, for a small project, K.I.S.S. wins out, and having MySQL
> > just hand you what you want instead of cluttering up your code with
> > several lines (or a long multi-operation line) of PHP, seems like a
> > cleaner solution.
> >
> > Not to mention that you'll have a lot less headaches like this one.
> >
> > http://mysql.com and search for "date_format"
>
> Thanks, Richard.  I agree with you.  Is date_format() a MySQL specific
> funtion?  If so, we're out of luck because our backend DB is MS Access.

Do the search as Richard suggested.

MS Access might have a similar function you can use, but you'll need
to do some searching yourself to find the answer.

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Sorry to look like stupid for some of you, but i'm still not able to link to
link (<a> </a>) or to a button via onclick event) the refresh of my page.

i've check META tag and also $PHP_SELF variable, but it does not work.

here is what i would like to do.

i have 1 PHP page on which i have 3 flags (3 images)
if user click on 1 of these flags, $_SESSION['Localization'] is set up to
flag language and the page must be refreshed.

thanks a lot for some help or tutorials.

Alain

--- End Message ---
--- Begin Message ---
On 4/15/06, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Sorry to look like stupid for some of you, but i'm still not able to link to
> link (<a> </a>) or to a button via onclick event) the refresh of my page.
>
> i've check META tag and also $PHP_SELF variable, but it does not work.

What happens when you try?

> i have 1 PHP page on which i have 3 flags (3 images)
> if user click on 1 of these flags, $_SESSION['Localization'] is set up to
> flag language and the page must be refreshed.

Something like this should work:

<a href="<?php echo $_SERVER['PHP_SELF']; ?>?lang=en">English</a>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?lang=fr">French</a>

Then check $_GET['lang'] to use the new language var (then set it in
the session etc).

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
but i do not want to add some variable at the end of link...
when user click on the flag, it should first store language into a $_SESSION
variable and after redirect/refresh page.


On 4/15/06, chris smith <[EMAIL PROTECTED]> wrote:
>
> On 4/15/06, Alain Roger <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Sorry to look like stupid for some of you, but i'm still not able to
> link to
> > link (<a> </a>) or to a button via onclick event) the refresh of my
> page.
> >
> > i've check META tag and also $PHP_SELF variable, but it does not work.
>
> What happens when you try?
>
> > i have 1 PHP page on which i have 3 flags (3 images)
> > if user click on 1 of these flags, $_SESSION['Localization'] is set up
> to
> > flag language and the page must be refreshed.
>
> Something like this should work:
>
> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?lang=en">English</a>
> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?lang=fr">French</a>
>
> Then check $_GET['lang'] to use the new language var (then set it in
> the session etc).
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

--- End Message ---
--- Begin Message ---
On 15 Apr 2006, at 12:51, Alain Roger wrote:

but i do not want to add some variable at the end of link...
when user click on the flag, it should first store language into a $_SESSION
variable and after redirect/refresh page.

Not possible. Web pages don't work like that.

You need the flags to link somewhere, and only then can it store the details in the session. So either each flag links to its own PHP script (pointless), or you follow the advice of Chris and handle it that way. However you look at it though, you've got to pass a language somehow. Either via the query string, or by calling a unique script that handles that language only.

Cheers,

Rich
--
http://www.corephp.co.uk
Zend Certified Engineer
PHP Development Services

--- End Message ---
--- Begin Message ---
Or, use form and images as button and you will not get variables at the
end of the link:


<form method=post action=<?= $_SERVER['PHP_SELF'] ?>>
<input type=images src=engFlag.jpg name=lang value=en>
<input type=images src=fraFlag.jpg name=lang value=fr>
</form>


and on the top of the page (php file) before you grab info from database
and language info (maybe i the header file):

<?php
if(isset($_POST['lang']))
{
   $_SESSION['lang'] = mysql_real_escape_string($_POST['lang']);
}
?>


-afan

> On 15 Apr 2006, at 12:51, Alain Roger wrote:
>
>> but i do not want to add some variable at the end of link...
>> when user click on the flag, it should first store language into a
>> $_SESSION
>> variable and after redirect/refresh page.
>
> Not possible. Web pages don't work like that.
>
> You need the flags to link somewhere, and only then can it store the
> details in the session. So either each flag links to its own PHP
> script (pointless), or you follow the advice of Chris and handle it
> that way. However you look at it though, you've got to pass a
> language somehow. Either via the query string, or by calling a unique
> script that handles that language only.
>
> Cheers,
>
> Rich
> --
> http://www.corephp.co.uk
> Zend Certified Engineer
> PHP Development Services
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to