PHP newbie, help please! Opening new page in specified frame

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gpig
Forum Newbie
Posts: 15
Joined: Sat Apr 17, 2004 2:52 am

PHP newbie, help please! Opening new page in specified frame

Post by gpig »

I dont know anything about PHP and really want to get started with it. I know ASPX, but hate it...and now I have some work to do on a website that only supports PHP.

So here is my problem, very simple actually,
When I click a link in the homepage, I need to open a new page with the html onclick event. The new page will have a default top frame with the company logo and a link back to the homepage. There will be a mainframe where I have to open the link...
My guess is that Ill have to send this page a queystring, catch the variables and open it. Problem is, I dont know anything about PHP, zero...I dont even know how to call a PHP page from html.

I will really appreciate help concerning this problem, Thanx!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Well, this is not entirely a PHP question as it's more a html thing.

If you have two frames, and one of them contains:

Code: Select all

<?php
 echo '<a target="PAGE" href="foo.php">Foo</a>';
?>
...clicking the Foo link will open the foo.php script/page using the target="PAGE" attribute.

You will likely find some more information here: viewtopic.php?t=1030
gpig
Forum Newbie
Posts: 15
Joined: Sat Apr 17, 2004 2:52 am

Post by gpig »

I actually have to open a new window and leave the old one open, so my link is already targeting a _new window. I need a way to send the new window info and the new page should determine what to open, I usually use a querystring and capture the variable when using aspx.

The new page need the company logo at the top and the info of the companies partners products in the main frame, the partners supplied URLs which mostly points to CGI scripts on their side.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

You might think of $_GET. $_GET is used to capture the URI's querystring ( http://example.com/index.php?something=foo&else=bar )

But that is also mentioned in the link I posted above... If that's still not the thing youre looking for let me/us know.
gpig
Forum Newbie
Posts: 15
Joined: Sat Apr 17, 2004 2:52 am

Post by gpig »

Can someone please check th link above, I get a 404, Thanx

How can I open a page with a variable, var, in this example? Or do I have to use some PHP function?
<?php
echo '<a target="PAGE" href="foo.php">Foo</a>';
?>
thanx
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

echo "<a target=\"PAGE\" href=\"foo.php\">Foo</a>";
gpig
Forum Newbie
Posts: 15
Joined: Sat Apr 17, 2004 2:52 am

Post by gpig »

<a target="_new" href="newpage.php?var=´newpage.html´">page to be displayed in new pages main frame</a>'

then what do I do in newpage.php to catch it and display it in the main frame?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

header("Location: $_GET[var]");
gpig
Forum Newbie
Posts: 15
Joined: Sat Apr 17, 2004 2:52 am

Post by gpig »

aha! Thanks alot guys!
Post Reply