SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Enthusiast XploreR's Avatar
    Join Date
    May 2001
    Location
    Singapore
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi again, Need some help with global variables. The coding below is used with PHPLib templates too. I read up on the manual and found that it wasn't the same as in C. But here's what i came up with, which also didn't work. Help Appreciated! Also can i use the global variables in the set_var statement for PHPLIb too?

    Code

    <?
    include("/home/xiccc/www/db_mysql.php");
    $db = New DB_SQL;
    include("/home/xiccc/www/templates/template.inc");
    $t = new Template("/home/xiccc/www/templates/", "keep");

    //Global Variables
    $game = 'Dynasty Warriors';
    $alpha = 'D';
    $table = 'playstationfighting';

    global $game, $alpha, $table;

    $t->set_file('games', 'games.phtml');
    $t->set_block('games', 'Europe1Block', 'E1Block');
    $t->set_block('games', 'Europe2Block', 'E2Block');
    $t->set_block('games', 'Europe3Block', 'E3Block');
    $t->set_var('title', '$game - Playstation Xploder Codes (XploderCodes.Com)');
    $t->set_var('platform', 'Playstation');
    $t->set_var('gametitle', '$game');
    $t->set_var('copyright', 'All Contents Copyright XICCC');

    $sql = "SELECT europedate, europetcodes, europeurl FROM $table WHERE alpha='$alpha' and game='$game'";

    $db->query($sql);

    while ($db->next_record()) {

    $europedate = $db->f(europedate);
    $europetcodes = $db->f(europetcodes);
    $europeurl = $db->f(europeurl);

    $tmp1 = ".$europeurl";
    $t->set_var('europeurl', $tmp1);
    $t->parse('E1Block', 'Europe1Block', true);
    $tmp2 = "$europedate";
    $t->set_var('europedate', $tmp2);
    $t->parse('E2Block', 'Europe2Block', true);
    $tmp3 = "$europetcodes";
    $t->set_var('europetcodes', $tmp3);
    $t->parse('E3Block', 'Europe3Block', true);

    }

    $t->pparse('Output', 'games');

    ?>
    Last edited by XploreR; May 16, 2001 at 00:49.


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
  •