What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Shoutbox help

PHP Shoutbox help
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: PHP Shoutbox help
quote:
Originally posted by M73A
hm i tried putting it in but it didnt work. where would you advise to put it?

code:
$fp = fopen("shouts.txt","a");
   fseek($fp, 0);
   fwrite($fp,strip_tags($_POST['user']).":".strip_tags($_POST['shout'])."\n");
   fclose($fp);
   $shoutbox_page = "http://pps3.awardspace.com/Shoutbox/index.php";
   header("Location: $shoutbox_page");

Bold parts are the changed parts.

I also added my other suggestion about your add to top of the file problem, the fseek will put the pointer at the start of the file.

EDIT: However, I'm not sure how fwrite writes the string to it, if it will overwrite what is already there or it will add it before the rest, I actually think it's the first, so it might not be that helpful :P, but the strip_tags are unaffected, so you can still copy that part :D

EDIT2: Indeed I was right, there is no prepend mode, so with fseek the contents will be overwritten, nevermind that then, just use the other suggestions about the prepending.

This post was edited on 06-08-2007 at 10:33 PM by Ezra.
[Image: 1-0.png]
             
06-08-2007 10:23 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Shoutbox help - by M73A on 06-08-2007 at 06:05 PM
RE: PHP Shoutbox help - by vikke on 06-08-2007 at 06:14 PM
RE: PHP Shoutbox help - by toddy on 06-08-2007 at 06:22 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 06:33 PM
RE: PHP Shoutbox help - by Nathan on 06-08-2007 at 06:35 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 06:37 PM
RE: PHP Shoutbox help - by Nathan on 06-08-2007 at 06:49 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 06:54 PM
RE: PHP Shoutbox help - by Veggie on 06-08-2007 at 07:13 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 07:14 PM
RE: RE: PHP Shoutbox help - by Veggie on 06-08-2007 at 07:16 PM
RE: PHP Shoutbox help - by Veggie on 06-08-2007 at 07:18 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 07:19 PM
RE: PHP Shoutbox help - by Ezra on 06-08-2007 at 07:24 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 07:25 PM
RE: RE: PHP Shoutbox help - by vikke on 06-08-2007 at 07:43 PM
RE: PHP Shoutbox help - by Nathan on 06-08-2007 at 07:44 PM
RE: PHP Shoutbox help - by Ezra on 06-08-2007 at 07:44 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 09:30 PM
RE: PHP Shoutbox help - by ShawnZ on 06-08-2007 at 09:49 PM
RE: PHP Shoutbox help - by Ezra on 06-08-2007 at 09:52 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 10:07 PM
RE: PHP Shoutbox help - by Ezra on 06-08-2007 at 10:23 PM
RE: PHP Shoutbox help - by M73A on 06-08-2007 at 10:32 PM
RE: PHP Shoutbox help - by Nathan on 06-09-2007 at 10:08 AM
RE: PHP Shoutbox help - by Felu on 06-09-2007 at 10:27 AM
RE: PHP Shoutbox help - by M73A on 06-09-2007 at 06:13 PM
RE: PHP Shoutbox help - by Nathan on 06-09-2007 at 07:03 PM
RE: PHP Shoutbox help - by M73A on 06-09-2007 at 09:42 PM
RE: PHP Shoutbox help - by Nathan on 06-09-2007 at 10:11 PM
RE: PHP Shoutbox help - by M73A on 06-09-2007 at 10:14 PM
RE: PHP Shoutbox help - by Ezra on 06-09-2007 at 11:56 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On