SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2000
    Location
    NY, USA
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [I'm a real newbie at PHP...]

    Well I'm using this simple rating script, and it's giving me quite some errors. Basically I'm building myself a brand new directory script with features like link rating and commenting. My rating script 9rate.inc) starts with,
    Code:
    <?
    function rateaprog () {
    
    $prog;
    And I'm calling the script like this,

    Code:
    <? include "rate.inc"; rateaprog ("site.dat");?>
    Now everytime I run the script it gives me a parsing error in line 4, which basically means that I don't know how to call a variable ($prog) and put it in. $prog is used all around the file and is basically the name of the txt file which the script creates to store rating values. How do I define it??? so that the call is rightly handed.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function rateaprog($prog){
    blabla;
    blabla;
    }
    Great Dane
    Gokhan ARLI

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    include is a function itself thus it needs to be encapsulated by quotes so this should bewhat you are after
    <? include ("rate.inc"); rateaprog ("site.dat");?>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •