You are here: Re: calling a javascript alert from php « PHP Programming Language « IT news, forums, messages
Re: calling a javascript alert from php

Posted by David Haynes on 07/13/06 23:35

Chuck Anderson wrote:
> David Haynes wrote:
>> Chuck Anderson wrote:
>>
>>> monomaniac21 wrote:
>>>
>>>> hi i want to be able to trigger a javascript style popup alert in php
>>>> (i want a message displayed on the actual page) is this possible?
>>>>
>>>>
>>> I'll take this one ... all I usually do here is ask questions.
>>>
>>> The answer to your question is No. Php is run on the *server before*
>>> the page is displayed. Therefore, Php cannot popup an alert like
>>> JavaScript (which runs on the *client computer after* the page is
>>> loaded).
>>>
>>> That said; if you want to implement a two step procedure like
>>>
>>> (1) Delete this file.
>>> (2) Are you Sure (Y or N)?
>>>
>>> You can do that with Php, but clicking on (1) must create a request
>>> to the server to display a new page with (2) as a form or hyperlinks.
>>> Clicking on Y or N must return to the server again in able to perform
>>> the action.
>>>
>>>
>> or you can have the php spit out the javascript as part of the page and
>> trigger it from the onclick= in the submit.
>>
>> -david-
> But that's not "triggered in Php" and is simply JavaScript.
>
Yes, but you had already provided "you can't get there from here"
answer. Sometimes it pays to offer alternatives rather than just to
answer the question someone has asked.

-david-

 

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

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