473,383 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

help modding an old script

I wrote this last year, when i was getting into PHP, it was easy at the time
to write, however I have since not held my intrest in PHP so am looking for
some help adding to what is already here

here is the code

//CODE

<?php

$error = "http://www.yoursite.com/shoutb0x11/error.php";
$filename = "data.dat";
$box = "http://www.yoursite.com/shoutb0x11/shout.php";
$max = "2048";
$message = stripslashes($message);

if(filesize($filename) > $max) {
unlink($filename);
}
if (empty($name) || empty($message)) { header( "Location: $error" );
} else {
header( "Location: $box");
$a = fopen( $filename, "a") or die ("could not open $filename for writing
please check file permissions");
flock($a, LOCK_SH);
fwrite($a, "<font face=verdana size=1><b>$name</b> : $message</font>
<hr noshade size=1 color=000000>");
flock($a, LOCK_UN);
fclose($a);
}
?>

//CODE END

I want to be able to stop people from writing to the data.dat file
constantly over and over, or flooding the file, or maybe even prevent
identicle entries, however just a quick and easy way to implement to stop
posts being sent one after the other over and over would help greatly.

If anyone could maybe provide a snippet of code and instructions on where to
place the code i would greatly appreciate it, or if anyone could point me in
the direction of an example or information about adding a feature like this
i would much appreciate it

Thanks In Advance

Christo
Jul 18 '05 #1
0 1058

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
19
by: Kenneth Lantrip | last post by:
trying to make something like this work... #include <stdio.h> int main (void) { #if defined UNIX printf("\n\n\n%s\n\n", "Program is running on a flavor of Unix."); #endif
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: kellog | last post by:
Hi there, I really have no idea which forum this belongs in, as it pertains to software, but databases and graphics all at once. Pardon my ignorance toward programming, I am more of a graphics...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.