Jump to content

phpsycho

Members
  • Posts

    164
  • Joined

  • Last visited

    Never

Everything posted by phpsycho

  1. Okay so I am trying to add api functionality to my website so people can develop apps for it and what not. Well there is one problem I came across.. when you want to retrieve the user currently logged in information you need the php session cookie value and then set the session id. But.. sense this application is offsite then the session cookie is not in the header because the session cookie is set on my website, not the app developers. How can I get the users information that is logged in offsite?
  2. hmmm is that even a good idea? I mean it would take forever for it to scrape those sites sense I have to connect to every link.. Any better ideas?
  3. Okay so I am scraping websites for their descriptions keywords and titles. I noticed that a lot of websites use the same keywords and descriptions on every page.. so my idea is to scrape the index and find all the links in there and scrape them all then after they been scraped check all of the descriptions and if the descriptions match then pull some text unique to each page and use that. I can't seem to wrap my head around it.. how would I accomplish this? I scrape with curl then find keywords description and title then find all links on the site and scrape those. soo I was thinking making an array of the descriptions and then checking and inserting to the db but doesn't seem like it would work. Any ideas? Oh also.. how would I grab just text from each page that is different from every other page? lol very confusing
  4. huh never mind lol sorry it works now. -"word1 word2" I didn't realize what I was doing wrong.. keywords don't get echoed out but sense I am actually trying to filter out zoophilia content I searched for = "animal sex" and stuff showed up but not all had "animal sex" in the title or desc soo I thought okay if I then filter out -"animal sex" then I should only see those other results without those words in the title or desc. wrong of course lol basically just didn't think it out well, I was searching and filtering out the same thing Thanks for that link though, probably would have taken me a while to figure out there was a min char limit.
  5. Ah! okay thanks! Only question I have now is how do I combine two words? like I said before.. -word1 word2 -"word1 word2" -(word1 word2) all don't seem to work right. Any idea?
  6. wow this is like the strangest thing I have seen.. It just totally ignores the word sex. I put the word sex in each the title desc and keywords and then the $banned var like this: $banned = "-sex -Sex -SEX"; still shows the results containing the word sex. But like I said before -porn will remove all results containing 'porn'. I also tried just matching `title` or `description` or `keywords` and then against my keywords(search term) and -sex still don't work.
  7. huh.. found something odd.. if I use: $banned = "-sex"; it doesn't block out any results with the word sex in it. But.. if I $banned = "-porn"; it will block those. Whats with that?
  8. Okay so here is my query: $sql = "SELECT * FROM `search_links` WHERE MATCH(`keywords`,`description`,`title`) AGAINST ('$keywords' IN BOOLEAN MODE) ORDER BY `realdesc` DESC, `realkey` DESC LIMIT $skip, 15"; that works perfect but I get results that have inappropriate links desc etc so I would like to filter them.. I tried: $banned = "-sex -porn -anal"; //etc $sql = "SELECT * FROM `search_links` WHERE MATCH(`keywords`,`description`,`title`) AGAINST ('$keywords $banned' IN BOOLEAN MODE) ORDER BY `realdesc` DESC, `realkey` DESC LIMIT $skip, 15"; That works fine, but when I want to filter results with two words it won't work.. example: $banned = "-word1 word2 -word3 word4"; //doesn't work.. $banned = "-\"word1 word2\" -\"word3 word4\""; //doesn't work either $banned = "-(word1 word2) -(word3 word4)"; //and of course this doesn't work either.. soo I tried doing.. $sql = "SELECT * FROM `search_links` WHERE `title` NOT IN ('sex','porn') AND MATCH(`keywords`,`description`,`title`) AGAINST ('$keywords' IN BOOLEAN MODE) ORDER BY `realdesc` DESC, `realkey` DESC LIMIT $skip, 15"; and that doesn't filter or do anything at all.. How can I filter results inside the query? Thanks!
  9. I'll code it for $10
  10. Could you give an example? Sorry lol I feel dumb, but I don't really know what you mean by a nested set. hmmm any other ideas then maybe? I'm looking for the most simple, but works perfectly. I suppose I could use a pain in the ass method if I had to, but yeah.. rather not lol.
  11. Like I said.. I could just create like 5 tables (subcat1,subcat2,subcat3, etc) and then just add each id from each of those tables to the product table column `cat` and when needed I could explode or something.. dunno how I'd pull specific products from each sub category though using a sql query. Theres gotta be a better way... I just can't seem to find it.
  12. What would be the best way to do categories and multiple sub categories for a eCommerce website? For example there could be... Website templates => Flash => Portal => Music Computer hardware => Gadgets => USB => Fun Scripts => PHP => eCommerce => Simple Scripts => Perl => Search engine => Simple So something like that.. how should the database structure look? Also say I have a table called 'products' and a column called 'cat'.. if the best idea would be to create `categories` `sub1_cat` `sub2_cat` etc for tables then should I put each id of the categories into the column 'cat' and separate by comma? Then like explode that column when I need to grab each category or whatever? I dunno... lol very confusing, I just can't wrap my head around it.
  13. Okay fuck this then.. you guys help.
  14. He wants a starting place for his website, soo thats more that just a "oh just try this.." kinda thing. I answer questions that have to deal with one file or section of code publicly. This is different.. sorry if you don't like the way I am doing this, but it seems the most logical.
  15. I want a PM because it gets harder to communicate faster in forums.... soo I ask for a PM so I can get a instant messenger screename so when I am not busy we can speak faster and get things done a lot quicker. Sorry you take offence to that, but thats how I thought it should be done. EDIT: Also.. I'm sure he doesn't want everyone knowing his whole db structure and seeing most of his code. Doing that makes it a lot easier for hackers to attack his site by finding security holes in the code which would be provided right in this topic. Providing some code in the forums I find to be okay, but full db structure and what not.. that just seems too risky to me.
  16. PM me I could help you. Sometimes I may be busy, but for the most part I am free to help.
  17. hmmm using MySQL? Add another column call it something like "redirect". For each row set the redirect column to something like "http://website.com/client/area" then in the login file after sessions have been set use meta to redirect the user to their client area (the url found in "redirect" column)
  18. hmm dunno about Suhosin, but.. did you restart apache?
  19. Then what could it be? Also.. is it possible to hold data in MySQL on more than one hard drive and or server?
  20. They also use Cassandra. I wanna use Cassandra too, but I need a CQL driver for PHP.
  21. I am using MySQL to scrape tons and tons of websites so thats about 10+ queries executing every 2 seconds. Then plus there is people executing queries when searching, updating profiles, posting in the forum, etc.. So it got real glitchy where data recently inserted to the db wouldn't load until 5 refreshes. Sooo I am looking for a alternative to MySQL that is much faster and has the ability to have a cluster. Oh and gotta be free.
  22. Dunno how to categorize this topic really.. but I installed Cassandra and Phpcassa. Found out theres no way to do specific retrieval of data unless you know the key. So found something called CQL (Cassandra Query Language) its similar to SQL. Only thing is.. I have no idea how to execute cql in php. Is there some kind of addon that I need to install? and what is the function to execute cql commands? Your input is greatly appreciated. Its quite difficult to find info on this topic.
  23. You're welcome. be sure to mark the topic as solved. bottom left of the page.
  24. hmm never mind for now. I'm gunna get some rest and if the power is still on in the morning gunna try out phpcassa instead. Maybe that will be better and hopefully work.
  25. I set perms to 777 still getting errors... [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Warning: include_once(/usr/share/php5/Thrift/protocol/TProtocol.php): failed to open stream: Permission denied in /usr/share/php5/Thrift/Thrift.php on line 786 [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Warning: include_once(): Failed opening '/usr/share/php5/Thrift/protocol/TProtocol.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/php5/Thrift/Thrift.php on line 786 [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Warning: include_once(/usr/share/php5/Thrift/transport/TTransport.php): failed to open stream: Permission denied in /usr/share/php5/Thrift/Thrift.php on line 787 [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Warning: include_once(): Failed opening '/usr/share/php5/Thrift/transport/TTransport.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/php5/Thrift/Thrift.php on line 787 [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Warning: require_once(/usr/share/php5/Thrift/transport/TSocket.php): failed to open stream: Permission denied in /var/www/cass.php on line 5 [sun Aug 28 01:23:38 2011] [error] [client 24.63.100.20] PHP Fatal error: require_once(): Failed opening required '/usr/share/php5/Thrift/transport/TSocket.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/cass.php on line 5
×
×
  • 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.