Joshua44
11-08-2002, 07:24 PM
$dir = strtolower($board); // dir = social lounge
$file = strtolower($topic); // file = I like computers
$file = "$file 1"; // file = I like computers 1
$file = str_replace(" 1", "1", $file); // file = I like computers1
include("$dir/data.php"); // include("social lounge/data.php");
print("$topic[1]"); // prints "I"!!!!!!!!!
$total_posts++;
$file = fopen("$dir/data.php", "w");
fwrite($file, "<?
\$total_posts = \"$total_posts\";
\$total_topics = \"$total_topics\";
\$newest_date = \"$date\";
\$newest_post = \"$topic\";\n");
if($total_topics !== 0) {
$count = 1;
while($count <= $total_topics) {
fputs($file, "\$topic[$count] = \"$topic[$count]\";\n");
$count++;
}
}
fwrite($file, "\n?>");
fclose($file);
DATA FILE - /social lounge/data.php
<?
$total_posts = "11";
$total_topics = "1";
$newest_date = "8/11/2002 - 5:16.52 PM";
$newest_post = "I like computers";
$topic[1] = "I like computers";
?>
Ok, right after that include statement when I say 'print("$topic[1]");' it outputs the first letter: "I" and then prints it to the file, so it ends up:
$topic[1] = "I";
And then, for the line above it, it prints:
$newest_post = "IIlike computers";
so I'm really confused............. help please??? :(
$file = strtolower($topic); // file = I like computers
$file = "$file 1"; // file = I like computers 1
$file = str_replace(" 1", "1", $file); // file = I like computers1
include("$dir/data.php"); // include("social lounge/data.php");
print("$topic[1]"); // prints "I"!!!!!!!!!
$total_posts++;
$file = fopen("$dir/data.php", "w");
fwrite($file, "<?
\$total_posts = \"$total_posts\";
\$total_topics = \"$total_topics\";
\$newest_date = \"$date\";
\$newest_post = \"$topic\";\n");
if($total_topics !== 0) {
$count = 1;
while($count <= $total_topics) {
fputs($file, "\$topic[$count] = \"$topic[$count]\";\n");
$count++;
}
}
fwrite($file, "\n?>");
fclose($file);
DATA FILE - /social lounge/data.php
<?
$total_posts = "11";
$total_topics = "1";
$newest_date = "8/11/2002 - 5:16.52 PM";
$newest_post = "I like computers";
$topic[1] = "I like computers";
?>
Ok, right after that include statement when I say 'print("$topic[1]");' it outputs the first letter: "I" and then prints it to the file, so it ends up:
$topic[1] = "I";
And then, for the line above it, it prints:
$newest_post = "IIlike computers";
so I'm really confused............. help please??? :(
