SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru godsfshrmn's Avatar
    Join Date
    Mar 2001
    Posts
    671
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant find error?

    Somewhere in here there is an error, I can't figure it out. The error is: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /home/valcoweb/public_html/scriptsforyou/stats/powerlog.php3 on line 491;. Line 491 is $1024 = get...


    PHP Code:
    // screen colors
    if($action == "colors") {

    function 
    get_colors($col) {
    global 
    $dbsql;
    $sql "SELECT count(sr) as cnt FROM $dbsql WHERE sr LIKE '%$col%'";
    $result mysql_query ($sql); 
     while (
    $row mysql_fetch_array($result)) { 
     
    $os1 $row["cnt"]; 
     return 
    $os1;
     } 
    }

    $
    1024 get_colors("1024x768");
    $
    800 get_colors("800x600");
    $
    1152 get_colors("1152x864");
    $
    1280 get_colors("1280x1024");
    $
    848 get_colors("848x480");
    $
    640 get_colors("640x480");
    $total = ($1024 + $800 + $1152 + $1280 + $848 + $640);

    function 
    calculateper($number) {
    global 
    $total;
    $percent round((100 $number $total), 1);
    return 
    $percent;
    }

    $
    1024per calculateper($1024);
    $
    800per calculateper($800);
    $
    1152per calculateper($1152);
    $
    1280per calculateper($1280);
    $
    848per calculateper($848);
    $
    640per calculateper($640);

    ?> 
    s c r i p t s f o r y o u . n e t
    ScriptsForYou

  2. #2
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A valid variable name must start with letter (or a underscore) so your problem is: you have to rename those $1024, $800, etc.

  3. #3
    SitePoint Guru godsfshrmn's Avatar
    Join Date
    Mar 2001
    Posts
    671
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok thanks. Learned something new there
    s c r i p t s f o r y o u . n e t
    ScriptsForYou


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
  •