PHP crew: question for ya

Discussion in 'OT Technology' started by brds, Mar 10, 2007.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    Trying to make a html file with php code in it. Need it to read in a text file and output the findings in a table... I have some code that makes logical sense to me... just doesn't work. Here's the code:

    form can be found at:
    http://otbuddy.com/maint/maintenance.html

    that outputs to the php file at:
    http://otbuddy.com/maint/users.php

    that writes to the txt file at:
    http://otbuddy.com/maint/users.txt

    and then allusers.html tries to read that at:
    http://otbuddy.com/maint/allusers.html
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    the extension must be .php to be ran through the parser... So change your file extension, first of all.
     
  3. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    okay, did that now. Found a table to parse converter and it's asking for a "document root" on the server... i have no idea what that means... here's the code:

    require_once($_SERVER['DOCUMENT_ROOT'] . '/../global.conf.php');
    require_once($APP['path']['core'] . 'html/Bs_HtmlTable.class.php');


    Any more help would be appreciated
     
  4. Tk

    Tk Well-Known Member

    Joined:
    Dec 23, 2001
    Messages:
    23,075
    Likes Received:
    281
    Location:
    nw iowa
    i'm learning php still, but i believe it goes like this:


    Code:
    
     echo "
     <tr>
     <td>" . $Name . "</td>
     <td>" . $Phone . "</td>
     <td>" . $Email . "</td>
     <td>" . $Building . "</td>
     <td>" . $Office . "</td>
     <td>" . $OS . "</td>
     <td>" . $IP . "</td>
     <td>" . $macid . "</td>
     </tr>
     ";
    
    
     
  5. Tk

    Tk Well-Known Member

    Joined:
    Dec 23, 2001
    Messages:
    23,075
    Likes Received:
    281
    Location:
    nw iowa
  6. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    Holy hell that worked... i seriously *thought* i tried that like 1000 different times in 50000 different ways... thanks!
     
  7. Tk

    Tk Well-Known Member

    Joined:
    Dec 23, 2001
    Messages:
    23,075
    Likes Received:
    281
    Location:
    nw iowa
    killer man..... ha, i thought i fucked it up and looked like a dumbshit.... as i said, im learning the language as well.



    :cool:
     
  8. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    any way to center those elements... the $Name, $Phone, etc...??? tried doing a simple <center> but it flipped out on me....
     
  9. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    Did you center inside each cell, not the whole table? i.e. "<td><center>$Name</center></td>"

    BTW, when you use double quotes for strings, you can put variables inside, and they will get evaluated.

    Code:
    $test = 1;
    echo 'this is a $test';  // will print 'this is a $test'
    echo "this is a $test"; // will print 'this is a 1'
    
     
  10. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    I think this will center
    Code:
    <td align="center">" blah "<td>
    
     

Share This Page