Little PHP Help...

General chat area for anything whatsoever

Moderator: Core Staff

Lethal323

Little PHP Help...

Post by Lethal323 » July 25th, 2007, 1:25 pm

Im making a thing for admins in my clan...

I need a thing where you enter the text in the text box and will write it to a document... But the catch is. It needs to delete the old text from the document


This is what I have right now...

Code: Select all

<?php
$text= $_GET["text"];
$logfile= '/home/users/progamers/public_html/loc/clan.txt';
$fp = fopen($logfile, "a");
fwrite($fp, $_POST["text"]);
fwrite($fp, "");
fclose($fp);
?>
<html>

<head>

<link rel="stylesheet" type="text/css" media="all" href="css.css">

<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body link="#808080" vlink="#808080" alink="#808080" text="#808080" bgcolor="#808080" background="images/index_27.png">

<div align="center">
  <center>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="580" id="AutoNumber1" height="385" bordercolorlight="#000000" bordercolordark="#000000">
    <tr>
      <td width="545" height="15" background="images/news1.png">
      <p style="margin-left: 3; margin-right: 3"><font face="Arial" size="1">
      Rules</font></td>
    </tr>
    <tr>
      <td height="347" background="images/newsbg.png">
      <p style="margin: 3 10" align="left"><font face="Arial" size="1">Rules:<br>
<form name="form1" method="post" action="post">
<textarea name="text" COLS=65 ROWS=30><?php include ('clan.txt'); ?></textarea>
 <p>
    <input type="submit" name="Submit" value="Submit">
  </p>
</form>
    </tr>
    <tr>
      <td width="545" height="15" background="images/news2.png">
      <font face="Arial" size="1">&nbsp;</font></td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 25th, 2007, 3:24 pm

Does it need to be written to a document? I know how to make it write to the database...
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » July 25th, 2007, 4:58 pm

Pedsdude wrote:Does it need to be written to a document? I know how to make it write to the database...
Lethal323 wrote:I need a thing where you enter the text in the text box and will write it to a document...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 25th, 2007, 6:26 pm

I know that's what he said, I was just suggesting that he could write it to a database which would then display it on a webpage, and that if he wanted that instead then I could give him the code.

I have a quick question of my own:
Is it possible to have php do commands inside each other?
Image
Image

Lethal323

Post by Lethal323 » July 25th, 2007, 11:01 pm

Yes peds it is...


and I guess I could do a database.... Just really dont feel like setting one up...


And I know aboslutly NOTHING anbout mysql...

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 25th, 2007, 11:05 pm

You don't need to know that much about it. As long as you have phpmyadmin on your hosting it's simple.
Image
Image

Lethal323

Post by Lethal323 » July 25th, 2007, 11:07 pm

my stepdad said he would make me an account later on our server...

Hes getting ready for work right now tho...


So in the mean time I want to figure out how to write this data to a text document...

The problem is... Everytime you hit submit. It needs to clear all the data from that document and reload the new...

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 25th, 2007, 11:08 pm

Image
Image

Lethal323

Post by Lethal323 » July 25th, 2007, 11:12 pm

thanks peds...

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 25th, 2007, 11:16 pm

KillerSam wrote:ovwer writing HAHAHAHA
(he's drunk)
Image
Image

Lethal323

Post by Lethal323 » July 25th, 2007, 11:19 pm

lol, off topic...

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » July 26th, 2007, 1:11 am

Haha Sam, quality end to our msn convo (which you outlived).
KS - Sam. says (23:36):
good stuff on dvtv?
KS - Sam. says (23:37):
enturtain me
Phìl » before i knew it, this dream was all gone says (23:37):
http://www.break.com
Phìl » before i knew it, this dream was all gone says (23:37):
entertain yourself
KS - Sam. says (23:38):
Hello Phil. This is KillerSam's dad. He has just fallen onto his floor, I think he is a little worse for wear. I am sure he will speak to you tommorow. I am going to put him to bed now.
Phìl » before i knew it, this dream was all gone says (23:39):
ok
KS - Sam. says (23:39):
thanks.
Image
Image

User avatar
Neon
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3535
Joined: April 21st, 2005, 8:54 pm
Location: England, Redditch

Post by Neon » July 26th, 2007, 2:01 am

Hello Phil. This is KillerSam's dad. He has just fallen onto his floor, I think he is a little worse for wear. I am sure he will speak to you tommorow. I am going to put him to bed now
LMFao i had a proper rofl! KS you legend lmao.
Image
"If we can hit that bull's-eye, the rest of the dominoes will fall like a house of cards...Checkmate."
"Seriously... .45k/sec it is a joke.. I could have just gone out and taken my own photos of children in this time."
"You have just become my fave youtuber!" - KillerSam in regards to myself. Win.

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » July 26th, 2007, 2:22 am

Neon wrote:
Hello Phil. This is KillerSam's dad. He has just fallen onto his floor, I think he is a little worse for wear. I am sure he will speak to you tommorow. I am going to put him to bed now
LMFao i had a proper rofl! KS you legend lmao.

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Post by waywaaaard » July 26th, 2007, 2:29 am

roflmao XD like the first time i read that on msn
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests