Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6046957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:17:55+00:00 2026-05-23T07:17:55+00:00

here is the page: [I removed the URL, it doesn’t exist anymore] my problem

  • 0

here is the page: [I removed the URL, it doesn’t exist anymore]

my problem is that comments in the data.bdf are not formatted except for the first one.

this is the php:

<html>
<head>
<title>Text Database Editor</title>
<style type="text/css">
span.comment {
    color:green;
}
</style>
<script type="text/javascript">
function setURLValue() {
    document.getElementById("url").value=window.location;
}
</script>
</head>
<body onLoad="setURLValue();">
<?php
function interpret($fileline) {
    for ($count=1;!empty($fileline[$count]);$count++) {
        if (strpos($fileline[$count],"//")==0) {
            $fileline[$count]=substr($fileline[$count],2);
            $fileline[$count]="<span class=\"comment\">".$fileline[$count]."</span>";
        }
        return $fileline;
    }
}
$filepath = "data.bdf";
$filesize = @filesize($filepath);
if (!empty($filesize)) {
    echo "File being opened contains ".$filesize." bytes of data. Opening file...<br />";
}
else {
    echo "Error in determining file size. ";
}
$handle = @fopen($filepath, "r") or die("File could not be opened");
echo "File Opened!<br />";
$filedata = fread($handle, $filesize+1) or die("File could not be read");
echo "File Read!<br /><br />Data in file:<br /><br />";
$fileline = explode("`",$filedata);
$fileline = interpret($fileline);
for ($count=1;!empty($fileline[$count]);$count++) {
    echo $count.": ".$fileline[$count]."<br />";
}
?>
<br />Write to file:
<form name="writeto" action="write_to_file.php" method="post">
<input type="hidden" name="formurl" id="url" />
<input type="hidden" name="file" value="<?php echo $filepath;?>" />
<input type="radio" name="iscomment" value="Yes" />Comment
<input type="radio" name="iscomment" value="No" />Data<br />
Text: <input type="text" name="text" />
<input type="submit" />
</form>
</body>
</html>
<?php fclose($handle);?>

Thanks for helping…

by the way i no longer have the bug with writing twice

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:17:56+00:00Added an answer on May 23, 2026 at 7:17 am

    The return statement in interpret() is at the wrong place. It should be outside the loop:

    function interpret($fileline) {
        for ($count=1;!empty($fileline[$count]);$count++) {
            if (strpos($fileline[$count],"//")===0) {
                $fileline[$count]=substr($fileline[$count],2);
                $fileline[$count]="<span class=\"comment\">".$fileline[$count]."</span>";
            }
        }
        return $fileline;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
I have a page going here that uses jQuery: http://treethink.com/services What I am trying
I'm not entirely sure what's breaking here on this page: http://grandoaks.org/floor.html but it seems
here's the problem: when requesting url like - http://server/path/to/file.html?param=../../something/something i get response: 500 Internal
I'm currently working on a problem that basically involves processing all data in a
My problem is that the browser windows vertical scrollbar that is removed by for
I have a form on a page that adds new data to a database
i shall state my problem here.. I have an index.html page which has a
So I have this page here: http://www.eminentmedia.com/development/powercity/ As you can see when you mouse
If you look on this page here in Firefox (I'm on 3.5.2 on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.