This is a discussion on update without reloading browser within the PHP Language forums, part of the PHP Programming Forums category; Hi Obviously I'm new to PHP. I would like to be able to update a table in a page ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
J. J. Cale wrote:
> Hi > Obviously I'm new to PHP. I would like to be able to update a table in a > page from a database on the server without reloading the page each time. Is > this possible with PHP? > TIA > Jimbo > > Short answer no. Slightly longer answer. Remember you are working in an asynchronous environment. The information displayed on a browser client is a snapshot of the wrold the webserver sees when the page is requested. Well, its not quite that simple but you get the idea hopefully, if the information needs to be refreshed then the server has to be asked for the page again. |
|
|||
|
Following on from J. J. Cale's message. . .
>Hi > Obviously I'm new to PHP. I would like to be able to update a table in a >page from a database on the server without reloading the page each time. Is >this possible with PHP? >TIA >Jimbo > > Not really. For example you couldn't update the table _display_. But you can use javascript on say a link or a input field's OnBlur() event to open another window, process some PHP in there then close the new window. But the original page won't budge unless you force a reload. I have used flying screens but only for access to a search-a-table-then-select-box for inputting. eg The searchable/sortable product catalogue listing opens up _if_ the focus reaches a suitable input. Or alternatively it can be used to validate input before submitting the whole screen. Combine the two if you want to do something like: (1) Pick this product (2) Select delivery options (2a) Validate delivery option is suited to product (3) More input... (4)Submit. However it is a fiddle with lots of things to go wrong and you may be better redesigning the sequence. I've written an article on the subject of flying screens with some examples which I could send you on request. -- PETER FOX Not the same since the borehole business dried up peterfox@eminent.demon.co.uk.not.this.bit.no.html 2 Tees Close, Witham, Essex. Gravity beer in Essex <http://www.eminent.demon.co.uk> |
|
|||
|
noSpam wrote:
> J. J. Cale wrote: >> Hi >> Obviously I'm new to PHP. I would like to be able to update a >> table in a page from a database on the server without reloading the >> page each time. Is this possible with PHP? >> TIA >> Jimbo >> >> > Short answer no. > > Slightly longer answer. > > Remember you are working in an asynchronous environment. The > information displayed on a browser client is a snapshot of the wrold > the webserver sees when the page is requested. > Well, its not quite that simple but you get the idea hopefully, if the > information needs to be refreshed then the server has to be asked for > the page again. And another answer: As JJ said, you can't do that with PHP. What you need is Javascript, specifically HttpXmlRequest, which can do it for you. HTH, Berislav |
|
|||
|
Berislav Lopac wrote:
> noSpam wrote: > >>J. J. Cale wrote: >> >>>Hi >>> Obviously I'm new to PHP. I would like to be able to update a >>>table in a page from a database on the server without reloading the >>>page each time. Is this possible with PHP? >>>TIA >>>Jimbo >>> >>> >> >>Short answer no. >> >>Slightly longer answer. >> >>Remember you are working in an asynchronous environment. The >>information displayed on a browser client is a snapshot of the wrold >>the webserver sees when the page is requested. >>Well, its not quite that simple but you get the idea hopefully, if the >>information needs to be refreshed then the server has to be asked for >>the page again. > > > And another answer: > > As JJ said, you can't do that with PHP. What you need is Javascript, > specifically HttpXmlRequest, which can do it for you. > > HTH, > > Berislav > > Agree, however what ever mechanism is used to refresh the page be it Java script VB Script etc it still requires a new request to the server. |