Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2004, 11:08 AM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cutesneakers Send a message via Yahoo to cutesneakers
Default <iframe> problem

I have made a form in HTML.
and i have a doubt
Can i use <iframe> to add data to MySQL database.
I mean :
  i have used the <iframe> thing cos' i've used the execCommand which,i guess,works only with <iframe>.
So can I take the HTML formatted data from the <iframe> and pass it to a PHP variable and after that add it to a MySQL database????
 PLease Please answer this doubt.
__________________
site lead ,apartment27 studios.
 
Old December 28th, 2004, 12:36 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

You want to get the HTML from the iframe. isn't it ? You can use the following statement.

id_editor_frame.document.body.innerHTML

where id_editor_frame is the ID of the iframe.
 
Old December 28th, 2004, 12:16 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cutesneakers Send a message via Yahoo to cutesneakers
Default

Quote:
quote:Originally posted by madhukp
 You want to get the HTML from the iframe. isn't it ? You can use the following statement.

id_editor_frame.document.body.innerHTML

where id_editor_frame is the ID of the iframe.
Yea I want to do just that.
suppose my code reads :
<form action="prevrev.php" method="POST">...(some form elements)

<iframe id="iView" name="review" marginwidth="0" style="width: 460px; height:100px">
</iframe> ......(some more form elements)

</form>

 Now,I have to extract the HTML formatted content contained in the <iframe> and collect it in a PHP variable.
I want the data in it to be sent to 'prevrev.php' like the contents of other form elements.
I have implemented a very basic Rich text Editor (BOLDface,italic,underline etc.) using Javascript,
so that my friends can format the text inside the <iframe> and when they click the "submit" button,the data inside <iframe> is sent AS IS to the 'prevrev.php' page for processing.
What I find difficult to understand is how to implement this in PHP.
Thanks for taking efforts to reply.
But I think this gives you a clearer view of my problem.
Please reply.
 
Old December 29th, 2004, 02:23 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

You can use Javascript to achive this.

You can put a hidden field in a form. Let txtView be the name of it.

document.form(0).txtView.value=document.all.iView. document.body.innerHTML;

document.form(0).submit();





Similar Threads
Thread Thread Starter Forum Replies Last Post
<table> not displaying because of <iframe> crmpicco HTML Code Clinic 16 October 6th, 2007 04:46 PM
Disabling "Horizontal Scrollbar" in <iframe> mcinar HTML Code Clinic 8 November 5th, 2006 09:03 AM
disable horizontal scrollbars in <iframe> crmpicco HTML Code Clinic 5 February 28th, 2005 11:21 PM
How to use css with <iframe frameBorder="no"> bekim CSS Cascading Style Sheets 1 January 20th, 2005 08:57 AM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.