Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Breaking Out Of An Iframe


I cannot figure this one out. My script is being displayed in an iframe (a wiki page) and I have one option won't give me the correct results unless the page is displayed in either

a) new tab in NS browser
b) new browser instance.

The option in question is used to print forms, and I use the browser Print Preview for the page setup. It's all pretty useless if I have the page and iframe content in my preview.

I thought using header() would do the trick.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Breaking Strings?
I have a string (actually 100's of these, but lets take one):

$string ="TI: Some journal title AU: SomeAuthor,-S; Smith,-A; Jones,-B SO: SomeSource. 2002 Jan 9; 287(2): 188; discussion 189-90 JN: Some Journal Title";

This needs to be turned into an array:

$entry = array(
'Some Item Title',
'SomeAuthor,-S; Smith,-A; Jones,-B',
'SomeSource. 2002 Jan 9; 287(2): 188; discussion 189-90',
'Some Journal Title');

As you can see, each array item should be defined by what comes after either/all of the following: 'TI:' 'AU:' 'SO:' 'JN:'

So, I need to be able to create a pattern that can look through the string and return everything in between TI: and AU:, then AU: and SO, etc.

for example:

eregi(???, $string, $entry);

I'm fairly new to this and can't seem to figure out the regex I need for the pattern. Is this even the way to go about it?

Breaking A Page Down.
What is the best solution to break down a php page into certain section using MySql, For example i'm looking at designing a page that reffers to a MySQL database that contains the html code for the navigation. So that in future if the navigation changes I'll only need to changed the html code in the database and all the pages will be sorted. I'm also looking at doing the same for the information on the footer of the page, with teh contact details.

Breaking Out Of Quotes
I know I can use stuff like in front of " so that it can't break out of a "" and start doing bad things, but it seems there are other situations where, E.G., if the string is hex for " then it has the same effect, and stuff like that, and it gets tricky escaping it all, so I'm wandering, is there some kind of option I can enable or extension I can install that just simply prevents objects/variables/arrays from breaking out of single/double quotes and also for mysql queries?

And also for html so E.G. echo"<img src='$asdf'>"; can't be exploited to do other things? I don't care if it isn't free as long as it works good and isn't to expensive..

Breaking Up Querys
I have a page that updates a table every workday. (these are standard updates, like if someone has moved, or has a different phone number or something.)  It is too big of a query to run the entire table all at once, so it is split out. 

The split is grouped by the first letter of a first name field.  Right now it is broken up into 5 parts, and each part has a group of letters (i.e. "a" to "d" is one group, "e" to "k" is the next, and so on.  As you can see, these do not have an even number of letters, but that is because some letters have a lot more entries, and need to be in smaller groups.) 

The reason it is split out into 5 groups is that I can run one group on each workday (Monday through Friday), and I can have the PHP check what day of the week it is.  (I use a case statement, the first case is for Monday, the second is for Tuesday, etc.) Code:

Breaking A Loop.
I have one going through rows of a sql database until it matches some data with user input. I need to put a break command in there but can't seem to find out how to achieve this.

Breaking Rows
I am using a while statement to pull results from my database. Now if I have like 40 results how would I make it break into rows.

So instead of;

result result result result result result result result result result result result result result result result result result

I want;

result result result result result
result result result result result
result result result result result
result result result result result

XML Parser Breaking Up URLs
I'm having a problem parsing an xml file in which one of an elements character data is a url which contains multiple "&" characters. For some reason the parser breaks up the data into multiple pieces. For instance, when I call this function(abbreviated):

function characterDataHandler ($parser, $data)
{
global $element;
global $url;
if ($element == "URL") {
$url = $data;
echo "url=".$url."<br>";
}
}

I get some output like this:


url=http://www.somewebsite.com/index.jsp?s=af

url=&

url=filter=1

url=&

url=show=all


Do urls with querystrings have to be handled differently then regular character data?

For Loops Breaking At A Certain Multiple
Can someone help me out with writing a script that will make will loop 500 times, but at every 4th multiple, it will insert a peice of code?

I tried all day to get this, and so far, nothing has worked.

Characters Breaking My Query
Im using encrypted data to store cc info. The PHP code encrypts and sends the result to the database. the problem is that the encrypted string contains lots of characters that will break my sql query. I can do a replace but there are lots of characters.

for example, a character will look like this:

g%$^'GDF$%^//"@#$%/||''$#"/|#dfsa.

how can I put this information in a different format... and then retrieve the data to decrypt the string?

Not Breaking Loop In Function
I get this error: <b>Fatal error</b>: Cannot break/continue 1 levels in <b>file.php</b> on line <b>128</b><br>

This happens when I call a function. In the function there is a break; This is cause the break is in a function and not in the loop. But it gets called inside the loop. Is there a fix for this?

E-Mail Not Breaking Lines
I'm sending an e-mail via a contact form, but somehow the lines aren't breaking in the text, it always looks like this:

lorem ipsum

dolor

sit

amet

lorem


Which is of course not readable at all. What am I doing wrong here? I'm using a few security checks and such for cleaning the field up; $text = trim($text);
...
$text = stripslashes(strip_tags($text));
...
$text = mysql_real_escape_string($text);
.....

#and then the part where it's included in the message:
$message .= "Nachricht: {$text} ";

Can any of those be causing the display problem?

Script Breaking On Mysql_result
I was trying to figure out why one of my scripts was failing and by using an "or die" statement for the SQL narrowed it down to this bit of code:

$md5 = md5_file("swf/" . basename($jpg_link));
$dupe = mysql_result(mysql_query("select count(gId) from games where gSwfFile='$md5.swf"), 0);
if(!empty($dupe))
{
continue;
}

This is giving the following error - "Warning: mysql_result(): supplied argument is not a valid MySQL result resource"

The thing is, I've checked that SQL query by running other values in place of $md5 through it and it appears to be fine. 

select count(gId) from games where gSwfFile='Flat War july 30th 2007.swf';
Any ideas?

Header Function - Breaking Out Of A Frame
I can create a plain htm link and have the new page break out of frames. a href='page.html' target='_top' Can this be done with a Header redirect in php?

Breaking Backwards Compatibility - Good Or Bad?
If you have any PHP scripts which will not work in the current releases
due to breaks in backwards compatibility then take a look at
http://www.tonymarston.net/php-mysq...everything.html and see if
you agree with my opinion or not.

Breaking Survey Into Seperate Parts?
I have a very long survey form with 4 different sections. Is there anyway with php to split this form into 4 popup windows so the person can click on the section they wish to fill out and when they are done, go back to the host survey form and continue on? I know there must be a way to do it, i'm just at a loss as to how i would pass the variables off? Cookies perhaps?

Breaking Up A Comma Seperated List
i have a list seperated by commas: 1. 3. 5. 7. 9 actually is a varible

$members ="1, 3, 5, 7, 9"; what would be the best way to break that up to insert the values into a table in a loop.

Breaking Up Text For Multiple Pages
I was recently put in charge of heading up my company's website, and
while I have a lot of experience on the design side of things, I'm
still very new to the programming side. When I started, the website had
just gotten a revision, but the site was an utter mess, so I've been
trying to fix it up. As I've gone along, I've learned some aspects of
PHP, but my knowledge is still very limited.

Here is the problem I'm trying to fix. A backend is used to enter
information into our MySQL database, and then a page template pulls it
out to make the page. For our reviews, the PHP coding currently breaks
up the review's text so that it can be places across multiple pages.
The problem is, the way the text breaking was set up, the end of one
page and the beginning of the next are totally chaotic, with breaks
often coming mid-sentence.

Here is what I'd love: other coding automatically puts an HTML break at
the end of paragraphs, and then another in the space between one
paragraph and the next. I'd love to have the code search for when those
double breaks come up, and then break up the text after, say, every
sixth pair of HTML breaks. I'd also like the option to break the text
myself by putting in some sort of text code in the original text. At
this point, though, anything that can make the breaks more elegant
would be a huge improvement.

I really appreciate any help anybody can give me in this one. Please
remember that I know very little of PHP, and I'm not much of a
programmer anyhow, so things that you may take for granted that people
would understand about PHP, I might not know.

I tried to pull out what I thought was the current coding for the text
break. Here it is. I'd also like to get rid of the part1/part2 factor.
Before, they had the text breaking to help in fitting into the layout
around an image, but I've fixed that so I no longer need the break. So,
that portion no longer needs to be a factor.

if ($page == ""){
$page = 1;
}
$no_letters = strlen($Game_Full_Story);
$times = ($no_letters / 3800) +1;
$Game_Full_Story = wordwrap($Game_Full_Story,3800,"*#^");
$Game_Full_Story = explode ("*#^", $Game_Full_Story);
$pages = array();
for ($i=0; $i<$times ; $i++){
$part[$i] = $Game_Full_Story[$i];
if ($i != 0){
array_push($pages, $i);
}
}
$page = $page-1;
$story = $part[$page];
if (strlen($story) < 460){
$parts1 = $story;
}else{
$story = wordwrap($story,460,"*#^");
$story = explode ("*#^", $story);
$parts1 = $story[0];
$count = count($story);
$parts2="";
for ($i=1; $i<$count; $i++){
$parts2 .=$story[$i];
$parts2 .=" ";
}
}

Breaking Up A String Into Individual Words
I have a text box that I will use to search a database. I would like
to use it so that it will not use a whole string (ie. 'red striped
top') but instead break it up into individual words (ie. 'red',
'striped', 'top') and maybe put it into and array. I will then use the
words in the array to search the database.

How do I break a string up this way?

Also, is this the most common way of creating a means of searching a
database?

Breaking Up The Query String Dynamicly?
using $Get_string = $_SERVER['QUERY_STRING']; to receive a query string such as
month=may&$day=15&year=2006

so that $Get_string = "month=may&$day=15&year=2006"

can I separate the values and turn them into variables? (like a normally would with a url get)

$month = "may"
$day= "15" etc

it would be great to just do $_GET on the url but I'm sending the string as a variable to another script... so i can't just go the easy route.

Breaking The BACK Button (Refresh Problem)
I have a php page which serves up multiple pages based on how the user
interacts with it - there are links on the first page that will reload (from
the same php file) a new page with form fields and submit buttons, and when
a user posts from that new page (or cancels), then the same php file is
again loaded, detecting how the user responded and generating the
appropriate html for whatever should be none next. All very typical.

What I want to know is, is there a way so that once a user has posted from
some submit button from one page (we'll say he Cancel's from a page that had
a form Cancel button so he returns to the original non-form default page
generated from the php file), can it be made so if the user then "refreshes"
the new page (hits the Refresh or Reload browser button) he does NOT get the
browser's "The page cannot be refreshed without resending the information.
Click Retry to send the information again, or click Cancel to return to the
page that you were trying to view." dialog? In other words, what I'd like is
a way to have the browser think that there was no posting done (even though
there was) once I've generated this certain 'home' page with my php code, so
that user ReLoad's of the page won't get this warning.

This is probably related also to problems I've had with "breaking the BACK
button" on sequences of php pages: if the user BACK's up to a page that was
generated by a post, it may not even be possible to regenerate the original
page.

Return Data Breaking Input Field
My return data is: (I have nothing to do with how the og person choose to input this)

<font color="#800080">CASE</font>

and I am setting the value of a input text form field equal to that return

$input      = "<input type="text" name="queOpt". $i ."" value="". $this->_queArr[$i] ."" />";

im lost on how to fix this. addslashes doesnt make sense  - maybe it is the double quote thing

PHP / Iframe
What I am looking to do is use php to embed an iframe of an external site in my webpage. The reason I am looking to use php to do this is because I was informed that I would need the functionality of php to be able to implement what I would like for the iframe to do.

Ok, so, getting down to it... What I am looking for is an iframe that I would be able to embed in my page, but one that will NOT show the header and/or possibly the footer of the site I am embedding. With this said, I would also like to see if it would be possible to have it auto login to the site before the page fully loads.

And last, but not least, I would like to see if it would be possible to take away all interaction with the site by my users. I would not like for the users of my site to be able to manipulate the embedded site of use it's features in any way... I am only showing them for educational purposes.

Get Value From Iframe
Am working with an iframe in Ajax window, But on submitting the form i am unable to get values in the iframe. I think this is a very basic thing. Anyone one please help me to pass the value from iframe to the parent window..

Session, Iframe And IE6
I am not getting session values of the parent page(or cannot start session) on a iframe. there is no problem when used with...  

1. IIS + windows + http + + php5 + IE/FF
2. APACHE + LINUX + https + php4 + FF  

but problem arises when using...  

1. APACHE + LINUX + https + php4 + IE6 can any one say how this can be solved?

Sessions Within Iframe?
Can sessions continue within an iframe?

Iframe Redirection
I have site where main content is shown in an iframe placed in the index. I'd like all files being open in that iframe. Well, I know how to do it: with a javascript that always call the index. The problem is that it obviously always shows the same page in the iframe. So I think I could solve this with php (all pages are .php), but I CAN'T CHANGE URLS, so I don't know how to do it. Any idea?

IFRAME Problem
I have a page called index.aspx and I am using an i-frame to call an external page called news.aspx. I am using include file for header, footer, left side , right side. Centre section of the page is defined by i-frame....

The issue is whenever I access another page, full page gets reloaded... I want only i-frame to get reloaded with out all page getting reloaded...How can I achieve this.. I know there is a technology called AJAX....

My i-frame changes in all pages....

<i-frame name="i-frameName" id="i-frameName" frameborder=0 src=news.aspx allowtransparency="true" width="100%" scrolling=auto  valign=top height="308"></i-frame>

IFrame Linking
I've just realised that this is probably a php question, so i might as will link it here:
http://forums.devshed.com/showthrea...7090#post177090

Linking Outside An IFrame
I have an iframe with a page and a link above it to the actual page. For eg :-

<div><a href="http://google.com">click here for original</a></div>
<iframe src="http://google.com" />

Now, as everyone knows, clicking a link inside this iframe will open the link in that frame too (unless specified). When a click is made i want to "click here for original" link to be changed too. To link to page that is showing inside the frame.

IFrame RSS News Script
I was looking for a script that syndicate rss news inside iframe. Sometimes it can be just automatic fetched URL (in a serial wise) from different sites and show them in your site in an iframe.

Here are few samples.

PHP Redirect With A Target IFRAME
I have a page with an IFRAME nested inside it and I've named the IFRAME name="interface". Is there a way to do a header REDIRECT and specify this target IFRAME within a page or maybe have PHP print the javascript window.location page and target the IFRAME?

Echo Cms Page Out Of An Iframe?
I have a cms system that allows users to add their own pages. The thing is, it adds the page link to the left and opens the page in an iframe. I do not want it to do this.
Is there anyway i can have the page just display within the normal page.. like an include?
This is the existing code: PHP Code:

HTTP_REFERER And Iframe Problem
I have three files:

url2.html - contains link to url1.html
url1.html - contains <iframe> tag to insert reftry.php
reftry.php - echoes HTTP_REFERER if set, echoes Direct otherwise

My problem is that when I click on url1.html from url2.html, I want reftry.php to display url2.html as the referer but its displaying Direct.

Password Protect Through Iframe
Basically I have 2 separate sites. On site 1, I have index.htm which has an iframe that links to content.php on site 2.

Site 1 is password protected.  What I'm trying to do is only access to content.php on site 2 only if you are logged into site 1.  Currently if you go to content.php it by passes site 1 and allows access.  I'd want it to redirect to site 1 and ask the user to login, and also only open content.php in the iframe.

Setting Session From Within Iframe?
This php page has a session _start call in it. The problem is, the session cookie is not set when the php is called into an...

Passing Variables Through An Iframe
is there a way to pass variables through n iframe?

Page Reload With An <iframe>
Let me to explain the structure....

filename : api.php

Having an <iframe src="remotehost/index.php"> </iframe>

i have to reload current page api.php after some execution of remotehost/index.php ... I've tried header(); but got formal header error. can we reload current browser url from an iframed code?

Refresh The Contents Of The Iframe
i was trying to display a text (read from a mysql db) on a frame (iframe). But it only displays an old data evenif i update the db. How can i modify it so that i can display the new updated text read from the database. here is the code that fetchs the data from the database.. it is saved by the name message.php Code:

Lightbox Iframe > Include
I'm having some problems with this script I downloaded called lightbox and I was really hoping someone here could help my with them. I expect most of you know this script by name. I found a version on a german website that doesn't only create the fancy pants visual effects but also creates thumbnails and tables by itself!

The problem is the script comes with a page called index.html that has an <iframe> code in it to link to a page called pics.php which has al the code for the gallery in it. This is a problem because my site is mostly php, and I don't like working with iframe.

So I decided to use the include command to call on the pics.php file instead of using an iframe. This is where it gets tricky. The page shows up with the pictures all right, but the animation from lightbox doesn't execute!

Are there any known differences between iframes and include that I should know about? Heres an idea of what I mean, this is what the page looks like with the iframe: Code:

Carrying A Variable Over To An Iframe.
<iframe src="http://www.site.com/page.php?id=000017" frameborder="0" scrolling="no" height="290" width="310"></iframe>

I get the 000017 in there with a variable, and in the code it shows up correctly - but for some reason the iframe does not pull it up. Any idea why?

Page Back Into Index's Iframe
On my index, I have a menu on the left with the rest of the page an iframe.How would I reinsert any pages found on the internet back into the index's iframe using php?

Iframe IE Javascript Onload Problem
I have a php generated HTML page, which has a javascript call in the
body tag:

<body onunload="exitPage()" onload="setWidth()" onresize="setWidth()">

In certain cases, there can be an iframe in the page:
<iframe src="/secure/download.php?dl_file=test.txt" style="display:
none" />

This technique has been mentioned by Chung Leong in several posts to
open a file save dialog in the browser (and load the HTML page at the
same time .. 2 HTTP requests).

The problem is:

in Firefox, all works fine, the page loads, the javascript setWidth is
called for onload, and the file dialog appears.
but,
In IE 6, the file dialog shows, but the javascript onload event is
never triggered.

Can anyone help please. Am I missing something here? Any way to get
around this problem in IE?

Page Load Time + Iframe
There is any way to get the total load time of a page when you get an
"IFRAME" on it?
In all the tests, I got only the base page time without the "IFRAME"
time....

<?php
$bench = new phpCounter();
$bench->StartCouter();

$page = "<iframe class=......";
echo $page;

$bench->EndCounter();

echo $bench->GetCounter();
?>

Where:
// StartCounter() & EndCounter() call this function
function SetCounter ( ) // {{{
{

list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);

} // }}}

// Function to return the counter
function GetCounter ( ) // {{{
{

$output = ($this->end - $this->start);
return substr($output, 0, 5);

} // }}}

File Upload Action To Iframe
I have tried uploading a file using the code as

//--------------------------------------------------------
// Main File

<form action="importaction.php" enctype="multipart/form-data"
method="post" target="targetupload">

<input type="file" name="fileimpcsv" id="fileimpcsv">

<input type="submit" name="subfileimpcsv" id="subfileimpcsv"
value="Import">

</form>

<iframe id='targetupload' name='targetupload' scrolling="auto"
frameborder="0" height="0"
src='ifimportaction.php'></iframe>

//--------------------------------------------------------

In the file ifimportaction.php, there is the code to get the POST,
FILES vars and upload the file.

And show the javascript alert after the file is uploaded. (Alert
message at the end of the file ifimportaction.php)

It's working perfectly for Firefox (tested in v2.0). But for IE (v6),
it's not working.

After I click the submit button, it's stay there only. If I remove all
the code from the ifimportaction.php and only print time(), (after
changing targetupload height to say 50), there is no change in the
values being displayed i.e., action is not going to that frame.

How can I upload the file in IE, so that page is not reloaded.

Saving The Contents Of Iframe In The Database
I have a database in mysql in which i have stored html files having the following columns
fileid,filetype,filedata(contents of the html file). i am uploading and downloading these files to and from the database it's working fine. i too have the code where i am modifying these files through the iframe.

iam saving the contents of the iframe through a javascript function. now i want to update these contents to the blob field in mysql database (column name:filedata). how can this be done. Below is the code for saving the contents to the iframe Code:

Multiple Forms In One Iframe Container
I have one container page "container.htm"
In this container I have multiple iframes "iframepage1.htm",
"iframepage2.htm", etc. and one button firing a js script to submit.
In every iframe page I have multiple input fields.
In the container page I have one iframe page to display results
"'iframeresults.htm".
How can I send all the values of the input fields to one server page
"process.php" where calculations are done and the results are send to the
updated iframe result page?
Let's take a simple example:
in "iframepage1.htm" I put the value 5
in "iframepage2.htm", I put the value 2
with the submit button I will send both input values to the server page
"calc.php" where we calculate the result =10
This result is then send to the iframe result page "'iframeresults.htm" in
the container "container.htm"and is updated.

Iframe Causing 2 Scroll Bars
used iframe to remove frames. Now problem is that its showing 2 scroll bars for some pages calling data from yahoo store. Now, i need to get one scroll bar. I increased the size but it effects all the pages. Now other pages are showing lot of blank spage at the bottom.

Is there any way to resolve it by using any script or any other technique...

The Iframe Does Not Display The Updated Data
i have an iframe that will allow users to type and edit texts like a text editor. When i try to add some data, it works fine. but the iframe does not update itself when i try to view the data inserted. it displays an old data that has been there before the update. Here is the code for the iframe:

Php Running Inside An Iframe And Session Data And IE
I have a php app running inside an iframe. I pass a piece of info to this iframe through http parameters, php gets it and then set it in the session.  However, the session data is lost when I read it from another php page within the same php application. Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved