Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Everything posted by birbal

  1. Its depend on type of game you will use and the user interactions frequency and user number. eg turn based strategy/RPG game would not take same overhead as a real time FPS game.
  2. that code is running fine on my machine.
  3. birbal

    mail()

    check return value of mail() to see it is successfully accepted by mail server or not. if it is your localhost you need a mail server running on it. if it is running a mail server check the spam folder of your reciving email. if still you are not getting any email check you mail server logs.
  4. that is html comment. you need to place any php code inside php block <?php ?> to get executed.include is php code. DW may be handy for using but it is not best if you are learning things. coding from scratch could be tedious but its worth the learning.
  5. how did you run the code? how did you include the file? what does it show when you run?append on top ini_set("display_errors",1);ini_set("error_reporting",E_ALL); it will enable error reporting if it is not already. also it is best to avoid using dreamweaver. get a decent text editor like notepad++ or IDE like netbeans
  6. birbal

    session problem

    no, only stores the key in database. as you have already a username column separatly already. the combo will be stored in cookies only. php will split the combo to key and username and it will make query in database,
  7. it is possible to load a site in "canvas" and send its pixels to php. when you get the pixels you can use php gd function to construct a file and save it. https://developer.mozilla.org/en-US/docs/HTML/Canvas/Drawing_DOM_objects_into_a_canvas
  8. birbal

    session problem

    storing it in user table should be sufficient. as each user can have only one remember token (if you are planing to remember user in only one machine)
  9. birbal

    primary keys

    what does uniqid refers? if it is mean to be id to identify something uniqly then you dont need to set seperate column for ids. purpose should be clear though for each field. if you dont set auto increment in case it encounters same id in database it will throw error. if you don auto increment it and it encounters same id it will incerement by 1 from the largest id it have in the database.
  10. that is why it is best to use text editor with syntax highlights which is effective to detect this kind of mistakes.
  11. I don think so. i belive what they mean is, you can't use their materials to create another tutorial site,
  12. birbal

    session problem

    first you will extract the characters of encrypted username. how you will extract will be same way you did compact it. the hash of key length is fixed. so if you append or prepend the encrypted username you know already where to slice the string to get apart the encrypted username and hashed key. once you extract it you need to decrypt it. when you decrypt it it will be same as plaint text username as you have in your database,for encryption and deycrption you need to use mcrypt http://php.net/mcrypt
  13. mysql_connect() returns db resource. mysqli::query() returns result object which is not same as mysql resource. different api returns different object like PDO::query() would return pdostatement object. resource and object are two different data types in php. resource and object are two diferent data types in php.
  14. why do you think you need a temporary table in database? you can store the data in table when user request a product first time. everytime user request same product you will query the db if product exist fetch and serve it else get XML from 3rd party populate db and show it to user. after you store them in database the filtering the result is trivial (using WHERE clause to limit the result) but yes that would need a ajax call to do it dynamically. if you do that in js you dont need to recall the api if you are getting the super set of the data. you can filter it dynamically. best way depends on the structure of data which you will recive and work on.
  15. birbal

    session problem

    you need both username and a key (remember me token) to autologin user. you can encrypt your username and prepend or appened or mixed up in the key (key is hashed key). username=jimfogencrypt username= SOMEENCRYPTEDJIMFOGkey= hashedkeyoftokenotherthanpassword key which will be set as cookieSOMEENCRYPTEDJIMFOGhashedkeyoftokenotherthanpasswordorhashedkeyoftokenotherthanpasswordSOMEENCRYPTEDJIMFOGorslice and mixup the string to prepare different key what you will do is when remember cookie is set you need to take out the encrypted username and decrypt it and check that username and key combo in database. if match found pull all of user data and initialize session as authenticated user. hash is one way encryption. so you cant get back user name from hashed username which you will store in cookies. the problem with random number with remember me key is number has low entropy than alphanumeric hashes. means easier to guess.
  16. best exersie would be making web pages on your own. start with simple layouts page and gradually go harder. along with niche's link try to use w3schools html tag+list as references. html is simple, you just need to know which tags are for which purpose. there are many tags that you will barely use. with some simple pages you will definitely catch up the common tags used in web page
  17. as much you will touch the DOM it will make the script slower, so thus will make UI unresponsive. falling snowfalls and twinkling starts has alot of particles to animate at the same time would be expensive. for this kind of fine grained animation you can use https://developer.mozilla.org/en-US/docs/HTML/Canvas . will not interfere with DOM when you animate, orCSS3 has animation capability https://developer.mozilla.org/en-US/docs/CSS/CSS_animations . css animations are optimized for better performance. though both of this options limited to modern browser. on a sidenote, if you are trying to add this animation in websites background, it will not be nice idea. over fancy background will take much attention of the user to background rather than the content. background should be used to set contrast among the blocks of document so that it can emphasizes its content or opposite.
  18. birbal

    session problem

    when you check a existance of cookie you check that token against database like thescientist said. and prepare session data at same place if credentials match, before the redirection. remember cookie is set that does not mean that the user is authenticated.
  19. birbal

    PHP browser close

    using it twice is redundant and it will throw a warning. when php encounter first session_start() it initialize new session or resume to previous session.
  20. it has been proposed earlier and got rejected. what is the problem with forum?
  21. birbal

    hashing the username

    identifier should not be plain text like username,user id etc it should be properly hashed.cause it will be easily guessable and manipulable. it should not be same as you hash your password. hashed password and hashed identifier for persistent login should not be matched.
  22. how your data is stored? is it any providers API call which returns XML file or it is a database? If it is database you can sort or filter using "ORDER BY" and "WHERE" clause. but in this case you need to make a request to php file each time. if you want it to do dynamically you can use AJAX with that. but still it will send a request evrytime to your server. if it is xml file you can also use XPATH to filter out data from XML documentResource:http://php.net/xpathhttp://w3schools.com/xpath If it is not an API returned XML file and data is arbitary and large and it is possible for you to use any database, sthen database will be better option for this. as databases are optimised for this kind of sorting and filtering. otherwise you have to implement those on your own to get that level of efficiency. Also if it is API call from 3rd party server it is best to cache it in your server in any persistent storage rather than calling their API every time. If you are worried about performance you can use memcache which can cache results to reduce database hit.
  23. you have to use javascript for that. if you have arbitrary number of items you should use ajax to get product info. if the list is short and fixed you colud populate data in JS and use it. for doing this you have to use JS DOM where you have to bound a callback function on onchange event on dropdown list.
  24. is there any list of avaiiable devices and there resolution and aspect ration categorised by all device type used in web browsing like desktop,mobile,smart fone,laptops.netbook ,iphones,tabs etc
  25. one way could be using php scripts to generate the text file with list of mp3 file name.you can use glob() to get the file from a directory and the use file_put_contents() to write it to file. you can also use pathinfo() to parse the file name from the location of the file which is retrned from glob() reference:http://php.net/globhttp://php.net/file_put_contentshttp://php.net/pathinfo
×
×
  • Create New...