Jump to content


Photo

need help


  • Please log in to reply
7 replies to this topic

#1 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 11 June 2006 - 04:42 AM

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>";
when i run the code all i get is a blank screen

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#2 Masna

Masna
  • Staff Alumni
  • Advanced Member
  • 288 posts
  • LocationNew York

Posted 11 June 2006 - 04:46 AM

You have to use parenthesis for functions like fwrite.
I like LoL.

#3 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 11 June 2006 - 04:55 AM

[!--quoteo(post=382415:date=Jun 10 2006, 10:46 PM:name=Masna)--][div class=\'quotetop\']QUOTE(Masna @ Jun 10 2006, 10:46 PM) View Post[/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


Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 11 June 2006 - 01:13 PM

I'd start by removing those @'s from all the function calls so you can see if any errors are reported
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 11 June 2006 - 01:55 PM

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
z..z..z..z..z..z..z..z..

#6 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 11 June 2006 - 11:50 PM

[!--quoteo(post=382499:date=Jun 11 2006, 07:55 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 11 2006, 07:55 AM) View Post[/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

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#7 nineninefour

nineninefour
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 27 June 2006 - 09:36 AM

[!--quoteo(post=382413:date=Jun 10 2006, 09:42 PM:name=phpuesr1)--][div class=\'quotetop\']QUOTE(phpuesr1 @ Jun 10 2006, 09:42 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
[code=auto:0]
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.


#8 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 June 2006 - 09:40 AM

Plase note when posting functions, place a space between the function name and the opening parenthesis, like so:
fopen (... blah ...);
Whenyou do that the forum will allow you to post.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users