How to tell PHP to write data to another frame

How to tell PHP to write data to another frame

am 15.11.2005 11:36:59 von Stefan Mueller

I've a frameset (test-submit-main.html) with 2 frames. The user works within
frame 1 (test-submit-frame1.html). In frame 2 (test-submit-frame2.html) I
collect some data which are stored in hidden fields. If the user presses
submit, the hidden fields of frame 2 gets sumbitted.

Unfortunately the output generated by PHP (test-submit.php) is shown in
frame 2.

Does someone know how to tell PHP to send the data to frame 1?
Stefan


++++++++++++++++++++++++++++++++++++++++++++++++

test-submit-main.html
=====================







++++++++++++++++++++++++++++++++++++++++++++++++

test-submit-frame1.html
=======================


"iso-8859-1">
"eval(parent.frames[1].document.MyFormFrame2.submit())">




++++++++++++++++++++++++++++++++++++++++++++++++

test-submit-frame2.html
=======================



accept-charset = "iso-8859-1">







++++++++++++++++++++++++++++++++++++++++++++++++

test-submit.php
===============


echo "MyField1: " . $_POST['MyField1'];
echo "This message should be displayed in frame 1 and not in frame
2!";
?>



++++++++++++++++++++++++++++++++++++++++++++++++

Re: How to tell PHP to write data to another frame

am 15.11.2005 11:57:41 von catch

Stefan Mueller wrote:
> I've a frameset (test-submit-main.html) with 2 frames. The user works within
> frame 1 (test-submit-frame1.html). In frame 2 (test-submit-frame2.html) I
> collect some data which are stored in hidden fields. If the user presses
> submit, the hidden fields of frame 2 gets sumbitted.
>
> Unfortunately the output generated by PHP (test-submit.php) is shown in
> frame 2.
>
> Does someone know how to tell PHP to send the data to frame 1?
> Stefan

PHP has no concept of HTML frames.

You'll have to add a target="..." attribute to your

element.

--
Oli

Re: How to tell PHP to write data to another frame

am 15.11.2005 22:53:06 von Stefan Mueller

> PHP has no concept of HTML frames.
>
> You'll have to add a target="..." attribute to your element.

Great, this works perfect and is good enough for my requirements. But does
that mean that a PHP script can only write data to one frame? Is there
really no possibility to refresh a second frame with a PHP script?

Stefan

Re: How to tell PHP to write data to another frame

am 16.11.2005 11:24:51 von Stefan Rybacki

Stefan Mueller wrote:
>>PHP has no concept of HTML frames.
>>
>>You'll have to add a target="..." attribute to your element.
>
>
> Great, this works perfect and is good enough for my requirements. But does
> that mean that a PHP script can only write data to one frame? Is there
> really no possibility to refresh a second frame with a PHP script?

You can reload the other frame by calling a php script to it nothing more. PHP is just a
server side "data generator", which app receives this data and what it does with it
doesn't matter.

Regards

>
> Stefan
>
>

Re: How to tell PHP to write data to another frame

am 16.11.2005 11:42:53 von Shion

Stefan Mueller wrote:
>> PHP has no concept of HTML frames.
>>
>> You'll have to add a target="..." attribute to your element.
>
> Great, this works perfect and is good enough for my requirements. But does
> that mean that a PHP script can only write data to one frame? Is there
> really no possibility to refresh a second frame with a PHP script?

No, for that you need client side scripts, javascript is the most spread one,
but sadly some companies have to modify their version so that it won't be
compatible with the "core".


//Aho

Re: How to tell PHP to write data to another frame

am 16.11.2005 11:59:50 von Etienne Marais

Stefan Rybacki wrote:

> Stefan Mueller wrote:
>>>PHP has no concept of HTML frames.
>>>
>>>You'll have to add a target="..." attribute to your element.
>>
>>
>> Great, this works perfect and is good enough for my requirements. But
>> does that mean that a PHP script can only write data to one frame? Is
>> there really no possibility to refresh a second frame with a PHP script?


/* mainframe.inc */

// some code

if (condition_is_met_to_refresh_other_frame) {

?>


}

// more code

?>

Re: How to tell PHP to write data to another frame

am 16.11.2005 12:55:53 von Stefan Rybacki

Etienne Marais wrote:
>...
> >
> /* mainframe.inc */
>
> // some code
>
> if (condition_is_met_to_refresh_other_frame) {
>
> ?>
>
> >
> }
>

This is javascript. You just generate this code with php but php has nothing to do with
the reload.
Its like: "Can php print bold text?" Oh yes it can "Bold text "! ;)

Regards
Stefan

> // more code
>
> ?>
>
>
>

Re: How to tell PHP to write data to another frame

am 16.11.2005 13:34:33 von Etienne Marais

> This is javascript. You just generate this code with php but php has
> nothing to do with the reload.
> Its like: "Can php print bold text?" Oh yes it can "Bold text "! ;)

True, but anybody asking the question
in the first place is looking for a
solution, not technicalities. I once
used php to mirror databases, streaming
javascript to a browser reporting on the
progress (using Javascript and the DOM),
I feel this was a PHP project, not Javascript
and certainly not HTML. Can PHP 'do' HTML ?
Yes, can PHP 'do' Javascript ? Yes. Does PHP
have a library function for updating a frame ?
No, it is not supposed to, the DOM and
whichever scripting language you use is.

Re: How to tell PHP to write data to another frame

am 16.11.2005 14:51:01 von Ian B

OK, it's a php project producing javascript, but the question is about
javascript.

I could use php to produce Z80 Assembler, but I wouldn't expect to get
an answer to a Z80 question here.

People answer javascript questions here - I do - but really, the
question should be asked elsewhere.

The problem here is that the asker doesn't understand the difference
between the two, doesn't know where the problem lies, and therefore
can't know where to post for an answer.

Ian

Re: How to tell PHP to write data to another frame

am 16.11.2005 16:55:26 von Stefan Mueller

> The problem here is that the asker doesn't understand the difference
> between the two, doesn't know where the problem lies, and therefore
> can't know where to post for an answer.

Yea, you're right. I'm a newbie in HTML, PHP, Javascripts...
However, I'm really very happy that you guys are answering my questions also
if they are not exactely in the right newgroup.

Many thanks to all of you
Stefan

Re: How to tell PHP to write data to another frame

am 16.11.2005 19:01:00 von Ian B

Hey, we've all been at the stage where we didn't know the difference,
it just that some of us don't remember it.

Re: How to tell PHP to write data to another frame

am 18.11.2005 01:14:07 von Cujo

Stefan Mueller wrote:

> Great, this works perfect and is good enough for my requirements. But does
> that mean that a PHP script can only write data to one frame? Is there
> really no possibility to refresh a second frame with a PHP script?

Php is SERVER SIDE.

It is *not* a limitation of php, rather php is in the wrong "place" in
the chain of events to be able to do this.

This is a client side task.

Client tasks are to be dealt with html, javascript, whatever.

And YES, php *can* be used to *generate* html, javascript or whatever in
order to achieve what you want. Not directly though, the php interpreter
has no knowledge of pages, forms, frames and such.

regards, f.
--
Cujo.

Re: How to tell PHP to write data to another frame

am 18.11.2005 18:41:04 von nc

Stefan Mueller wrote:
>
> I've a frameset (test-submit-main.html) with 2 frames. The user works within
> frame 1 (test-submit-frame1.html). In frame 2 (test-submit-frame2.html) I
> collect some data which are stored in hidden fields. If the user presses
> submit, the hidden fields of frame 2 gets sumbitted.
>
> Unfortunately the output generated by PHP (test-submit.php) is shown in
> frame 2.
>
> Does someone know how to tell PHP to send the data to frame 1?

Easy. Right now, you have:

accept-charset = "iso-8859-1">

Change it to this:

target="MyFrame1" accept-charset = "iso-8859-1">

Cheers,
NC