Solved

PHP iFrame to another server

Posted on 2007-04-02
6
292 Views
Last Modified: 2010-08-05
Hello -
I am new to php and iFrame.  I have a php form that needs to be seen on a website that's server is controlled by our IT department.  I need my form to no appear on the main page, have a link on the navigation bar and show up on a separate target.  I'm not sure where to put the code to make this work.

Here's a portion of my code:
<FORM NAME="horizonsOnApp" ACTION="online_thank_you.php" METHOD="POST" onsubmit="return fieldcheck()">
          <table width="100%" border="0" cellspacing="1" cellpadding="1" name="Form Table" bgcolor="#FFFFFF">
            <tr bgcolor="#0099CC">
The site it needs to iFrame to is http://ebiz.sbc.com/horizons/.  CAN ANYONE HELP?
0
Comment
Question by:moette88
  • 4
  • 2
6 Comments
 
LVL 18

Accepted Solution

by:
Mark Gilbert earned 500 total points
ID: 18836251
Hi, I may not fully understand your question but from what I have read so far, you would like to put an iframe into your page, and get the form on the main part of the page, to submit to the iframe?  if this is correct, try the following:

<IFRAME SRC="http://ebiz.sbc.com/horizons/" WIDTH=100 HEIGHT=100 frameborder="0" style="border-width:0px" scrolling="no" id="news" name="horizons"></IFRAME>

In your form, change the form tag to the following:

<FORM NAME="horizonsOnApp" ACTION="online_thank_you.php" METHOD="POST" onsubmit="return fieldcheck()" target="horizons">

Basically what I have done here is created an iframe containing a page, in this instance the link you provided and called it horizons.  In the form, I have told the form to use the iframe as the target of the form, so the form will kind of post itself to the iframe, and not refresh the page.  

Hope this helps.
0
 
LVL 18

Assisted Solution

by:Mark Gilbert
Mark Gilbert earned 500 total points
ID: 18836264
Oh, and if you need to link items from the main page into the iframe, simply give each link a target="horizons", such as the following:

<a href="mypagename.php" target="horizons">text for link here</a>
0
 

Author Comment

by:moette88
ID: 18836501
Thanks for the help!

I actually need it to do the reverse.  I need to add the Horizons php form to the http://ebiz.sbc.com/horizons/ website, but i do not have access to the http://ebiz.sbc.com/horizons/ coding.  Can that be done?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 18837390
Hi, if you don't have access to the external websites code, I'm afraid there's no way of changing it's links or targets to different iframes, or even pages for that matter.  Their code I would assume has been specifically coded for their website, and not for external references.

Hope this helps.
0
 

Author Comment

by:moette88
ID: 18837405
I appreciate your help.  That is what i was afraid of.

I did test the other solution and it worked well.
0
 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 18837487
Hi Moette, glad I was able to provide you with some assistance.  Have a great day.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

829 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