Results 1 to 3 of 3

Thread: How to php get file

  1. #1
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question How to php get file

    Ok I am working on a template for my template I need to be able to change the body to different things without having to reload the whole template over and over again so I have it designed to do exactly that.

    One problem though

    I need to figure out how to use PHP to be able to get a html/txt document/file and place it in the template when I click on a button

    for example

    <html>
    <head>

    <title></title>
    <css />

    </head>
    <body>
    <div>Some PHP here to import stuff here from separate file</div>
    <button />
    </body>
    </html>

    Ok here is exactly what I'm working with

    function windowOpen() {

    document.styleSheets[9].disabled = false;
    document.getElementById("bodyInnerDiv").innerHTML = '';
    e.style.filter = "alpha(opacity=" + (0*100) + ")";
    e.style.opacity = 0;

    si = setInterval(function() {

    io+=0.05;

    e.style.filter = "alpha(opacity=" + (io*100) + ")";
    e.style.opacity = io;

    }, 100);

    io = 0;

    }

    function openDocs() {

    windowOpen();
    document.getElementById("windowDiv").innerHTML = '<input type="button" value="X" id="XButtonId" class="XButtonClass" onclick="showDesktop()" /> ' + userName + '\'s Documents<hr /><span class="bodyClass">Documents YAY!!!<?php$ file=fopen("test.txt","r"); ?></span>';

    }

    http://opentech.durhamcollege.ca/~in...ittains/haley/

    What would be a script for that and what would it be called? I'm not very good with PHP I'm more of a javascript kinda guy (I've never needed a database before) but I'm trying to go a little further on a personal project and implement some AJAX ideas

    So any help anyone?

    Thanks
    Shelby
    Last edited by MrEnder; 01-25-2010 at 09:07 PM.

  2. #2
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Ok I found this

    <html>
    <body>

    <div class="leftmenu">
    <?php include("menu.php"); ?>
    </div>

    <h1>Welcome to my home page.</h1>
    <p>Some text.</p>

    </body>
    </html>

    I've seen lots of examples of it I have PHP on my PC and my Server I'm running it through apache but even that does not want to work =[

    I'm so confused =[

  3. #3
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Ok awesome I figured it out ^.^

    I needed to name both files .php for php to work ^.^

Bookmarks

Posting Permissions

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