Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP & Iframe passing value

Posted on 2013-01-15
2
Medium Priority
?
438 Views
Last Modified: 2013-01-16
Hi ,
I have a PHP program, inside this php, there is another PHP in iframe

<iframe id="I2"  name="I2"  src="cal_1.php" style="width: 640px">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>

I need to pass a value from this PHP to the one inside frame (cal_1.php).

One method that I could think of was using this in cal_1.php

<input type="submit" name="button2" id="button2" value="Run Report"  onClick="javascript:alert(parent.frames[0].document.getElementById('websiteadress').value);">


but it doesn't get anything , in error console , it says
Type Error parent.frames[0].document.getElementById('websiteadress').value  is null

Any help is appreciated
0
Comment
Question by:fparvini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38780191
You need to rephrase that.

Which php needs to pass what into where?

What is websiteaddress and in which page/php/window does it live?

Never do anything onclick of a submit button and javascript: pseudoprotocol/label is not needed
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 38780377
Just echo it in the tag and it will be a $_GET variable in "cal_1.php".

<iframe id="I2"  name="I2"  src="cal_1.php?name=<?php echo $value; ?>" style="width: 640px">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn how to count occurrences of each item in an array.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question