Jump to content

Archived

This topic is now archived and is closed to further replies.

fert

need help

Recommended Posts

[code]
if($_COOKIE[user]!="")
        {
            $file=@fopen ("_private/chat_users.txt","a");
            @fwrie ($file,$_COOKIE[user]);
            @fclose ($file);
        
            $file=@fopen ("_private/chat_users.txt","r");
            $users=@fread ($file,filesize("_private/chat_users.txt");
            @fclose ($file);
        }
        
        $file=@fopen ("_private/chat_text.txt","r";
        $text=@fread ($file,filesize("_private/chat_text.txt");
        @fclose ($file);
        
        echo "<p><textarea rows=20 name=people cols=15 readonly>\"{$users}\"</textarea>&nbsp;&nbsp;&nbsp;";
    echo "<textarea rows=20 name=text cols=61>\"{$text}\"</textarea></p>";
    echo "<p><textarea rows=3 name=post_text cols=64></textarea></p>";
    if($_COOKIE[user]!="")
    {
        echo "&nbsp;&nbsp;&nbsp;<input type=submit value=send>";
    }
    echo "<p><input type=button value=Reload Window onclick=window.location.reload()></p>";
[/code]
when i run the code all i get is a blank screen

Share this post


Link to post
Share on other sites
You have to use parenthesis for functions like fwrite.

Share this post


Link to post
Share on other sites
[!--quoteo(post=382415:date=Jun 10 2006, 10:46 PM:name=Masna)--][div class=\'quotetop\']QUOTE(Masna @ Jun 10 2006, 10:46 PM) [snapback]382415[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You have to use parenthesis for functions like fwrite.
[/quote]
There aren't any () because that's the only way the forums would let me post code

Share this post


Link to post
Share on other sites
I'd start by removing those @'s from all the function calls so you can see if any errors are reported

Share this post


Link to post
Share on other sites
if($_COOKIE[user]!="")
{
echo "&nbsp;&nbsp;&nbsp;<input type=submit value=send>";
}
go for $_COOKIE['user'] instead, and if this doesn't help make sure the cookie is actually set as with no errors it could only be this

Share this post


Link to post
Share on other sites
[!--quoteo(post=382499:date=Jun 11 2006, 07:55 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 11 2006, 07:55 AM) [snapback]382499[/snapback][/div][div class=\'quotemain\'][!--quotec--]
if($_COOKIE[user]!="")
{
echo "&nbsp;&nbsp;&nbsp;<input type=submit value=send>";
}
go for $_COOKIE['user'] instead, and if this doesn't help make sure the cookie is actually set as with no errors it could only be this
[/quote]
I tried this and this doesn't work

Share this post


Link to post
Share on other sites
[!--quoteo(post=382413:date=Jun 10 2006, 09:42 PM:name=phpuesr1)--][div class=\'quotetop\']QUOTE(phpuesr1 @ Jun 10 2006, 09:42 PM) [snapback]382413[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]
if($_COOKIE[user]!="")
{
$file=@fopen"_private/chat_users.txt","a";
@fwrie$file,$_COOKIE[user];
@fclose$file;

$file=@fopen"_private/chat_users.txt","r";
$users=@fread$file,filesize("_private/chat_users.txt");
@fclose($file);
}


[/quote]

Look at line 4. fwriTe needs to have a "t" in it.

Share this post


Link to post
Share on other sites
Plase note when posting functions, place a space between the function name and the opening parenthesis, like so:
[code]fopen (... blah ...);[/code]
Whenyou do that the forum will allow you to post.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.