Jump to content

coljung

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by coljung

  1. i installed xampp.

    [quote]Its not possible from the code you have supplied to say whether the $text variables are either an array or part of the database.

    There is no association between $text and data in your database.  There would be a couple of lines in there after the database connection and database selection to select data. Something like:-

    $somequery = "Select......";
    $somequeryresult("$somequery");
    $text = mysql_fetch_array($somequeryresult);

    to give an indication that the $text variables contain your database records.

    Nor is there an association between $text and it being an array containing data.  There is no array initialisation.  Something like:-

    $text = array($variable1, $variable2,.....$variableN)).

    Quite frankly it doesnt look like the $text values do anything at all.

    What does this code do when you run it?  You have included a screen grab of what the page is supposed to look like when viewed in a browser but from the code you've posted I just dont see how the code and output match up.[/quote]

    The screen grab is what results from the code.

    for example [b]=$TEXT['cds-head'] [/b] shows as [b]CD Collection (Example for PHP+MySQL+PDF Class)[/b]

    What I think is that $TEXT is some kind of global array. Going though some of the files, I found several instances of $TEXT['  '], i just haven't been able to find where the array is taking the information from. And i don't think it is the database because i checked it an in this case it has only one table with 4 fields.

    It does look as it has been initialized somewhere else, in this case the filename is cds.php and the $TEXT values are ['cds-head'], ['cds-text1']....., and i have another file called biorythim.php which is another example and there's also some $TEXT values like ['bio-head'], ['bio-ok'].

    I used to program in ASP and there were session variables, im wondering if $TEXT is something like that .

    anyways thanks for the help.

  2. thanks for the fast replies.

    now, my specific question is what is :
    =$TEXT['[b]cds-head[/b]']
    =$TEXT['[b]cds-text1[/b]']
    =$TEXT['[b]cds-text2[/b]']

    in this case is not relevant if its an array of if the code isn't doing anything useful but im wondering is where is the value of that coming from.

    why [i]'cds-head'[/i] shows as [i]CD Collection (Example for PHP+MySQL+PDF Class)[/i] for example

    is cds-head part of the database ?
    where was the info added into the array ?
  3. well i'm kinda new to php but not to programming.
    i just installed a server package on my pc ( apache, php, mysql, etc.... ) and it comes with some examples, one of them is about retrieving some data from a database, i understand most of whats going on except for a few lines that retrieve some info which i have NO idea where it's coming from.

    here is the code from the file:
    [code]<html>
    <head>
    <title>apachefriends.org cd collection</title>
    <link href="xampp.css" rel="stylesheet" type="text/css">
    </head>

    <body>

    &nbsp;<p>
    <h1><?=$TEXT['cds-head']?></h1>

    <?=$TEXT['cds-text1']?><p>
    <?=$TEXT['cds-text2']?><p>

    <?

    if(!mysql_connect("localhost","root","######"))
    {
    echo "<h2>".$TEXT['cds-error']."</h2>";
    die();
    }
    mysql_select_db("cdcol");
    ?>

    <h2><?=$TEXT['cds-head1']?></h2>

    <table border=0 cellpadding=0 cellspacing=0>
    <tr bgcolor=#f87820>
    <td><img src=img/blank.gif width=10 height=25></td>
    <td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?=$TEXT['cds-attrib1']?></b></td>
    <td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?=$TEXT['cds-attrib2']?></b></td>
    <td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?=$TEXT['cds-attrib3']?></b></td>
    <td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?=$TEXT['cds-attrib4']?></b></td>
    <td><img src=img/blank.gif width=10 height=25></td>
    </tr>

    [/code]

    What is [b]=$TEXT['cds-head']?[/b] doing for example ???

    i know that i retrieve the info from the database through [b]mysql_select_db("cdcol");[/b]

    but what are all the =$TEXT[ ]  mean ?

    the page looks like this : 
    [img]http://img147.imageshack.us/img147/3663/questionphpbp6.jpg[/img]

    As you can see,

    =$TEXT['cds-head'] = CD Collection (Example for PHP+MySQL+PDF Class)
    =$TEXT['cds-text1'] = A very simple CD programm.
    =$TEXT['cds-text2'] = CD list as PDF document.

    my question is, where did this words came from ?

    i've been the whole day trying to understand that part of the code but im unable to figure it out.

    thanks in advance for the help.

    ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.