Jump to content

monkeytooth

Members
  • Posts

    1,129
  • Joined

  • Last visited

    Never

Posts posted by monkeytooth

  1. Ok, say a user on my site passes a URL in a comment hand typed no HTML tags of any sort wrapped around it.

     

    http://www.example.com how can I run through the string that is the comment they made and catch the URL and wrap it with HTML myself to make it a link? Is there some time of regex I could use in a preg_match() or something that would catch virtually any form of URL from just ending with a domain extension to ending with a line of variables either the good ol fashion blah=variable or MVC style example.com/blah/variable (with or without a trailing slash)

     

    ive tried google for a bit but I guess maybe if something exists telling me a good means of doing it then my search terms are off, cause I can't find anything appropriate telling me even where to begin on the concept.

  2. I'm going to go out on a limb, though I'm not going to say with certainty that this is the case. But.. It is 1 of 2 possibilities in my mind (even if I am wrong). But it could be either a browser setting, which that setting doesn't encode properly or handle the data as you would hope. Or.. in a similar notion the way the page is expected to be say you have UTF-8 en-US as the format for the browser.. it could be messing it up there to. I wont say quote me on this, but its worth at the least looking into.

  3. Ok, this is my query..

     

    SELECT email FROM memb_loginInfo WHERE email IN ('".$email."') ORDER BY email ASC

     

    Which if I run that through phpMyAdmin I yield 5 results, even running it through my script I am still yielding 5 results as per echoing out the num_rows tells me. But when I try to loop through the output arrays worth of data I can only get the first result. I have tried for, foreach, while to no success. Only thing that outputs anything is the foreach. Yet I only get one.

     

    						foreach($row as $found)
    					{
    						//echo $found;
    						$outputArray['output'][] = array('name' => "none", 'email' => $row['email']);
    					}			
    

     

    Where am I going wrong here?

  4. problem one to your pagination is your querying all results.. you should LIMIT the query and have the LIMIT be set dynamicly through variables.. so it can pull sets of records that would match the page..

     

    say you wanna show $x per page.. 10 for example you have a variable there.. then for your page LIMIT variables you should have a divisible number of 10.. so 1,10 would be your fist limit on page one.. so it will pull records 1-9 off the top of the db, then page 2 would be 11,20.. and so on.. it involves math.. I know you hate math lol.. Also cause you might not always pull 10 results you need to have your loops break should there be less than 10.. 

  5. Ok I have a hand full of Arrays

     

    I have one that is built based on one query. That has name, email in pairs its a 3D array example

     

    Array(
        [Errors] = none,
        [listed] = Array(
                            array(username1, email1)
                            array(username2, email2)
                            array(username3, email3)
                            array(username4, email4)
                            array(username5, email5)
                            array(username6, email6)
                            array(username7, email7)
                        )
            )

     

    Off that same query I have another array that is just the email address's that I use to query my DB for to see if they are already in that DB.

     

    array(email1,email2,email3,email4,email5,email6, email7)

     

    I am querying my DB using the IN() function base off the emails in the second array shown above. This query will return email addresses already in my system. Now what I am trying to do overall is create 2 separate arrays. One that is a list of the username/email that's in the system the other that's a list of the username/email that's not in the system. Anyway the first array set I shown is the array I have to ultimately shuffle around.. I'm guessing something as simple as just removing any given array that's a matching email for already in the system leaving whats not in that array behind and using that as my "not in system" array. However it being a 3D array like it is I am stuck as to how I should approach this obstacle so I can remove the sets of data as needed and push them or whatever into another new array. So here I am looking for ideas and suggestions.

  6. Alright so I messed with the idea of IN I am liking it. So I guess my next question is would it be wise to do 2 similar queries.. one IN() one NOT(IN()) so I can form essentially 2 arrays of people found, vs people not found or would it be wiser to just do the IN() or the NOT(IN()) and then wok with the array via php comparing whats found/not found to the array i formed to make the initial query with

  7. Ok, I'll stop putting it into "book" terms.. with mention of products..

     

    What I am ultimately doing is getting peoples contact lists, gmail, facebook, hotmail, aol, etc.. I am getting a list of email address's or in FB's case ID numbers. Where those lists can be fairly large. What I am I really trying to do is take those lists and compare them to a table in my DB to see if theres anyone in my DB (or not) with the same address/id. So people can say hey I know him, I didn't know he used this site too..  Problem is those lists can get very large, I know I can trim the size of the list down to whatever I want but more or less I feel the more the merrier. I also know looping through a DB 500+ revolutions on a per id/email basis isn't the best idea either, chances are high I will crash the DB time and time again when those numbers reach a certain point and more so if there are enough people on the site doing it at once. So that's it in a nutshell no more  obfuscating in a sense of speaking what im trying to do by using something I find more people on here relate to..

  8. Ok so I'm not sure how I would use that, or if that really applies. I'm going to take 1 number up to 500 or more numbers and for a list. So would I do it something like...

     

     

    $myVar = 1000,5020,6060,8888,9893; //where this var can be up to 500 or more number sets easy.. 
    SELECT productID FROM myTable WHERE productID IN ($myVar)

     

     

    Will that return an array or something where it says true/false per number from $myVar

     

  9. Also worth mentioning is I am checking to see if the numbers still exist or not. If the number does then I want to dump numbers found in the DB still into one array, and then numbers not found anymore I want to dump that number into another array..

     

    Is a query like Im attempting to do even capable of that or is this something I have to literally query the DB 1-500+ times per poll.. I can't really picture that being highly optimized so I am hoping for the latter..

  10. Whats the best way to handle a query that can range from 1 to 500+ OR's.

     

    Ok what I mean to say is.. I have a dynamic query that is checking my DB for active products. I want to take any random set of product numbers which can literally range from 1 number to 500+ numbers at a time. So that said I am creating the dynamic aspect of my query via PHP but I am wondering is there a better way to query. 1000,5020,6060,8888,9893... then below snip

     

    SELECT * FROM myTable WHERE id=1000 OR id=5020 OR id=6060 OR id=8888 OR id=9893

  11. Ok, my title for this post not so clever. What I am doing is exploding a string which is an email address. I am blacklisting certain domains like "craigslist.org", "dispostable.com", "mailcatch.com", and so on..

     

    So I might be a little fried as its been a long day.. and I can't think of how I want this handled..

  12. Some of your problem is in another file I believe from quickly glancing over your pastebin...

     

    there is a function valid_special_form() that your coder is telling all data that is posted from the form to go into..

     

    which is likely somewhere in one of these 3 files..

    include("setting.php");

            include("class.phpmailer.php");

            include("system_function_files.php");

     

    how it handles in there I don't know. But I believe at least thats where the (not )required parts are..

×
×
  • 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.