Jump to content

RickyF

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by RickyF

  1. I know, i think its stupid too lol, but people seem to want the feature for some reason.
  2. Warning: in_array() [function.in-array]: Wrong datatype for second argument on line 12 Your ip is banned! $bannedurls = "web1.com,web2.com,web3.com";
  3. Thanks for the script, will try it in a sec. I know things can be bypassed, but the script needs a form of IP banning, i think its a pointless feature too, but its been requested so....
  4. Hi, the ban ips part is working fine, its just the web url banning that isnt working fully as explained, if site.com was banned by the script, and some one tried posting www.site.com it would let them, the script needs to check if anything like site.com is posted, e.g. *site.com*, meaning anything.site.com or www.site.com etc should also be banned.
  5. Sorry i think i have confused you. I need the script to be able to ban a website in full, e.g. if i banned site.com, the script should ban any thing with site.com in it, this script doesn't do this, this is why i used eregi in an earlier post to you. Thanks Heres what i currently have: $bannedurls = "website1.com,website2.com,website3.com"; $sites = explode(",", $bannedurls); if (in_array("$bannedurls", $sites)){ die ("Your website is banned!"); }
  6. Thanks, working, is there a way to make it so that spaces after commas dont stop the validation from working? $var = "1,2,3"; works $var = "1, 2, 3"; doesnt
  7. $bannedurls = "whatever.com"; $urls = explode(",", $bannedurls); if (in_array("$bannedurls", $urls)){ die ("Your website is banned!"); } This is different, as its part of a form, weburl is the input field being checked. The script needs to ban *whatever.com*, not just whatever.com as people can bypass with www.whater.com or whatever.com/ etc Thanks
  8. Similarly, how would i make it so that anything in $bannedurls stops the post being made? $bannedurls = "1.com, 2.com, 3.com"; The var for the what the domains are, is $weburl, $weburl would be something like www.site.com $bannedurls = "1.com, 2.com, 3.com"; if (in_array(eregi("$bannedurls", $weburl)) { die ("Your website has been banned."); } I think it would be something like this.
  9. Hi, Ok so i have config.php, in this i need a var to be set as $bannedips and in index.php the banned ips need to be collected from config.php and if the IP is banned a die error should show I need it so that $bannedips is on like this: $bannedips = "1.1.1.1, 2.2.2.2, 3.3.3.3"; If its possible to do this not using quotes on each ip this would be useful, most essentially the ips need to be on one line seperated by a comma. Using php 4.4.7 Thanks for any help!
  10. A script i have already used in my script already does this i just realised! http://www.phpclasses.org/browse/file/10982.html It creates a time stamp, and then checks each time the db is accessed if the time stamp is expired, if it is it deletes the rows that are expired. Could some one help out with something that does this, the code is in the script above, just needs to be fiddled around with a bit.
  11. I dont really have crons in mind, how much would be involved in making this work through php/mysql? What sortof script size etc?
  12. Oh really, i thought you could "limit" the mysql table, so that only 20 records could be in the table at any one time, and when new data was inputted the 20th row would be removed then the new new data would be first etc.
  13. Heres part of my script that gets the mysql data: $db = mysql_connect($dbhost,$dbuser,$dbpass); mysql_select_db($dbname) or die(mysql_error()); mysql_query("INSERT INTO plugboard(imageurl,weburl,date,ip) VALUES('$imageurl','$weburl','$date','$ip')"); } } $db = mysql_connect($dbhost,$dbuser,$dbpass); mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM plugboard ORDER BY id DESC LIMIT 20"; $result = mysql_query($query);
  14. Still on php 4.4.7, heh. Well, 20 rows are shown, but theres still rows in the table that exist but arent being shown, this will make the database huge over time, so theres no point in making the database hold more then 20 rows - or records whatever you want to call them.
  15. One last thing, my script is showing only the last 20 records as i want it, how ever i don't know how to make the databae not store any more then 20 records, how is this changed, by php or the table structure its self, could you help out with that?
  16. lol me being lazy, sorry mate, thanks for the help!
  17. Hey, thanks for that, but http:// needs to be stripped aswell as www., and also make it ignore anything typed after .com or whatever the extension is, e.g. if http://www.site.com/folder/ was typed, i would only want *site.com* to be searched for. Thanks!
  18. Warning: parse_url() expects exactly 1 parameter, 2 given, on line 13 Line 13 is: $search = str_replace("www.", "", parse_url($weburl, PHP_URL_HOST)); // Split the web url into site.com <?php $host = 'removed'; $mysql_user = 'removed'; $password = 'removed'; $db = 'removed'; $weburl = "http://www.test.com"; // Define the web url $connection = mysql_connect($host,$mysql_user,$password) or die ("Couldn't connect to server."); $selectdb = mysql_select_db($db,$connection) or die ("Couldn't select Intern database."); $search = str_replace("www.", "", parse_url($weburl, PHP_URL_HOST)); // Split the web url into site.com $query = mysql_query("SELECT * FROM plugboard WHERE weburl LIKE '%{$search}%'") or die(mysql_error()); // Select all the rows where the weburl field contains site.com if(mysql_num_rows($query)) { // If the query returned any rows echo "{$weburl} found in database"; // Found } else { echo "{$weburl} not found in database"; // Not found } ?>
  19. Hello, Is it possible to grab the data from the database, the var is $weburl, and $weburl will be a website, e.g. http://www.site.com I need mysql to be checked to see if $weburl already exists in the mysql database, i have included the database structure. But it has to check in such a format, it has to check if *site.com* exists in the database, not www.site.com or http://www.site.com Hope that makes sense Thanks for any help! SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE `plugboard` ( `id` int(10) NOT NULL auto_increment, `imageurl` text, `weburl` text, `date` varchar(15) default NULL, `ip` varchar(15) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=154 ;
  20. Hello, The script is actually a plug board im developing, the point of the partiular validation is to stop people from posting the link to their banner in the website url input field, as some people seem to get confused and try putting the image into the web address and vice versa. Thanks for the help.
  21. Hey, 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. Thanks if (eregi("jpg|jpeg|gif|bmp|png", $weburl)) { die ("Your website url can not be an image."); }
  22. Ok, i had two php tags <?php ?> etc, i joined the entire code into one, its showing a blank white page
  23. I have done, at the very end of the file as instructed. Using PHP 4.4.7
  24. Fatal error: Call to undefined function: rfile_exists() on line 4 Line 4: $found = rfile_exists($url);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.