Re: Passing variables.
| From: | tedd | Date: | Thu, 08 Jun 2006 15:27:16 +0000 |
| Subject: | Re: Passing variables. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237634@lists.php.net to get a copy of this message | ||
At 4:44 PM +0300 6/8/06, William Stokes wrote:
>I have a form that a user can use to edit www pages. Page content is stored
>in DB as a HTML code. First user has to select, from <select> menu, which
>page to edit. Then the selected page content html is retrieved to a
><textarea> where it can be edited with tinyMCE editor. Then there's two
>buttons. Publish to save the edited content back to DB (no problems there)
>and Preview to open the full page layout in a popup window. The problem is
>that I can't pass the edited data from the <textarea> to the popup window.
>Here's last (desperate) attempt:
-snip-
>When I echo $page at the preview.php window it prints some of the data to
>page and some to address line??? And this is not even the edited data. I
>should pass The variable $Edited but I can't get it to work
My opinion is that you're running into the classic problem of how to get javascript variables
into php variables.
As I see it, you have three ways to do this (anyone think I'm wrong, please correct me):
1. You place them into your dB with js and then pull them back out in php:
<http://www.devshed.com/c/a/MySQL/Loading-JavaScript-Arrays-with-MySQL-Data/>
2. You use ajax and plug the js variables values into like php variables. If you want to go this
route, it's not complicated -- I can demonstrate. Please let me know.
3. You can try in your html using an id="Edited" for js and a name="Edited" for
php -- it worked for a previous like-problem posted on this list. But I don't know if it's
applicable in your case.
hth's
tedd
--
------------------------------------------------------------------------------------
http://sperling.com http://ancientstones.com http://earthstones.com