Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Everything posted by birbal

  1. image*() has a option to specify a file name location to save the data in file. if it is not decreasing size as you want to. you can increase the compression levels. croping the images into smaller resolution also decrease the size of the image. the php page will be same as other php ,difference is it only serve image. so you can use $_GET as you used to with other html outputing page.
  2. you have to make separate page for this which you will link to src attribute of img tag. you cant send two content type header for one page. the error is showing cause it already sent the headers with the first output of the text whixh is by default content-type of text/html. so you cant sent image headers again
  3. I am refactoring codes of my previous projects and combining and arranging the previous library for my own framework. It has grown enough that can i reuse in later projects. apart from that i am planing for a project management application. it is now on very early stage. just writing the requirements and planing and collecting information, have not started actual coding.
  4. birbal

    2 tables or not?

    footballer and basket baller both are player. you can think it them as subclass of player. if footballer and bascekball player objects share same attributes for now so you can put them in one table as considering player of different types as ingolme sugested, distungiusihing by an enum field. if footballer and bascket ball player has more attributes rather than common attributes of 'player'. i would split two more different table for footebller and bascketballer where both table will hold specific information about footballers and bascket ballers. and both will link up to the the 'player' table. 'player' table will hold the common attributes. It will help you to make scalable database which can grow later. so that near future if you want to add more type of players or add more attributes to existing one. you dont have to change much of you existing database structure. so it depends on your application. it may be overkill for small project but will be effective where project is large or has oppurtunity to grow larger.
  5. http://in.php.net/manual/en/language.operators.assignment.php its concatenate an operand and then assign it to another.
  6. it means Search engine optimisation http://wikipedia.com/SEO. semantic code will help the bots to fetch your site more efficently and effectively so that your site can be indexed well in search engines
  7. set 'display_error' directive to 'true'and set error_reporting to 'E_ALL|E_STRICT' either you can set it with ini_set() http://php.net/ini_set or editing your core php.ini file and restarting your server. (recomened if it is your development server)
  8. yes. they dont bother how your site is coded as long as you dont break their any TOS. you need to use semantic code so that you can work with Javascript and for SEO purpose mainly.
  9. there is option for that already. if you visit anyone's profile there you can find a option to find there contribuution in forums. though as far i know now this function is not working for problem in board search engine.
  10. remove the @ error supressor oparator. and make sure display error enabled for all type of errors.
  11. birbal

    Session

    you can have one session cookie at a time for particular browser. so that it can point only one session at a time. the session id refers to the file stored in server. file holds the data. data is stored as serialised data (you missed the boen's post) by default. php decode encode it and populate the $_SESSION super global array each time automaticaly. you dont have to do anything after it populates that array you can treat it like other array. http://php.net/serialize <= serialize manual to get idea how does your data will look after serialization php.ini does define configaration of php that how does it work. There is nothing called index which is defined in php.ini where are you finding those terms? there is nothing called that called file variable. It by default saved in temp folder. you may find those there. but you dont need to see those files to work with session. php will do everything under the hood. you have tojust work with $_SESSION as you work with other array. to see data of it you can var_dump() or print_r() it.
  12. you can't run php files without installing php. IIS is webserver which can serve files no matter what it is. if your server is running and if you put any html file in web root eg index.html it will show that. installing php means when anyone request a page with .php extension php interpreter will execute it nd then iis will serve it.
  13. birbal

    Renaming files

    $filename=time() . '_avatar.png';
  14. birbal

    Ajax

    we need to see the codes and error if any is there, to help you
  15. birbal

    Session

    anyone of it Which will occur first. cookie is just some name value pair which are stored in client computer. the 7 parameter has different purpose which is stated in the manual. It does not matter if session cookie exist or not in client machine, if the session data itself get deleted from the server. there will not data there what session cookie can point to. one case is when session data in server be deleted automaticaly by session garbage collector after certain amount of time (15 minutes by default) or any implict deletion of the session file or database. GC check for which session id does not get updated in 15 minutes and delte those. at that moment session cookie may be still there as you did not closed the browser but as there is no data in server you lost your session. another case when browser is closed or tab is closed session cookie will be deleted but session data in server still may exist which will be auto deleted by GC after specified amount of time. as that time you dont have the session cookie you lost your session.
  16. string fields should be quoted. here 'demo' and 'this is a demo for the demo of demos' should be quoted. and addslashes() is not good enough to prevent sql injection. depending upon your database API you are using, you can consider to use mysql_real_escape_string(),mysqli_real_escape_string() or prepared statements
  17. the line it is pointing is not the number of php.line it is number of line which passed in mysql server. did you try printing out the query how does it look?
  18. unfortunately i don't understand that language whatever it is.
  19. why don't you try that answering it yourself first? they are willing to know your point of view. as per designing concern each of us view and opinion will not be same. what do you think about those question?
  20. birbal

    OOP and MYSQL

    yes that is why i was telling you to check the PDO and more specificaly fetchAll() function. fetchAll() will return the array of person object. you dont even need to loop through or manage another class for doing it. collectPerson is not a different entity it is just array of person object. it is not more complicated than that. and mysql api is already obsolete now. you should switch back to mysqli or PDO. PDO loads from the dll so it will not make any effect on your performance.
  21. birbal

    Session

    Yes if you close the page or tab the session will be lost It is 15 minutes by default. but it is configurable. if you lookn into the tutorials you will find a function session_start() it is what recive the session id (via cookie) if session id matches it resume to that otherwise it creates new one. Yes you can store it in database but that is not common behaviour of session handling. you have to override its behaviour using session_set_save_handler() function http://php.net/session_starthttp://php.net/session_set_save_handler
  22. birbal

    OOP and MYSQL

    The problem is you are not asking the right question. if you specify the class name the object will be the instance of that class. so if you pass 'collectPerson' with PDO::FETCH_CLASS it will be object of collectPerson. As per view of the design of the classes your collectPerson class is doing nothing about but the person object. how about storing those objects as array of person object? that is where array meant to be used. It is issue with your class design. it would be better if you put the getPerson() in person class and use it to fetch person data. I dont know what else to stay. i cant even show you some example or work toward further with PDO as you have not provided any codes with PDO yet.
  23. birbal

    Session

    a session cookie's lifetime is by default till the browser did not get closed or closing the page. in web application your server does not know who you are. they keep track via session. session get you recognised through a active session in various pages of sites.php.ini stores the setting of session that how will be session handled. session ids are different for different user so they will point to different data sets for different user
  24. birbal

    OOP and MYSQL

    Yes it can.it will assign the properties by the column names of database. So any memeber is previously declared as private it's visibility will be still same. if it does not exist new member will be created with public visibility. What do you mean? the data is already coming from your database rather than getting it in array by looping it. you can use fetchAll() which will return an array of of the object of the specified class.
  25. https://developer.mozilla.org/en/DOM/Storage dont want to make you confused but so that you know, you may like to check localstorage too. it is same like cookie (store name value pair) but does not go back and forth with every page request. it is new in html5.
×
×
  • Create New...