Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 09-03-2005, 07:08 PM   #1
Member (8 bit)
 
rfleming's Avatar
 
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?
rfleming is offline   Reply With Quote
Old 09-03-2005, 07:30 PM   #2
Wx geek
 
blue60007's Avatar
 
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>
blue60007 is offline   Reply With Quote
Old 09-03-2005, 07:47 PM   #3
Member (8 bit)
 
rfleming's Avatar
 
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
thanks worked great. Only one more question, how would i do that with a form?
rfleming is offline   Reply With Quote
Old 09-03-2005, 09:04 PM   #4
Member (8 bit)
 
rfleming's Avatar
 
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
I figured it out with forums, same way thank you
rfleming is offline   Reply With Quote
Old 09-03-2005, 09:42 PM   #5
Member (8 bit)
 
rfleming's Avatar
 
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?
rfleming is offline   Reply With Quote
Old 09-03-2005, 09:56 PM   #6
Wx geek
 
blue60007's Avatar
 
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
Quote:
Originally Posted by rfleming
Problem i just came across. $_POST[] doesnt work between the pages now that i changed it. What is the easiest way to fix it?
In PHP?
blue60007 is offline   Reply With Quote
Old 09-03-2005, 10:17 PM   #7
Member (8 bit)
 
rfleming's Avatar
 
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
yes
rfleming is offline   Reply With Quote
Old 09-03-2005, 10:37 PM   #8
Wx geek
 
blue60007's Avatar
 
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.
blue60007 is offline   Reply With Quote
Old 09-03-2005, 10:43 PM   #9
Member (8 bit)
 
rfleming's Avatar
 
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.
rfleming is offline   Reply With Quote
Old 09-03-2005, 10:48 PM   #10
Wx geek
 
blue60007's Avatar
 
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";
}
blue60007 is offline   Reply With Quote
Old 09-03-2005, 10:53 PM   #11
Member (8 bit)
 
rfleming's Avatar
 
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 "".
rfleming is offline   Reply With Quote
Old 09-03-2005, 11:04 PM   #12
Wx geek
 
blue60007's Avatar
 
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 . ">\"";
Then you can gather the page name in the resulting page:

Code:
if($_GET['page'] == 'home')
{
 //redirect to proper page

}
Like I said I'm no expert and its late at night.
blue60007 is offline   Reply With Quote
Old 09-04-2005, 10:13 PM   #13
Member (8 bit)
 
rfleming's Avatar
 
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?
rfleming is offline   Reply With Quote
Old 09-05-2005, 12:12 AM   #14
Wx geek
 
blue60007's Avatar
 
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?
blue60007 is offline   Reply With Quote
Old 09-05-2005, 10:47 AM   #15
Member (8 bit)
 
rfleming's Avatar
 
Join Date: Apr 2004
Location: Rhode Island
Posts: 229
More or less it is what i trying to do.
rfleming is offline   Reply With Quote
Old 09-05-2005, 11:33 AM   #16
Wx geek
 
blue60007's Avatar
 
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>";
Shouldn't that take you to where you want to go?

Last edited by blue60007; 09-05-2005 at 11:36 AM.
blue60007 is offline   Reply With Quote
Old 09-05-2005, 01:10 PM   #17
Member (8 bit)
 
rfleming's Avatar
 
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
}
rfleming is offline   Reply With Quote
Old 09-05-2005, 03:38 PM   #18
Wx geek
 
blue60007's Avatar
 
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?
blue60007 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:57 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2