Be a Supporter!

Update Iframes using php?

  • 392 Views
  • 3 Replies
New Topic Respond to this Topic
Fruitpastles
Fruitpastles
  • Member since: Oct. 13, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Update Iframes using php? 2006-12-04 18:34:26 Reply

I'm am aware of how to read the data submitted in html forms with php, but is there anyway to send things back? e.g. update the src of an iframe?

henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Update Iframes using php? 2006-12-05 06:04:52 Reply

Php works on the http level. The best it can do is to ask some sort of software that does or will run on the client to alter the state at the client.
Or in lazyman terms: use javascript.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

different
different
  • Member since: Jul. 8, 2004
  • Offline.
Forum Stats
Member
Level 35
Blank Slate
Response to Update Iframes using php? 2006-12-05 11:13:09 Reply

At 12/4/06 06:34 PM, Fruitpastles wrote: I'm am aware of how to read the data submitted in html forms with php, but is there anyway to send things back? e.g. update the src of an iframe?

Sure..

<html>
...
<body>
<iframe src="<?php echo $src; ?>"></iframe>
</body>
</html>

Then just change $src when you post your form. Though a much better (and compatible with all browsers) method would be to use includes.


> twitter.

Fruitpastles
Fruitpastles
  • Member since: Oct. 13, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Update Iframes using php? 2006-12-06 11:34:06 Reply

Thanks you two, especially different. Thanks a lot!