Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Everything posted by birbal

  1. when it returns false it means that your mail is not accepted for delivery by mail server. make sure your email data satisfy the RFC standards. check here http://php.net/mail. posting the code would be helpfull
  2. birbal

    version to donwload

    It does not hurt to be stay updated. You wont see much of differences in language itself but in internal implementations mostly. 5.1 to 5.5 (check the last revision number) is minor updates. to see the differences you can always check the change log from official site.
  3. what problem are you facing? what is not working? how should it be working? hat is happening instead? any errors?
  4. check your apache error log that is where you can find the reason why your server is not starting. there is common problem of having a port conflict if you have skype installed. to be sure of the problem you should check the error log.
  5. there is plenty of host around. as for personal site you can start with any basic plan of any host. there is also free web host service which can handle personal to small business sites. but if you are is serious business go for paid one, they are quite cheap (you can get them around 2$/month) webhost service provider also have services for domain name registration. seperate domain registrar also is around here. TLD is available around 12$/year (as far i can remember)
  6. birbal

    ffmpeg

    you have to install ffmpeg(google it) and use that command through shell http://php.net/exec. check ffmpeg manual to see the use case of it.
  7. mysql user has privilages to do some certain action you will set. 'root' user has all privilages. when you use third party mysql database you are not login using root privilage. they set up you as user with lesser privilages. what happened is when your user uses your application they mainly query your database most and insert/update or delete. your user barely needs to alter table,drop table,creating triggers or stored procedure or droping database. so you set up a less privilaged user of mysql to do that interaction for your user, it reduces chances of having mischief with your database by mallicious user (they cant have access anyway to do sensitive action if they manage to get acceess to your database. some people set up different privilage for same application. like ordinary user should not have delete anything so you gave permission to them only select,update,insert. and give delete permission connection to mods or admin. basic rule of security in programming is giving as minimum permission possible to do certain job. this is role based authentication for mysql, when you set up database for role based privilage like setting flags, you are creating your role based permission system for your application not for your mysql.
  8. birbal

    services column

    when you set varchar type to a column it counts the character of each row for that column. deviding the service and service provider to different table is the best way. if you implode all the service as text in service provider tablle it will not be efficient when query will search through the data.
  9. what have you come up so far? what help you need? if you have not already check out the http://php.net/curlhttp://php.net/curl_setopt here you can find certain setting to make a request. check this seetings specifically CURLOPT_CUSTOMREQUEST, CURLOPT_POSTFIELDS if your destination login form is based on GET you can simply use file_get_contents() or DOM or any file handling methods (but remember they will be dependent to server setting of allow url fopen. using curl to make login is consider as privacy compromise, as user need to put password through third party server to get access to your university server.
  10. birbal

    true statement

    actually $_GET $_POST have assigned an empty array, not empty string. so isset() will always return true. if you want to check existance of an particular element of $_GET or $_POST isset() will work as intented.
  11. that boils down to the solution thescintist said. you can still use http:// without secure conection to get conetnts of the file.
  12. you can find sqlite example herehttp://php.net/sqlite or can use http;//php.net/pdo with sqlite driver. ajax examplehttp://w3schools.com/ajax as jsg already said ajax is for just requesting the page and getting the output. it does not matter how does you make your output, it could be mysql generated or sqlite or just plain text. check the ajax tutorials. first make a usual script that will use sqlite to generate some data from DB. and then request the page with ajax
  13. it is not possible if you are using session based login system. when user is logged in you are basicaly giving the a authenticate session which is not possible without starting the session. pseudocode if(!isset($_SESSION['valid_user'])) { //check the remember me token //if it is true update the token,make user login,give them session,redirect to destination page //if false show up the login form output_login_form(); exit; }
  14. if you don't know what your code is doing it will be hard to fix it.
  15. It was just a case example. you dont necessarily have to give guests sessions. as example An application i developed need to keep track of guest so i give session to the guests and set authentication to false where as registered member got "true" . rather than that there is also other possibilities. as rule of thumb it is better to give a unit handle one specific task, it helps to keep things separate,increase maintainibility and reduce chances of breaking your application when your code grows. $_SESSION['authenticate'] will handle only check the authentication of user and nothing else.
  16. checking session empty or not will work but it has limitation (eg you have to store something in session for both guest and registered member. it wont work). but it is better to have a dedicated authenticated variable (boolean field) to indicate user is logged in or not. like $_SESSION['authenticated']=true;. some people check the existance of user id which was issued after successfull log in.
  17. you will check the persitant cookie only if user is not logged in. first time when user land on your page they have no session started. so persistant cookie make them authenticated and issue a authenticate session. next time inside a certain amount of timsespan if user visit again as he has session started already it wont check the persistant cookie. you should append the whole remember me code at top of every page. use not nesceraiy will land on home page. they may have bookmarked some other page of your site and they want to remember the user whenever he visits the page.
  18. there is many way to do that. when user click on buy button check in session array that product id is there or not. if it is there increase the quantity.when you store a product you can store product id and count in two elements of array $_SESSION[1]['productid']$_SESSION[1]['quantity'] same will be with delete.in delete button you will pass the product id and when you submit it, it will decrease the quantity once it reaches 0 you will move the entire product.
  19. once you use move_upload_file() to move temporary file to a destination the uploaded file has been moved to its destination. you can copy() the file from moved desstination to a thumbnail folder.
  20. birbal

    return keyword

    yes checkcookie() have to return some value(in this case boolean true or false) which you will check against condition. if you dont return anything the value will be null.
  21. birbal

    What's wrong?

    please post your relevant code
  22. fopen and file_get_contents() uses same wrappers. so if it is not working with one, will not work with either for same reason.
  23. you can start from hereJs cookie handling http://w3schools.com/js/js_cookies.aspphp cookie handling http://w3schools.com/php/php_cookies.asp
×
×
  • Create New...