SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please HELP me! Badly Needed!

    How can i get this to write to a file?
    PHP Code:
    <?php
    require(".\global.php");

    if (
    $step=="writesurveys") {

    $result mysql_query("SELECT survey_name, survey_id, survey_text, survey_valid
                           FROM surveys
                           WHERE survey_name like '
    $action%' AND survey_cat like 'PC' AND survey_valid=1
                           ORDER BY survey_name ASC"
    );

      while(list(
    $survey_name$survey_id$survey_text) = mysql_fetch_row($result)){
                eval(
    "\$listbit .= \"".gettemplate('survey_listbit')."\";");
         }
    eval(
    "dooutput(\"".gettemplate('surveys_list')."\");");



        
    $filenum=fopen("C:\\Program Files\\Apache Group\\Apache\\htdocs\\testing\\survey\\html\\list.html","w");
        
    fwrite($filenum,$configfile);
        
    fclose($filenum);

    }
    ?>
    I greatly appriciate any help. $configfile needs to be set so it includes the entire html of the page that surveys_list produces. PLEASE HELP!

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whats it doing/not doing?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, while quickly scanning i got a few things:

    1. whats the "." for in in the require statement?
    2. have you defined $configfile anywhere? cause you didn't in that code.
    3. put quotes around $configfile in your fwrite statement and spaces after the commas.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well it's different. the "." is a typo. it's ./global.php

    and $configfile is the thing i'm trying to define as the debugged template which is called 'surveys_list'

  5. #5
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the dooutput function will get the template, debug it such as it will replace each {imagefolder} with http://something/images in the template.

    Originally posted by Defender1
    whats it doing/not doing?

  6. #6
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, that's what it's suppose to do, but whats you problem?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  7. #7
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that and you still need to define $configfile somewhere before you try to use it.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  8. #8
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't replace the images with what it's suppose to replace. it doesn't replace it at all. so in other words it doesn't debug.
    Originally posted by Defender1
    that and you still need to define $configfile somewhere before you try to use it.
    Last edited by MrLister; Sep 9, 2001 at 20:40.


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
  •