Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IFRAMES / PHP/ Javascript (Call to Code Gods)

Status
Not open for further replies.

sschuller

Programmer
Jan 21, 2005
2
US
I'm trying to do the following:

Start.php loads with an inline frame embedded in it that calls 1.htm.

The user clicks on a link on 1.htm which takes them to 2.htm within the inline frame.

Then the user clicks on an 'edit' button in a form located on start.php which sends the current URL of the inline frame (2.htm) as a variable.

***

So my code on start.php looks something like this:

$Submit=$_POST['Submit'];

if ($Submit!=="Edit"){
echo"<IFRAME NAME=screen SRC=\"$source\" width=800 height=400>
</IFRAME>";
} else if ($Submit=='Edit'){
echo"<IFRAME NAME=screen SRC=\"$newsource\" width=800 height=400>
</IFRAME>";
}


The form looks like this:
<script language='Javascript1.1'>
var screenurl=document.getElementById('screen').src;
document.write ('<form action=start.php?source='+screenurl+' method=post><input type=submit name=Submit value=Edit></form>');
</script>


When the page first loads I pass the $source variable the starting page URL (1.htm). Then when I click on a link on 1.htm (within the inline frame) and it goes to 2.htm and I click on the Edit button I would expect the URL to have start.php?source=2.htm in it, but it doesn't - it just keeps the same variable for source (1.htm).

The app is running here:
id: guest
pwd: guest


I have no idea if this will make sense to anyone... but if it does - HELP!! :S

Thanks!
Sherry
 
Ooops. Forgot - I took out the if statement

Top just reads:
$Edit=$_POST['Edit'];
echo "edit: $Edit <BR> my source: $source<BR>";

echo"<IFRAME NAME=screen SRC=\"$source\" width=800 height=400>
</IFRAME>";
 
Has this been solved?

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top