Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2003, 09:01 AM
Authorized User
 
Join Date: Sep 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vb_programmer Send a message via Yahoo to vb_programmer
Default Need Help ...

Hello to All Forum Members ;

In my Webdesign , I have used Inline Frame to show my linked webpages. The Problem is , when I give link to say Page1.htm which in regular case from within my website is shown correctly in Frame , otherwise from outside of website is shown as a separate page.

What I want to do is , I'll provide a link such that it will launch the HomePage which contains the Inline Frame and then will launch the required page within it.

I have seen many links which look like ...

http://www.mywebsite.com/index.asp?p=1

or something like this. I don't have ASP support on my webserver. I don't know at all about PHP programming but I have told that PHP will solve my problem.

Can anybody please guide me how to get this functionality ??

Eagerly waiting for your reply ...

Ruturaj.

 
Old November 4th, 2003, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PHP is a scripting language that facilitates generating web pages using user input (via forms or URL parameters) and data stored in databases or files.

Your frame-happy links should probably look like:

http://www.yoursite.com/index.php?ur...herpage.com%2F

You run www.yoursite.com, and you want an inner frame to display http://www.otherpage.com/

Your index.php would GENERATE the correct frameset that would load http://www.otherpage.com/ in it's inner frame.

There are LOTS and LOTS of intro tutorials for PHP. I suggest starting with the homepage and manual:
  http://www.php.net/
  http://www.php.net/manual


At it's simplest, your index.php page would look like this:

<html>
<head>...</head>
<frameset>
   ... your frames here ...

<?php
echo ' <frame src="' . url_decode($_GET['url']) . '">';
?>
</frameset>
</html>


Keep in mind that, as with any programming languages, there are a lot more things to learn about PHP before you start using it in a production site. The example above is merely my way of showing you how one might START solving this problem, but it is by no means close to a "finished" secure solution.


Take care,

Nik
http://www.bigaction.org/
 
Old November 4th, 2003, 11:16 PM
Authorized User
 
Join Date: Sep 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vb_programmer Send a message via Yahoo to vb_programmer
Default

Thanks for your reply ...

Well , The frameset is not the one as you have considered. It is iFrame that is Inline Frame. Still , your description has helped me to go where from this point now ...

I have one confusion though. I was thinking like there will be some parameter to be passed to Index Page PHP program which will be the URL of the desired page itself. Then it will make iframe.src = url and this will load the page in the iFrame.

I'll go through the tutorials and manuals you have suggested. Still , I don't think at the moment I have much time to learn and then implement it if that's so hard to implement because the work is to be completed in time.

Is there any ready solution which may solve this problem ?

(actually one programmer shouldn't ask this to other programmer :( but time limit is the factor ; sorry for asking the ready solution.)

 
Old November 5th, 2003, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As far as I know, there isn't an already-written solution that does exactly what you want, but again, it seems pretty simple.

You can use the code I've given you in my example to play with things. Variables passed in the URL are available to PHP via the $_GET array. The name of the variable is the string index into the array, and the value of the variable is the value of that index.

For example: Suppose you have this URL:
   some_host.com/some_page.php?get_variable=my_value

The script, some_page.php, can access the URL query parameter like this:

$_GET['get_variable']

The value of this array index is 'my_value'.



Take care,

Nik
http://www.bigaction.org/
 
Old November 11th, 2003, 10:58 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My website uses i-frames everywhere.

I have this:

 Header and side panel stuff?>

    <IFRAME FRAMEBORDER=0 SRC="http://www.YourDomain.com/YourWebPage.htm" WIDTH=632 HEIGHT=1200></IFRAME></P>

<?php footer stuff?>

You can take a look at www.providencecards.com
it is free. This is my practice site.
I am learning php and other programming.
I just wrote an automated I-Ching program and I used the I-frame so that I don't have a typo in all the other stuff.
I also have a program on Providence cards which is an ancient Mathematical way of checking any relationship. I used the i-frame with that also. My stuff is rather simple but the i-frame is working quite nicely. I am not an expert so I am giving you what is working for me.

riv









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.