Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Everything posted by birbal

  1. birbal

    php

    you need php and apache server or packacge like wamp/xampp/lamp installed on your mahicne to execute php script
  2. You can store session data in database where there will be timestamp of last time update. after that getting last 15 minute would be trivial sql query. Check http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCsQFjAA&url=http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Fclass.sessionhandlerinterface.php&ei=jd_nUfSjAcW8rAfjv4FI&usg=AFQjCNFC98sy68egSNGfVuZkaDRxQ3G6mA&bvm=bv.49478099,d.bmk . APC would not be necessary for this.
  3. here, $imagedata is an array. you would like to pass the binary data (specify the cloumn of the image data) as param which probably is $imagedata['image'] also that particular function returns a image resource. echoing it will not show up the picture. you need to use http://in3.php.net/manual/en/function.imagejpeg.php or any variant of image*() which is dependent on image type. If your scripts generates any error before the image get displayed it would send the default header already. as header can be sent only once so next time if you try to send header again it wont send it. You may like to read this for header related problem http://w3schools.invisionzone.com/index.php?showtopic=44106#entry245750 Even if you pass the correct header when you display a image there should not be any data other than the binary data, otherwise image will be corrupted.
  4. There is many way to persist data. You can use database,flat files. there is APC,memcached like extension which can store data in memory to share data between request. which one will be better is depend upon what you need to do actually.
  5. birbal

    contact form

    Server will always response in regular HTTP response. Like HTTP code 200,404...etc. Whether a 200 response will have data or not (like confirmation message or any other data) is depend upon the developer. But no matter it returns data or not the HTTP request from ajax form would change the data in server already. Ajax does not forces page load. In regular HTTP request browser parses the response to render it. so it get restructured (page load). Even a blank page will have HTPP response. Where as in AJAX browser does not parses the reponse to display it. instead it resides on a memory to be handled by developer. You can use any HTTP debugger to see the data going back and forth in server-client.
  6. birbal

    contact form

    You can override default behaviour of a form using JS. Form field will have the data , It is reponosibility of coder to collect the data and send it to server and block default bhevaiour of form. Other than that ajax is like reguler HTTP request, except it does it in background so it dont reload the page.
  7. i dont think mysql_error() will work properly with mysqli extension. First step would be to use mysqli_error() to pin point the problem.
  8. '@' is used to declare variable and ':=' for assignment. as '=' is already used as comparison operator in SQL and alpha numeric identifier is used for database scheme like table name,database name,column name they needed to be identified differently.
  9. birbal

    upload many files

    To add file field dynamically you will need JS to manipulate DOM. and to handling those file to upload it on server read http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCsQFjAA&url=http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Ffeatures.file-upload.multiple.php&ei=u2_aUcauBcnMrQecyoD4Bw&usg=AFQjCNEKR_fAIoAyk86Hgl6ftXQpii-2Xg&bvm=bv.48705608,d.bmk
  10. You may like to read this http://w3schools.invisionzone.com/index.php?showtopic=44106&p=245750
  11. birbal

    triggers question

    Why not just verify the data in serverside language and if it is empty update column value with null?
  12. When i started PHP i have not gone through it in formal way and started quite random. I , myself learn fast by doing things rather than just reading. So i picked up a project that was far more complicated than i have skill to do that in that time. I stucked and I learned. That project was semi complete after giving several hours (in other word you can say it was failed) but i dont think it could be replaced by anything else that i learnt from it. I read some free ebooks and resources in net at srtarting time . But I had familiarity with general programming as i do study in formal computer science and I knew what i was doing. Later i got some ebooks (some of orielly) on php and that was very helpful. When any question arises i reasearch on net and read. I frequently check php.net site. That site is a book itself. Even i have downloaded copy of the php Doc which i read frequently. Being involved in programming forum is also helpful for learning. even helping other problems and reading other's codes sometimes can be learning experience. Also there is possibility to get corrected by senior programmer if you have post any wrong information which is also learning experience.
  13. I dont know how that specific appliction internally works but You could store the those data in config file. Config file can be in any format like ini,json,xml,yaml. You need to just catch the data submite by user and manipulate the config file with simple form handling. When you will need the data for connecting database you will consult to the config file to get appropiate data. I would not directly edit php file for configuration. There is php.ini setting for storing database credential though that should not be used because it can expose the credential via phpinfo(). Also your config file should not be publicalyy accessible and should be kept on outside web root for security reason
  14. birbal

    What is var $this?

    $this->name tells to get 'name' property of current object. You neither have any class defined nor it have any property. You need to define a class first. Only class methods can resolve $this, functions can not.
  15. birbal

    What is var $this?

    It is special variable, instance variable. It does reprerents the object itself when used inside object context.
  16. http://www.php.net/manual/en/book.strings.phphttp://www.php.net/manual/en/refs.fileprocess.file.phphttp://php.net/spfileobject
  17. birbal

    What is raw ?

    There is no data type like that in php. You may be refering to other thing?
  18. What error message are you getting? How is your table is structured? If your table have primary key or unique key in any columns. InSerting duplicate entry to those column will throw mysql error. You can use mysqli_error() to know the actual mysql message
  19. birbal

    display datetime

    Php date() will use timezone set up in the server when displaying date. You need override the timestamp to show time for other timezone. Where as the right bottom corner shows local time set in your machine.
  20. Which forum are you refering to?
  21. Which forum are you refering to?
  22. birbal

    PHP CODE

    Have you tried it? If you are getting error post the exact code and error you are geting.
  23. birbal

    Confusing Regex

    [] it is used to declare character class. Character inside it will be used to compare individually. ^ is negate character if used inside character class. Means [^f] will try to match any character other than 'f'. [^\]] it tells to match any charcter other than ']' as ']' character itself used in charcter class so it needs to be escaped. Hence '\]' used. + is quantifier which tells to match for 1 or more characters.
  24. Sounds perfect. though 3rd and 4th point could be interchanged depending upon the priority (frontend or backend). Adding any leading framework of any server side language to your list will make it more complete. Apart from languages general programming techniques like OOP design,algorithms,datastructure will be helpful. Your CS classes probably has included these all. Photoshop is not essential for web development. it is possible to develop full featured site without photoshop. Best of luck for your journey!
×
×
  • Create New...