TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-29-2007, 11:27 PM   #1 (permalink)
The Visitor
 
Join Date: Dec 2007
Posts: 4
Thanks: 0
cthemaaan is on a distinguished road
Default Target div

Is't anyone that know if it's possible to have taget in php code to one special div. I don't want the whole page to be updatet only the div tag. I know that it's possible to in javascript dose it work in php?
cthemaaan is offline  
Reply With Quote
Old 12-30-2007, 12:01 AM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Unfortunately this cannot be done with PHP alone. You will need to use a combination of Javascript and PHP to achieve this using Ajax (google Ajax PHP for more info). Essentially, your backend PHP script sends the updated text/html/etc using Ajax or more specificly, XML-RPC to the Javascript which then dynamicly updates the webpage without the need for a reload/refresh.

A few little tutorials / guides to get you started:

'[php] Rasmus' 30 second AJAX Tutorial - [was Re: [php] AJAX & PHP]' - MARC
PHPBuilder.com, the best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more. (good diagram to explai the process)

Alan.
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 12-30-2007, 12:03 AM   #3 (permalink)
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
sjaq is on a distinguished road
Default

You will need a combo of AJAX and PHP to get results like that. Here's a great "tutorial" on that (by Rasmus himself!)

Last edited by sjaq : 12-30-2007 at 12:04 AM. Reason: Alan beat me to it
sjaq is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:12 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design