Anyone know how to pass hidden values to an inline frame PHP

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
Hi Experts,

I want to pass an input value from an index page HTML to another page which has an inline frame. The inline frame is PHP. In other words:

Page1 (HTML) has a text input form which passes the value to Page2.
Page2 (PHP) GETs the Page1 value and passes it to its inline frame Page3.
Page3 (PHP) Gets the Page2 value and displays it in the inline frame.

Trouble is, the Page2 to Page3 part doesn't work. That's where I'm using HTML Form <input type=hidden name="valu" value="<? =$valu ?>">
and I've also tried value="%=request.form("value")%>">

What gives?
 
You must use a target in your form, which will be you iframe's name!

Example:
Code:
<form 
   target="Your_iFrame_Name" 
   action="default_iFrame_Src_File">
   ...
 
Hi GESF,

Thanks for the reply. I tried the TARGET thing, but it still doesn't work.

For some reason, the hidden name/value pair are not working. I'm trying to assign a $variable to the value, as in:

name="pass_value" value="<? =$variable ?>"

It never gets in the target PHP with $new_variable=$_GET['pass_value'];

Am I doing something wrong?
 
Use post method in your form and in your iFrame get the values with $_POST instead of $_GET or $_REQUEST.
 
Hi again GESF,

I tried your latest suggestion and still no go. I'm almost ready to give up.

I seem to be having two problems: firstly, I can't put the variable retrived from the first form into the VALUE= of the type=hidden form on the second page, and secondly, I still can't pass any hidden values to the inline frame PHP, even if I hard code a VALUE=.

If you have any further ideas, give me a reply. Otherwise I think I'll have to abondon this effort. Perhaps the browser I'm using (Mozilla) doesn't support inline frames, although they show up with no problem.

Any last recommendations?
 
To GESF and others,

I think I've isolated my problem with passing values to an inline frame PHP script with INPUT TYPE=Hiddden, and that is there is nothing to automatically submit the hidden value.

When I changed the TYPE to TEXT, I could see that the variable in the NAME/VALUE pair gets passed to the inline frame PHP only after I pressed enter. Then everything worked fine. But with TYPE=Hidden, the value can't be seen and therefore cannot be submitted.

If anyone knows how I can force the hidden form value to submit, I would appreciate it.
 
I really don't know what is causing that, but i'm sure a hidden input value is passed the same way as a text, password or other input's value.
Maybe you can show us the form code where the problem resides!?

Cheers
 
Hi GESF,

I found a way to force the submit using some JavaScript code and the submit() function, and I also solved that problem with the PHP $variable not being interpreted in the VALUE declaration by using the syntax VALUE=" .$variable. " instead of VALUE="<?=$variable ?>".

So with the forced submit and the proper variable passing, you'd think my little inline frame PHP thing works fine, right? No such luck. The Page3 PHP, while it works, does not display in the inline frame but on its own separate page. Nuts! But I'm sure I can make it work by playing around with the TARGET attribute or whatever.

Thanks for all your help, GESF.
 
So... it's all working !?
shawbapmp said:
The Page3 PHP, while it works, does not display in the inline frame but on its own separate page. Nuts!
That's it... a target problem !!

Hope you fix it !
Regards
 
Back
Top