echoing to a div box on html page
Posted: Thu Jun 17, 2004 5:00 pm
ok... here's my script:
ok as you can see I'm trying to validate a password and store the users name along with a message, that will first be validated and if correct, the users name would then be printed into the div box on my page... heres the htm code:
ok so far all it does, is open a new page and echos the username and the message, I would like for it to simply print that info inside my div box instead, as you can see above... how would I go about doing this? And I understand you are busy and this may take up sometime, so if you know of a good tutorial you think I will benifit from, that in place of syntax fixing will be just as appreciated... thank you ahead of time... regards
Code: Select all
<?
if ($_GETї'pass'] == "getsum") {
$fp = fopen("win.txt","a");
if(!$fp) {
print "There was an error while attempting to open the file!";
exit;
} else {
echo "Wrong!";
}
$fp = fopen("win.txt","a");
if(!$fp) {
print "There was an error while attempting to open the file!";
exit;
}
$stringtowrite="<font color=white><b>".$name."</b></font> <font color=white>has beaten this challenge!</font><div><br>";
fwrite($fp, $stringtowrite);
fclose($fp);
$sp = readfile("win.txt","r");
if(!$sp) {
print "There was an error while attempting to print the file!";
exit;
}
?>Code: Select all
<form action="http://newb.t35.com/nixwin.php">
<font size=2 color=white>Users who have beaten this challenge
<div style="border:#FFFFFF 1px solid;width:300;height:100;" name="winners">
</div>
</font>