Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

display 2 pages in 1 page

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

display 2 pages in 1 page

Postby DigitalRice » Fri Jun 27, 2003 11:37 pm

hi all,
i'm wondering that is there such a thing of displaying two different pages in one page without losing the content of the first page.

for example:

------------------------------------------
main.php:

i'm in page 1 right now. <a href="page2.php">click me</a>

page2.php

this is the content of page 2...

-------------------------------------------


when i execute main.php, and click on the link "click me", i want it to display the content in the main.php as:


i'm in page 1 right now. <a href="page2.php">click me</a>
this is the content of page 2...


is there such a way?

Thanks
DigitalRice
New php-forum User
New php-forum User
 
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm

Postby liquedus » Sat Jun 28, 2003 4:29 am

i think what you need to look into is frames...

hope that helps! :)
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby DigitalRice » Sat Jun 28, 2003 7:53 am

yes, frameset works, but i'm trying to avoid using frames,
is there any other way?
DigitalRice
New php-forum User
New php-forum User
 
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm

Postby liquedus » Sat Jun 28, 2003 3:03 pm

2 layers with setting each innerHTML to whatever, tho I am really not sure about this solution. Frames is the only method that works 99%....
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Inserts

Postby ruturajv » Sat Jun 28, 2003 9:34 pm

Try using querystring to get the page url
:idea: :idea:
and on the main page
Code: Select all
switch case ($_GET['url'])
{
 case 'url1':
  include('url1.php');
  break;
 case 'url2':
  include('url2.php');
  break;
default:
  include('defaulturl.php');
    break;
}


Hope this helps :D

And try avoid writing any thing to the page before this code
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby DigitalRice » Mon Jun 30, 2003 7:37 pm

thanks ruturajv
you're very helpful.
DigitalRice
New php-forum User
New php-forum User
 
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron