|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
Iframe help
On my site, i currently use an iframe to load a page in the middle of a menu. The menu called the page and loads it in the iframe. Now my problem is, if i click on a link inside the iframe it stays in the iframe instead of reloading the page. Is there any way to get the links in the iframe to open in the whole window?
|
|
|
|
|
|
#2 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Add the attribute: target = "_parent" to your link, so an example:
<a href = "http://www.pcmech.com" target = "_parent">PC Mech</a> |
|
|
|
|
|
#3 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
thanks worked great. Only one more question, how would i do that with a form?
|
|
|
|
|
|
#4 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
I figured it out with forums, same way
thank you
|
|
|
|
|
|
#5 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
Problem i just came across. $_POST[] doesnt work between the pages now that i changed it. What is the easiest way to fix it?
|
|
|
|
|
|
#6 | |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
yes
|
|
|
|
|
|
#8 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Can I see your code thus far? I'm not really sure what you're trying to do. Frames aren't the best way to go after whatever you are going after.
|
|
|
|
|
|
#9 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
The current site i am working on is a text based video game. The current set up we use makes a nav menu and creates an iframe in the middle of whatever page you wish to view.
the sites home page is elvyn.boochinkatfish.com if you ment to see the code itself, i will pm it to you. |
|
|
|
|
|
#10 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
You can do this:
<form method="POST" action="post.php" target="_parent"> But I'm sure you have that. Is this what you're having problems? Code:
if($_POST['submit'])
{
echo "Hello";
}
|
|
|
|
|
|
#11 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
sorry if i wasnt overly clear, here is the basics of how links work in game. I clink on a link, all links are directed to index3.php. Now each link has a name page something. so each link is index.php?page=home for example. Now index3.php takes the page var adds .php and displays it in an iframe. I use $_POST several time in home. For some reason the posts in home all equal "".
|
|
|
|
|
|
#12 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
I'm no expert at PHP, but is it possible to set a variable, such as:
Code:
$page = home; echo "<a href=\"index.php?page=" . $page . ">\""; Code:
if($_GET['page'] == 'home')
{
//redirect to proper page
}
|
|
|
|
|
|
#13 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
the way we have it set up is so we dont have to code the nav menu onto every page. We load the iframe inside the nav menus middle table. Should i ask in the web section?
|
|
|
|
|
|
#14 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
I know what you're trying to do. This is the web section.
So you have an iframe, which loads the home page. On the home page, you have some buttons that link to say "page1". You want it to go to: index.php?page=page1 Is that what you're trying to do that isn't working? |
|
|
|
|
|
#15 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
More or less it is what i trying to do.
|
|
|
|
|
|
#16 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Code:
echo "<FORM METHOD='LINK' ACTION='index.php?page=page1'> <INPUT TYPE="submit" VALUE="Clickable Button"> </FORM>"; Last edited by blue60007; 09-05-2005 at 11:36 AM. |
|
|
|
|
|
#17 |
|
Member (8 bit)
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
|
the current issue is i use if ($_POST[var1] == "something" ) display a certian part of the page, else display a different part
Code:
if ( $_POST[attack] == "attack" )
{
//run attack code
}
else
{
//show user info
//show form to set up attack
}
|
|
|
|
|
|
#18 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
OK, I think I see where your problem comes about, but since I'm no PHP expert, I really don't know what to tell you. Anyone else here know PHP?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|