Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    Hastings, East Sussex, UK
    Posts
    34
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Displaying output from html within page frame

    I am fairly new to programming and I want to run a html script within the page frame area that I have created for all of the pages on my website.

    The Page Frame is defined with CSS. I have tried putting a link to run the script on the page frame, but it opens into a new window full screen.

    The script also opens a php script, which I want to confine to this page frame.

    I have tried using frameset which does almost mimic the page frame, but it does not look consistant with the rest of my site.

    I would appreciate any suggestions on how I can achieve what I am aiming for.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You use the term "frame".
    Do you mean you have a <div> ... </div> section on your page?

    Say you have one main page, you'll call it "index.php". (note the .php extension).
    That is the default page that gets displayed when someone visits your site.
    Consider it like a template. All pages use the same "index.php" script, but the
    contents change accordingly.

    In your directory, you have other files saved ... like p1.php, p2.php .. these are
    different pages of text,html, etc. that you want displayed on your main page.

    On your main page, you determine which "other file" to stick within the <div>...</div> area.

    An example of using PHP to dynamically place information on your page ...
    If your site is called "mysite.com" ... going to that will display your main page.
    If they use a link like "mysite.com/?p=3" it will display the main page, but
    the contents of file p3.php will be placed in the <div>...</div> section.

    Look at the URL on this page you're reading now (codingforums). You'll see
    coding like ?t=251402 ... that variable is used by the PHP script to know which
    thread to display. No matter what thread you view, it's using the same PHP
    script, but changing the content on the page.

    .

  • Users who have thanked mlseim for this post:

    rockyhudson (02-13-2012)

  • #3
    New Coder
    Join Date
    Jan 2012
    Location
    Hastings, East Sussex, UK
    Posts
    34
    Thanks
    21
    Thanked 0 Times in 0 Posts
    I'm not sure that I have explained the problem very well.
    Below is the part of the css script that is difined as 'page box class in the html script.

    css part script:
    Code:
    div#e18             {
    	font            : 16px 'Arial', Helvetica, sans-serif;
    	text-align      : left;
    	background-color: transparent;
    	background-image: url(images/hatch_v4.jpg);
    	position        : absolute;
    	left            : 0px;
    	top             : 182px;
    	width           : 1019px;
    	height          : 585px;
    	}
    html part script:
    Code:
    <div id="e18" class="page_box"></div>
    I always want the output to display within this area leaving the header logo and navigation tabs available to use once the scripts that have been actioned or the user decides to abort the script. As I mentioned before I have an html script that then triggers a php script, which outputs a pdf document for printing. Once printed the user may want to go on to use another part of my site, I want the navigation tabs to be available at any time.
    Do you get want I am trying to do?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,676
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    You may wanna embed the PDF with the <object> element (http://joliclic.free.fr/html/object-tag/en/index.php). I don’t know how reliable printing from that window would work, though.

  • #5
    New Coder
    Join Date
    Jan 2012
    Location
    Hastings, East Sussex, UK
    Posts
    34
    Thanks
    21
    Thanked 0 Times in 0 Posts
    The PDF output is working OK!
    I am using FPDF which converts the output from MySQL into printable text.

    My problem is that when you go into the scripts that I have written to use this, it does not look consistant with the rest of my site.

    I have tried using frameset to mimic the other web pages, but when I put the navigation tabs in a separate frame the resulting output when a link is chosen also opens in the frame. Is there a way of opening the link in a different frame to what it is actioned in?

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Yes, using "target".

    I don't follow the part about the other scripts that use it don't look like the rest of your site.

    Can you show us what you mean?
    If everything is your website, why would it not look the same?
    Or are you putting external websites (someone else's site) inside your frames?

  • #7
    New Coder
    Join Date
    Jan 2012
    Location
    Hastings, East Sussex, UK
    Posts
    34
    Thanks
    21
    Thanked 0 Times in 0 Posts
    Hi

    Managed to figure out what you said about target on the w3 site.

    What I meant was that I wanted all of the content of the pages to display in the same area on the screen and all of the navigation tabs to be on each page. I have used the frameset tag and named each frame e.g. frame1 etc and used target to display in the correct frame.

    Thanks for your help once again!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •