Jump to content

Lytheum

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Lytheum's Achievements

Member

Member (2/5)

0

Reputation

  1. Well one thing I noticed is PHP's built-in function "gethostbyaddr()". This will return the host name of a given IP, which generally (from what I've noticed) doesn't change very much even when an IP changes. So what if I used this function in conjunction with "similar_text()", and if host that is trying to vote has greater than a 75% match with a host that has already voted in the past 12 hours, deny them? Would just like to hear some thoughts. Otherwise, will most likely take Crabfinger & Eujut's approach. (Which will restrict a few people from voting, which pains me) P.S. I've googled around to find out how to obtain the mac address, and it seems possible. Although I am sure it is not sent in the browsers HTTP headers, I think there is a work-around. I'll look more into that.
  2. That is definitely an approach that I will keep in mind. It will not completely stop abuse, but it will definitely make it harder to do. Thank you. Anyone else with a solution?
  3. Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote once every 12 hours. The system works well, except it can be exploited very easily. Visitor's only need to renew their ip to be allowed to vote again. I have captcha in place to prevent bots from doing this, but if someone were dedicated, they could get a lot of free votes. Does anyone have a better way to track such things? Cookies will not work either. It's easier to get around than an IP. Perhaps I'll have to use a language other than PHP? Thanks for your help.
  4. Hmm. I have a mysql DB with many fields, say, 200, 300? Each one of them has a time in string format (ex:1212127274). What I would like to do is.. Select the info from the database that is within 5 minutes of each other. So, roughly: Group 1: Field18, 1212127273 Field13, 1212127272 Field99, 1212127271 Field22, 1212127274 Group 2: Field86, 1212127269 Field14, 1212127264 Field57, 1212127262 Field26, 1212127268 I'm very sorry if this isn't clear enough, it's so hard for me to explain.
  5. Awesome that does work. Now just one more question if you could. How do I do it when there is no pattern to follow? For instance: <?php $str="<b>blah:</b> 11<br/> <b>blah:</b> 22<br/> <b>blah:</b> 33<br/> <b>blah:</b> 44<br/> <b>blah:</b> 55<br/> "; ?>
  6. I need to pull some info off a certain website that is setup like this: <b>Blah1:</b> 11<br/> <b>Blah2:</b> 22<br/> <b>Blah3:</b> 33<br/> <b>Blah4:</b> 44<br/> <b>Blah5:</b> 55<br/> So I should be able to try: echo "$blah1"; //value of 11 echo "blah5"; //value of 55 My code which doesn't work at all, hopefully somebody can improve on it: // Get page $url = "http://url.url.url"; $data = implode("", file($url)); // Get content items preg_match_all ("/<\/b>([^`]*?)<br\/>/", $data, $matches); // Loop through each content item foreach ($matches[0] as $match) { // First, get title preg_match ("/<b>Blah1:<\/b>([^`]*?)<br\/>/", $match, $temp); $title = $temp['1']; $title = strip_tags($title); $title = trim($title); } echo "$blah1"; Thanks for any future help, if you still don't understand lemme know.
  7. I was hoping there was another way, as I'm trying to prevent them from direct download access. I suppose I'll have to find another solution for that then. Or use a flash player. Thanks for the help.
  8. How can I embed media that is located outside of my root directory? For instance: Public_html is my root, where "play.php" is located... 'Songs' is located up one directory from root. In play.php, <object id=mediaPlayer codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 type=application/x-oleobject height=45 width=300 align=absmiddle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95> <param name="FileName" value="../songs/music.mp3"> <PARAM NAME="animationatStart" VALUE="false"> <PARAM NAME="transparentatStart" VALUE="true"> <PARAM NAME="autoStart" VALUE="false"> <PARAM NAME="showControls" VALUE="true"> <embed src="../songs/music.mp3" autostart=0 loop=0 align="absmiddle" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" showcontrols=1 showdisplay=1 showstatusbar=1 > </embed></object> You would think that would work, but it doesn't. The path is correct. If I put a file (blah.txt) in the same folder and run and include, it works just fine.
  9. If for instance your login form saves a session variable such as 'username' you could always do this: <?php $username = $_SESSION['username']; if !($username){ //display login form }else{ //display main page } ?> That's provided you want error checking. If you just want them to disappear when the form is submitted no matter if they have a wrong password or such you could: <?php if ($_POST['submit']){ //display main page }else{ //display login form } ?>
  10. That seems to work just fine but now nothing happens. My file won't upload. I'm starting to think it is my webserver's settings. Any idea what it may be? EDIT: Got it working by adding this to .htaccess: (Thanks for all your help!) php_value post_max_size 80000000 php_value upload_max_filesize 80000000 php_value magic_quotes_gpc off
  11. Okay, thanks for the code Bit faster + cleaner. Anyway, I still can't upload and am getting the "wrong file type" error even though it is not the wrong file type. <INPUT TYPE="file" NAME="userfile> Browse > song.mp3 > Click upload..Loading.. "your file type is not a sound type"
  12. Having a bit of trouble. Even when I use a simple file upload script, it loads a while like it's uploading but the file never ends up in the directory. Anyways, I made my own "wrong file type" check. It's poor coding I know, but for whatever reason when I try to upload an mp3,avi,etc, it triggers this still: if($_FILES['userfile']['type'] != "audio/mpeg"){ $fileis = "wrong";} if($_FILES['userfile']['type'] != "audio/x-ms-wma"){ $fileis .= "file";} if($_FILES['userfile']['type'] != "audio/wav"){ $fileis .= "type";} if($fileis == "wrongfiletype"){ echo "Wrong file type. Only audio formats supported."; Any help towards this would be great.
  13. After you update the database, you could register a session variable. Then do an if before you update to check and see if they've already did it. if( !session_is_registered(dbupdated)){ $sql = "UPDATE table etc.."; session_register("dbupdated"); }else{ echo "Already updated info."; } Not sure how secure this is, but it will help when they Refresh the page too, also causing the db to be updated again.
  14. This function is for selecting a random image out of a group of them, correct? So your "group of images" is in the rotate/ folder? Also, you can leave the first backslash off, so it would just be '/rotate'
  15. You forgot to change: // Make this the relative path to the images, like "../img" or "random/images/". // If the images are in the same directory, leave it blank. $folder = ''; Probably to- $folder = 'rotate/images/'; Or whatever folder you are pulling the images from. Or are the images in the same exact directory?
×
×
  • 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.