Stopping Flooding / Spam

Mar 8, 2006

I have a form that insert's data into a mysql table. I record the users, ip and time of submission. I use now(), when inserting the time into the table. I was wondering if there is a way to not allow them to submit anymore until an hour after their previous submission?

ADVERTISEMENT

Flooding & Sessions

Feb 4, 2003

I've just realized that in case someone decides to flood my web server with HTTP requests, the session.save_path directory on the server will get filled with thousands or even millions of session files in no time.

Each session_start() will create a new unique file on the disk or an entry in a session handling database table. This can drastically slow down the server even after the flood stops. I deliberately flooded my development server and noticed the number of session files kept increasing for the next several minutes after I stop the flood. I imagine it would cause a variety of other problems as well.

While setting a high value (100) for session.gc_probability and reducing the value for session.gc_maxlifetime to 300 (5 minutes) will limit the number of files to as many as a flood attack can generate in 5 minutes, it will cause the server to perform the 'garbage collection' routine upon every request, which itself can be damaging to the server's performance. Besides simultaneous flood attacks from multiple sources can easily amount to hundreds of thousands of hits thus session files in just 5 minutes.

Can anyone think of a solution? A code level solution would be nice but I can't think of anything. I believe this calls for a small change to the way PHP handles sessions. While a session id and a cookie are generated upon establishing a new session (session_start()), a session handling file should not be created until a session variable is initialized ( $_SESSION[]= or session_register() ). With that in place, writing flood-proof code wouldn't be hard at all.

View 14 Replies View Related

Avoid Post Flooding

May 24, 2007

I am trying to figure out a way to stop visitors from flooding my guestbook and comments scripts.  Is there a way to do this other than using captcha.  ie: Only 1 post every 10 seconds?

View 1 Replies View Related

Plugin To Calculate Spam Assassin Spam Score?

Sep 13, 2009

I have spam assassin on my hosting server. Is there any way to plug into it and calculate the spam score of an e-mail, before it is sent out? Preferably not invoking spam assassin directly.

View 2 Replies View Related

Check The Mail For Spam And Generate A Spam Report?

Feb 2, 2009

I am working on an email marketing system. I need to check the mail for spam and generate a spam report for that. I tried with spamassassin, but with no success till now.

View 12 Replies View Related

While And Stopping

Jun 21, 2007

in a while, is there a variable telling if the request was cancelled?

say:
while( $more_data && !$not_cancelled)
{
blabla

?

View 2 Replies View Related

Stopping Sql Injection

Apr 3, 2007

I've been looking at sql injection for a while now. I think I understand how it works, but I don't really know how to stop it.

I got alot of text feilds on my site which I'm building and I think this is some I need to sort out. I know I have to use mysql_real_escape_string() but were and how.

View 14 Replies View Related

Stopping The Script

Jul 22, 2006

whats the command for stopping the php script?

View 1 Replies View Related

Stopping A Script

Sep 13, 2006

I get a script to stop processing when a user clicks the Stop button in their browser. Currently the script just keeps writing a file until it has completed. This file writing can take up to a half hour so if the user decides to click the stop button I would like the script to also stop.

View 8 Replies View Related

Stopping My Newsletters

Oct 2, 2007

I wrote a pretty simple script to post a newsletter to all my users. It works and gets sent to people but it seems to end up in their junk emial boxes.

View 3 Replies View Related

Stopping Php/mysql

Jan 3, 2007

I have a php form that links through to a mysql database. I want to allow people to access the form without having to register on the site. My thoughts at the moment are put the form in a .htaccess pass protected directory to stop the spammers. However, how do I then communicate the login/pass? Or are the spammers good enough to get the login details from the page and then go through.

View 2 Replies View Related

Stopping Spaces From Getting Passed

Oct 2, 2000

I have a simple little form that takes the name and a comment, and adds it to a table. I want to know if there is a way to prevent someone from just entering spaces, and having that get entered as their name. I have the if statement check for $name == '' - but the names entered as just spaces get by it.

View 3 Replies View Related

Starting & Stopping Httpd

Jan 24, 2003

What i want to do is to fire the functions in the httpd script to start, stop, restart, httpd for eg. from the console i would write ( from the init.d dir.)

httpd start. to start the Apache server. but how do i do it from a php script? I can open it with fopen().

View 4 Replies View Related

Stopping A Process With Php/mysql

Feb 22, 2006

So I have a php page which starts a query which can take a while. I can even close the window and the process will continue to run. What I'd like to be able to know is what was the process ID I just initiated so I can also store that in a DB and how could I use php to kill that specific process on some other page.

View 1 Replies View Related

Stopping Others From Spamming Through Your Web Forms..

Nov 9, 2005

I've had a bit of a problem lately where people seem to be using some of my webforms to spam through; my host says they are calling the script directly & taking adavnatge of my forms that send mail out...

What's the best way to deal with this without affecting legitimate users that use my forms? I know I could block all referrers not coming from my site; but for some reason some people don't leave referrers or leave blank refferers so I am wondering what to do?

View 2 Replies View Related

Command For Stopping PHP Dead

Aug 11, 2007

Is there a simple command that will stop PHP executing in it's tracks? I'm writing a fairly complex script with many nested loops, and at some point if a condition is met I'd like the script to stop and output some HTML without executing the tail end of the loops. Something like break() but for if/else loops, basically.

View 4 Replies View Related

Stopping Multiple Submissions

Feb 21, 2007

We have just launched a new custom made script which we use for Support, when each
new Support ticket is opened it's inserted into a MySQL database and therefore
awaiting staff viewing. Immediately an email is sent to the user detailing their
unique ID, and a link to "open" their ticket from a user script which lets them
add replies to the ticket.

This is all working perfectly, but one thing that concerns me is they could post
loads of information, repeatidly, and therefore put strain on the server and MySQL
server.

Is there a possible piece of code I can include in the script that would stop
multiple submissions to the same ID? Let's say ... 2 per hour? Not only for replying
a ticket they made, but from the original form too? Is it possible to "block" an IP
and echo out a message that they cannot submit a new ticket, or update one for the
required time:submission ratio?

View 1 Replies View Related

Stopping Cache Lite

Aug 21, 2006

I'm using cache lite to try to speed up a page that takes it's results from an XML feed. Currently it grabs the feed, and if the expected information is not returned, shows an apology page. However since I started caching the page using Cache Lite, the apology page is being cached. I'd like to stop this.

View 1 Replies View Related

Stopping A Windows Service

Aug 27, 2006

i have xampp (apache) on my server, and id like to be able to stop some services (game servers runnings as a service) using php if it is possible.

View 1 Replies View Related

Exit() Without Stopping Execution

Feb 4, 2006

ok so I have a login system I made in php with mysql now when something errors I have it include a file then exit so for example when registering if a required field is missing it echo's the error includes the form again and exit's how can I get rid of the exit() without it executing anything else but the rest of the page design??

for example I want it when it says you are missing username field then display the form I want it to skip the processing part of the script and continue with the html of the page and other style stuff. (this includes some php stuff I need executed like include footer)

View 5 Replies View Related

Stopping And Beginning The Next Function?

Feb 28, 2011

I cannot figure out for nothing how you separate different commands or functions. Lets say I want to check to make sure my form had a topic entered and then once it passes it continues on to check the email field for injection. How do I do that? I did not copy my whole script here, just the end of one to the next.

if(!filter_has_var(INPUT_POST, "topic"))
{
echo("You did not enter a topic.");

[code]...

View 8 Replies View Related

Php Mail Stopping After A Few Emails

May 7, 2007

I am trying to mass mail a newspaper with PHP mail. I am using a local SMTP server. I am trying to send 300 emails at one time (with a for loop i.e. sending the same email to the same recipient 300 times) but it only sends a few them, sometimes about 100, sometimes about 130 and so on.. Then the php script stops, it doesn't even gives me an error.

I tried several different SMTP servers.

I tried the same script on a domain and it worked perfectly.

I don't think that the problem is coming from the SMTP server as the script is not sending the 300 emails, it is stopping.

View 11 Replies View Related

Stopping Specific Strings (.jpg Etc)

Jul 14, 2007

How can i make it so that only if .jpg etc is stopped, as the word jpg etc is being stopped, i tried adding dots before each word in the array, but this made no difference.

  if (eregi("jpg|jpeg|gif|bmp|png", $weburl)) {
  die ("Your website url can not be an image.");
       }

View 2 Replies View Related

Stopping Users From Entering Thru A Url

Mar 29, 2007

Is it possible to stop a user from viewing a certain page if they entered the page by typing the url in the address bar?

View 3 Replies View Related

Stopping Sending An Email

Aug 16, 2007

I have an email form on my site that allows people to enter a from and to email address, I want to know if it is it possible to stop people from sending an email if the from address ends in something like @paypal.com? And give them an error.

View 3 Replies View Related

CSS Stopping Next Page Loading?

Mar 13, 2011

I have a script which registers people to a database, however it doing something very strange.  Whenever I place it into even a single CSS div it adds the registration to the dabase but stops loading the next page (index.php) I find this totally bizarre as I haven't seen anything like this behave before.  With CSS affecting how PHP works.  Especially when the CSS is not inside the <php> of <form> tags.

Code: [Select]<?php
include("connect.php");
if($_POST['submit']) {
$username = mysql_real_escape_string(trim($_POST['username']));
$password = trim($_POST['password']);
$password2 = trim($_POST['password2']);

[Code]...

View 5 Replies View Related

Select A Different Db Without Stopping The Loop Of The First?

Jan 23, 2011

I have done select statements where you loop through all the records. But what I need to do is pull record from one database than insert parts of that record into the second. The issue I have is no knowing how to select a different db with out stopping the loop of the first.

View 3 Replies View Related

Stopping A Query For 5 Seconds?

Jan 28, 2010

im currently developing a text based game but ive hit a bit of a problem.

when players mug eachother they can just keep hitting F5 and mug (until they run out of energy etc)

but instead i would like it so after they mugged they then cant mug again for 5 seconds!

is there anyway this could be easily done?

an idea of how i could do it was maybe creating a value in their player table called last mug and it would be a time.... then i could try summert like if last mug <= 5 seconds from now then blah.... but im not too sure.

View 1 Replies View Related

Stopping Duplicate Registrations?

Apr 13, 2010

for some reason my code is allowing duplicate entries to be submitted and even blank entries. I'm not sure why, its like its skipping the entire checking process and going straight to entering it into the database.  I've been fiddling with it for a day or two, trying different things and this is what I have right now, this set of code comes after it checks to see if the input fields are empty.  Can anyone see anything wrong with this?

//If not empty, compare emails to database
$sql = "SELECT COUNT(*) FROM mytable WHERE email = '$email'";
$result = mysql_query($sql);

[code]...

View 11 Replies View Related

Stopping Execution Of An Included File?

Feb 27, 2003

I have a structure like this: Code:

/index.php
/dir_1/index.php
/dir_2/index.php
.
.
/dir_n/index.php

In the topmost index.php file i have a switch statement selecting the current active directory (e.g. dir_2) and including the index.php file in that dir, if it exists. Is there any way I can stop the execution of the included file (/dir_2/index.php) without affecting the calling file (/index.php)?

View 3 Replies View Related

Stopping People From Reloading A Page

Jul 14, 2006

I have a form, and when submitted it inserts a new row into a database. If people reload the target page, I'm sure that it'll reinsert another duplicate row. How do I stop people from submitting info numerous times?

View 14 Replies View Related

Stopping And Starting A Process Via Web Form

Apr 17, 2002

This sort of ties into my other thread I started. I just figured out how to compile the CGI binary version of PHP so now I can have the script I needed running in the background, do so right there at the web server. (PHP command mode is up and running beautifully right now)

Anyway, my question is in regards to making a form to start/stop/restart a particular running process on a Linux machine using PHP. The process will be my PHP script that I want running all the time in the background.

Starting is going to be pretty straightforward, as I can just use a system command functions to explicitly start the script I want to start. Such as exec("/path/to/the/script/background.php")

My trouble comes with how do I check to see if the script is currently running, and then give the option to stop it or restart it? I can make the stop function just do a system command exec("Kill -9 $PID") but how can I get the PID to pass to the kill function? Also I am vary wary of holding the the PID in a variable, because then my script could be called like "http://some.com/script.php?PID=3455" which would be a "Bad Thing" [TM].

I guess basically I need to know how to either kill via the name of the running process ("man kill" did not give me any hints about that) or another linux system command to give me the PID of a particular running process.

Also if anyone has any thoughts on the (in)security of this, and how I can make sure this is hack proof I would really appreciate it! It seems to me that as long as I reset any variables passed to the system to blank at the top of my script, then it wouldn't matter if someone passed a variable via the URL. But I don't know that for sure.

View 3 Replies View Related

Paypal Recurring Payments Stopping?

Jun 13, 2011

I am using recurring payments in Paypal. And successfully implemented.Now if the user choose another package, I need to start a new
recurring and stop current recurring.

View 1 Replies View Related

Prevent Imagecreatefromjpeg From Stopping Script?

Sep 7, 2009

I am using imagecreatefromjpeg on a shared host, so if the image is to big then imagecreatefromjpeg will give me an "out of memmory error" and terminate the script.Is there anyway to catch the out of memmory error, and simply let imagecreatefromjpeg fail(Return false) instead of terminating the script?

View 4 Replies View Related

Stopping Parallel Execution Of Script?

Jun 26, 2010

I am trying to stop my cron script from allowing it to run in parallel. I need it so that if there is no current execution of it, the script will be allowed to run until it is complete, the script timesout or an exception occurs.

I have been trying to use the PHP flock function to engage a file lock, run the script and then release the lock. However, it still looks like I am able to run the script multiple times in parallel. Am I missing something?

Btw, I am developing on Mac OS X with the Mac filesystem, maybe this is the reason the file locks are being ignored? Though the PHP documentation only looks about NTFS filesystems?

// Construct cron lock file path
$cronLockFilePath = realpath(APPLICATION_PATH . '/locks/cron');
// Get cron lock file
$cronLockFile = fopen($cronLockFilePath, 'r');

[Code]....

View 3 Replies View Related

MySQL Decrementing A Field (stopping At Zero)

Sep 4, 2009

I have a products table with a stock field., when somebody purchases an item I want to decrement this value by the QTY purchased.

The only possible issue is that the stock level may not be correctly maintained. So it may be possible for the qty purchased to be greater than the stock level.

using this (Where {qty} and {id} are variables)

Code:
UPDATE products SET stock = stock - {qty} where id={id}

understandably causes the value to wrap around to the maximum allowed for an unsigned integer.

I want to avoid doing a sql read, modify write as it may be possible that another client may change the stock level mid-way through this process. Can this be done in a single line of SQL ?

View 3 Replies View Related

Div Innerhtml And Stopping Form Resubmit?

May 3, 2010

i've scoured the internet and can't find a clue. i have a div tag that contains a login form. when the form is submitted, the content of the div tag loads a mini chatroom. i know it's probably something really simple i'm just not quite getting, but i can't get it to work. clicking the submit redirects the entire page, rather than just the div content. i know how to do this:

<div id="loginform">
[code]........

View 7 Replies View Related

Stopping Multiple Users Using 1 Login

Jun 13, 2007

does anyone know any mysql transaction locking methods of some sort to stop a user from logging in at multiple places with one username, it must only allow one user with the username use that account. is there any way to stop that, as i have a subscription that people pay for and i want one user per username, how is that possible because there are many factors i had to consider, like if a user's session is loggged in a db and then they get removed when they logoff, but what if they don't logoff, what then?

View 7 Replies View Related

Stopping Form Inserting When Value = Null

May 23, 2007

I have a form that allows users to edit entries in the db. Thats all cool. My problem is that if any fields are left blank the form is inserting a '0' value when I need it to remain 'null'. How do I stop it inserting '0' values? Code:

View 4 Replies View Related

Stopping People Spamming My Mailform

Apr 10, 2007

Recently we have been having trouble with our mailform being hammered by spammers.
I am fairly certain that they are accessing the form outside of the site because the emails aren't valid (see email contents) and there is email validation on the form.

QuoteName = 144957a7-2ca2-4130-9f16-f715da818ed4
Email = 144957a7-2ca2-4130-9f16-f715da818ed4
Telephone = 144957a7-2ca2-4130-9f16-f715da818ed4
enquiry = 144957a7-2ca2-4130-9f16-f715da818ed4
Comments = 1 waitfor delay '0:0:20'--
Reset = Reset
02/04/07 - 20:43

I am looking for a way to reduce these spam attacks but do not want to go down the route of using captcha as i feel this may dissuade users entering forms. Is there a way of ensuring that a form has only been submitted via a valid refferer.

View 3 Replies View Related

Stopping Blank Values From Being Submitted

May 6, 2010

i have a compose message file with a form that inserts data into tables, i'm trying to figure out how to make an error appear if they have left a title or body blank, i'm not sure why this isn't working, here is the code

Code: [Select]<?php
session_start();
include_once "scripts/connect_to_mysql.php";
$logout = "";
$login_table = "";
$message_title= $_POST['message_title'];
[Code]....

View 3 Replies View Related

Stopping Posts Floods And Cookies

Jul 2, 2010

i dont understand whats going on. This always worked before... everytime someone makes a post i set a cookie

setcookie("Postflood",$ip,time()+POST_FLOOD);

post_flood is declared in globals as 30 - i.e 30 seconds between posts.

then when you go to make another post it does an isset($_COOKIE['postflood'])

even under 30 seconds it still doesnt see the cookie as having been set.... im not sure why this doesnt work?

View 7 Replies View Related

Getting Script To Insert 40,000 Rows Without Stopping?

Aug 3, 2010

I am managing a social network and am creating a script to allow the admin to private message all users on the site. Even setting the max execution time to unlimited within the file does not allow us to insert all 40,000 rows into the 'message' table, it stops after several thousand rows. Our hosts tell us setting this globally is a bad idea/unstable.

No email notifications need to be sent so it is purely allowing the script to run it's full course without stopping. I did consider a cron job but without emails doing in 'batches' seems a bit unecessary so I'm clearly missing something.

View 9 Replies View Related

Readfile Download Stopping Halfway Through?

Oct 1, 2010

I wrote a small application to force downloads of various large video files using readfile. This worked fine. However, the users have changed hosts and now it doesn't work. Small iles are fine, but large files will cut off before finishing. Test file is 114MB, but it is lways cut off at exactly 67.2MB or 51.4MB depending on a couple criteria. I've stripped the application down to the key part that's not working and run it on a test page the just mmediately goes the file - no logins or any of that shenanigans and htaccess blocking either:

$file = some/file/on/the/server.wmv; //114MB
hea der('Content-Description: File Transfer');
[code].......

View 5 Replies View Related

Stopping Multiple Form Submissions?

Jun 11, 2010

Every now and then we get duplicate orders through our ordering page.

I'm just wondering what's the best way for detecting and stopping them.

I do a redirect upon payment completion to a confirmation page to stop the person from reloading the browser and submitting the form data gain but they can easily go back and the browser will ask if they want to submit the form data again which they likely will.

What's the best practise for this? I could ajax the form but I don't want to do that.

View 5 Replies View Related

ADVERTISEMENT