Page 1 of 1

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

Posted: Sat Apr 17, 2004 2:52 am
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!

Posted: Sat Apr 17, 2004 4:28 am
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

Posted: Sat Apr 17, 2004 10:52 am
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.

Posted: Sat Apr 17, 2004 11:14 am
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.

Posted: Sat Apr 17, 2004 12:46 pm
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

Posted: Sat Apr 17, 2004 1:28 pm
by tim
echo "<a target=\"PAGE\" href=\"foo.php\">Foo</a>";

Posted: Sat Apr 17, 2004 3:17 pm
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?

Posted: Sat Apr 17, 2004 4:03 pm
by feyd
header("Location: $_GET[var]");

Posted: Sun Apr 18, 2004 1:36 am
by gpig
aha! Thanks alot guys!