Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Everything posted by birbal

  1. looks like you are using $passhash in place of column name. though your code looks ok. you can dump the query to see how does it look. also you need to quote around $passhash as it is string
  2. you need hash the password when you check for user credential ,in same way as you did the time of the registration. $password and md5($password) is not same. now the password is store as hashed of $password. BTW MD5 is not secure anymore you may like to check other alorithms like blowfish,whirlpool.
  3. Sorry, I misinterpreted your question. http://stackoverflow.com/questions/958997/frame-buster-buster-buster-code-needed here some discussion regarding preventing this. Still it is not full proof.
  4. when any site try to open your site it will get the html structure of the site. it will get the iframe literaly (html code), it wont get the iframe source automatically like browsers do , thus it wont make request the increase counter. But as already being said there is no full proof way to stop it. anyone can study your site structure and figure it out which iframe or img tag is making request and then can parse the source and make request to the source. As already being suggested it will be best way to keep track of IPs to figure out the unique users.
  5. what do you mean by "escape from iframe request" ?
  6. birbal

    registration process

    It is not possible to have same email account for two user so if a user is already registered ans same credential is used to registered again you would ask them for "forgot password" instead of let them register again. even if you use nick as credential you would not want to have same name for two user that would be an identity problem. To avoid that you can set those as unique or primary key constraint.You dont have to check for existance of credential you can use normal INSERT if it is violating any constraint it would throw error. You can catch those error code (Each error type have different error code, see mysql error code page) to detect primary key/unique index violation and show user a error message. If you have more than one primary key or unique column which could be violated in the process of registration you could even parse the error message to detect the column name which is being violated. Error message in mysql follows one specific syntax eg "Some violation is occured in %s column". It would not be hard to catch those column name using regex or by any other way.
  7. birbal

    Get data from internet

    Yes you can, there is several ways of getting data from the net. It sounds like you are trying to get textual data from a html page, in That case you can use DomDocumentt to fetch document over 'http' . If your server has http wrapper disabled you can use cURL to fetch the document first and after that use DomDocument to parse it. http://php.net/domdocumenthttp://php.net/curl
  8. what have you come up so far?
  9. "how large" is relative. It is dependable on how many connection/second your host allows, how many request are made per second and how much time it takes to process each file.
  10. you have to do it manually InnoDB does not know which id from parent table you are trying to referenced in child table. Though InnoDB will ensure every time that the id you have passed in child table have a reference of it in parent table.
  11. what features are yoy looking for exactly?
  12. You can use cURL to fetch a page in web or you can even use domDocument to parse html files. But you need to cache the result, otherwise if you try to fetch multiple site on each request and update your page , your page will be slow. But as download counter is so dynamic it wont be much benificial to cache the data if you want something in real time.
  13. Though connection will be closed at the end of the script it is efficient and good practice to close the connection when you dont need it. if you have quite large processing php file which takes some time to process could make alive the connection. in traffic heavy site which could hit the connection limit provided by shared host.
  14. you need to look for php and a dmbs system like mysql. Any interaction with server needs a server side language
  15. MD5 and SHA1 both is not secure anymore. SHA512 SHA256 from SHA2 family, Blowfish(as already stated), Whirlpool etc is preferred way. . PHPass is good. but there is also native function http://php.net/hash for using different algorithm.
  16. Yes you need to specify server name and port of mysql server instead of localhost. Also you need to set up firewall so that it dont block transaction over port which is used by mysql server
  17. you can use 'where' clause to get particular id and you can specify the particualr fields by comma separated field names.
  18. One part of PHP tend to make messier code than java counter part, is lack of function overloading. As PHP is loosly typed language so that it has not any method signature so overloading a function is not possible technically. (PHP has method overloading but it is conceptualy far away than c++/java overloading). Still you can make a function act in multiple way like checking the parameters and act upon it. but as the polymorphic feature of a function grows its become tedious to maintain. though it is possible to encapsulate the behaviour in seperate methods and call the methods depends on parameter condition. But it looses its polymorphic features (one name different behaviour). you need to modify the calling function as well as encapsulated function. Where as in java you can use same name of method with different signature to do different behaviour. all of the overloaded method then have one particular task at a time with same name. If you need to have do different task for same signature, probably there is something wrong and it needs a new method to handle the task. It is something unavoidable in php. Convenience comes at cost for loosly typed language.
  19. In that case you need to look through basic php and mysql first to get ahead further. check through the tutorials
  20. Yes you can do it with php mysql. the particular feature you described called pagination. we need to know your current skill level to suggest best way to acheive your goal
  21. You need to set up table to store session data. you need to use session_set_save_handler() or sessionHandlerInterface to override default session handling. by default sessions are stored in files and they don't associate with any user id or time. you need to set up both refference to user id and timestamp so that you can get the logged in user list of certain time span.
  22. yes it may be non-beginer book but is not not either too advanced in the term of explanation of author. It did explained everything in depth and simpler way. I did not read the 'Beginer Javascript' book so i can hardly comment on that. If author is recommending this then probably it would be best suitable one for absolute beginer.. Though to quote the book
  23. I used netbeans from the very begining and i am used with it. Most popular two are netbeans and eclipse.Among those choice of IDE is personal perfrence http://en.wikipedia.org/wiki/JavaOS here you can read about OS written in Java
  24. Every Programming languages almost capable of solving every problem. What you can do with php you can do it with java or any other programming language. Java is strictly Object oriented, as it is managed language the API of it consistent object oriented manner. One benifit with java is it is not limited to web programming. From the begining it is tend to evolve as OO language for multiple enviourment or platform. For example if you want to handle a file the api is same for applet,servlet,desktop (clientside) application,mobile application. Other than that java comes with lots of thing with core package which is very helpful. It is kind of one language for all purpose. It has larger scope and use context. Where as PHP was started as template engine which now evolves as OO language. The benifit with PHP is it is very convenient to use,it scales well, it has large community. Though recently PHP also coming up with GUI desktop development but the community is very little for now. I,myself fond of php and was using it past couple of years and i loved it alot. but recently i am leaning toward java. I have started with JAVA SE and doing some GUI stuff so i have not much knowledge of JSP (which comes withinh JAVA EE) itself for now. but soon i am going to catch it up. I had to do Java for my study and i am liking it. so if you are planing to go both desktop and web programming then going with Java would be good.You need to look into basic java se too to work with JSP. If you want to just start right away and/or only focused in web programming then php would be the good choice. Both language has similarity with c/c++
  25. did you try var_dump() $li to see what is it actually?
×
×
  • Create New...