Jump to content

darkcarnival

Members
  • Posts

    162
  • Joined

  • Last visited

Everything posted by darkcarnival

  1. im back again, with 1 problem left to go im stuck on a solution for my username blacklist checker. it can find an exact item like admin or webmaster but if wanted to look for: siteadmin it will not block that. i want to be able to block any occurance of admin. I've troied several things but none seem to do it. her is the code im using: [code]function blacklisted_usernames($value){ $q = mysql_query("SELECT * FROM ebb_blacklist") or die(mysql_error()); while ($row = mysql_fetch_assoc($q)){ if (strstr($row['blacklisted_username'], $value) !== false){ $blklist = 1; }else{ $blklist = 0; } } return ($blklist); }[/code] I've tried several other things but nothing has worked, any input is welcomed.
  2. that helps alot actually :) thanks that solved my problem :)
  3. ok doing a smaller test on this. i found the problem the query id not finding the key term that its uppose to. to break it down: i want to be able to ban wildcard so that if i wanted to ban an entire domain. for example: lets just say i dont want any hotmail users to join my site. i want to be able to just put hotmail.com into my database and any occurance of hotmail would alarm the test and say its banned. but it's doing that. if i just enter hotmail.com, it'll say its banned but if i enter someone@hotmail.com, it'll say your email is accepted. any idea on how to check the domian?
  4. hey, a user told me that they cant register an account because it said they were blacklisted. but that isnt true. so i edit the code as i thought there was something wrong with it. now in the testing it'll allow anyone to pass through the error check even if they do fall into the banlist. here is the email ban code: [code]function check_email(){   global $email, $db; $db->run = "SELECT * FROM ebb_banlist WHERE ban_type='Email' AND ban_item LIKE '$email'"; $match_chk = $db->num_results(); $emailban_q = $db->query(); $db->close(); if ($match_chk == 0){ $emailban = false; }else{ while ($row = mysql_fetch_assoc($emailban_q)) { if ($row['match_type'] == "Wildcard") { $emailban = true; }else{ if ($row['ban_item'] == $email) { $emailban = true; } } } } return $emailban; }[/code] the username ban is very similar so i wont post that unles requested to. what seems to be the problem? the last way it was written looked like this: [code]function check_email(){   global $email, $db; $db->run = "SELECT * FROM ebb_banlist WHERE ban_type='Email' AND ban_item LIKE '$email'"; $match_chk = $db->num_results(); $emailban_q = $db->query(); $db->close(); if ($match_chk == 0){ $emailban = false; }else{ while ($row = mysql_fetch_assoc($emailban_q)) { if ($row['match_type'] == "Wildcard") { $emailban = true; }else{ if ($row['ban_item'] == $email) { $emailban = true; } } } } return ($emailban) ? false : true; }[/code] that banned anyone, removing that banned no one. so im confused at what to do. thanks.
  5. hey, my data is getting bigger and so i want to add full-text to make searching better. but one item i want to make 4 fields full-text searchable as they all play a huge role in finding the correct item. i found a tutorial that gave me a small idea on it but it didnt get too informed on it. if anyone can give me some more details on this, I'd like that :) thanks :)
  6. no they wont sadly. in further test of this method it overwrote the last value. i realized that after a user figure it out and exploited the rating system. so making a new cookie for each rate is needed to ensure users dont abuse the rating system or at least not so often as one has or can.
  7. i use ob and ob_end_flush  ;) and yes the session limit is set to last 24 hours just to give you some code that i can remember: [code]            $currtime = time() + (86400);             setcookie("metalrate$id", $id, $currtime, "/", "metalstation1.com", 0);[/code] that is not the problem, though this part is: [code]if(isset($_COOKIE['metalrate$id']) == $id){ $voted = true; }else{ $voted = false; }[/code] any ideas on this?
  8. hi, i want to improve the ratng system i have on my site. right now no matter what item you vote for the same cookie will be created overwritting the last value, and i want to change that. what i want to so is name the cookie based on the id of the item. i tried to that but the cookie isnt being read. it'll clamin the cookie doesnt exist even though it was creayted successfully. cant show any code since i had to revert to to the old system to prevent any mass rating that it would cause.
  9. there dshould be a path setting in the http.conf file.
  10. ok that helps a bit :) now hres something to ask, the files i wish to do this to are in the same folder, will that have to change?
  11. hi, i want to use mod_rewrite for a site of mine to make it easier for my users to find pages(i have lots of pages) basically the thing is i have 2 differnt files i want to do this with. opne is a biography page, another is a album detail page. now this may sound dumb to those who know how to do but do i have to make another .htaccess file for that or place it in the same one? also something real quick, im testing this on my windows server(it has apache) im wondering if someone knew of a windows-based tutoiral for setting up mod_rewrite on apache as the one found on this site looks like its for linux. thanks :)
  12. hello, im trying to make a convertor to phpbb. and so far the only problem has been with the topic & post area. now wheever i try to add a topic or post that has ' in it i get this error: [quote]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 're banning bbcode on this post! [b]cant see this bold[/b][/quote] now i tried to add stripslashes() to the body variable but that didnt work. any ideas? should i try addslashes()? thanks.
  13. well theres too much to list here ;) guess i could show you what i think might work: [code]mysql_query("delete from ".$table_prefix."posts where topic_id='$row[topic_id]' and post_id < '$row[post_id]'") or die("Could not delete topics from phpbb.<br>". mysql_error());[/code]
  14. I'm making a convertor for a board program of mine and currently im makinga  convertor to move phpbb data over to my board. now im stuck on their post system they have everything in various tables and one item im trying to figure out is the topics. ater a topic has been transfered over to my topic table i want to delete it but phpbb place their topics in the same spot as the posts, so i have to do this without double posting the topics and without deleting the replies. anyone here got any ideas how i can go about this? a huge thanks to anyone who helps(finish this and im done with the convertor)
  15. yes im talking about the main site. i already emailed phpfreak and i never got a reponse and i noticed today the problem stil lexists so i decided to post this site-related error on the site-related error board ;) I hope someone who manages the site-portion of phpfreaks will read this and fix the problem.
  16. hi, this bug has been around for a bit and when i contact phpfreak about it, i never got a reply so ill see if this works ;) on the script library page theres 2 problems that im aware of: *users cant modify/delete their listing *some of the categories are not going past page 2 even though it should(cause it used to) just thought you guys should be aware of that, other than that good job ;)
  17. hello, after phpmailer has not met my needs, i decided to try pear's version of a mailing solution. and I'm using the sendmail approach since my host recommends that. now i wish to use it in a loop form for my newsletter system but in my testing the emails did not send but i got no error message. not sure if i screwed up or if its not ment to used that way but heres my code. [code] #form data. $name = $_POST['name']; $email = $_POST['email']; $comment = $_POST['comment']; #send email. require("Mail.php"); #get values for class. $headers['From']    = $email; $headers['Subject'] = 'Mail Test'; $params['sendmail_path'] = '/usr/bin/sendmail'; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('sendmail', $params); #create a message $message = "Hello, $name has sent you a message: $comment"; $body = $message; #query time. $q = mysql_query("select * from demo_list"); while($r = mysql_fetch_assoc($q)){ $recipients = $r['Email']; $headers['To'] = $r['Email']; $mail_object->send($recipients, $headers, $body); } echo "Email has been sent to the desired location.";[/code] I really hope someone can help me with this btw before you ask, yes im 100% sure the sendmail path is correct. thanks.
  18. well then I'll get the emails ;) i forgot to mention i want to use for a notify script of mine for new posts(sorry) werid thing though, using the bcc thing will email the letter more thanonce to the user, not sure on why it does that.
  19. hey, i plan to use phpmailer for my newsleter system but one issue has occur when i send a newsletter out, it'll display everyones email, which is a huge problem for me. now i replaced addaddress with addbcc but that now makes the to colume blank. now i know theres a tutorial for this here but the section on mailinglist is not written correctly. any help on this would be great. thanks :)
  20. EDIT: ok after a small workaround i got it to work correctly. :) thank you for your help.
  21. ok ill give that a try. btw $txt is a language variable(i have other since this program is multi-langual supported) error() is a error printing function i made to make displaying errors easier and more detailed ;)
  22. hey, im trying to fix my banning function and currently its not workng like it should. basically its suppose to ban users who have a certain email or username but when i test it out it lets the banned email through. here is the code im using: [code]function check_email(){ global $email, $txt, $db; $sql = "SELECT * FROM ebb_banlist WHERE ban_type='Email'"; $errorq = $sql; $banemail_q = mysql_query($sql) or die(error($error, "mysql", $errorq)); $numchk = mysql_num_rows($banemail_q); if($numchk == 0){ //bypass this check, nothing is found to check. }else{ while ($row = mysql_fetch_assoc ($banemail_q)){ if($row['match_type'] == "Wildcard"){ $db->run = "SELECT * FROM ebb_banlist WHERE ban_type='Email' and ban_item like '%$email%'"; $match_chk = $db->num_results(); $db->close(); #see if a match is found. if ($match_chk == 1){ $error = $txt['emailban']; echo error($error, "general"); } }else{ $db->run = "SELECT * FROM ebb_banlist WHERE ban_type='Email' and ban_item='$email'"; $match_chk = $db->num_results(); $db->close(); #see if a match is found. if ($match_chk == 1){ $error = $txt['emailban']; echo error($error, "general"); } } } } }[/code] I'm really stumped on this, and ive tried other ways with no success too. please help me. thanks.
×
×
  • 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.