Jump to content

cpd

Members
  • Posts

    883
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by cpd

  1. Its possible, to what standard I don't know. You'd have to find a pretty good translation script/system. Google Translate is considered naff by professional translation companies but it's down to your requirements as to what is acceptable.

     

    I dislike CodeIgniter!

  2. No, the PHP Compiler will optimise your code. The reference is merely a means of creating another variable for the same content; a reference. Its not a pointer and "they are not actual memory addresses" - http://www.php.net/manual/en/language.references.whatare.php

     

    Passing by reference allows you to directly manipulate content within a function/method of a variable defined outside the scope of the function/method.

  3. phpMyAdmin is a third party tool. Whenever you're messing with your database, see if you can access it directly via command prompt (as you did) and if not, then you know its the server - and vice versa.

     

    The character restriction is something put on by the phpMyAdmin developers not the MySQL Server. You can probably change the settings somewhere, just do a bit of research. 

  4. You'll need to cycle through every file every time in that case. 

     

    Alternatively, if you can store the last file used and you know how the file names increment, you can implement an algorithm to "guess" the next file name and search for it. If that fails you can fallback to parsing every file name.

     

    If you can be sure the file name will end the same as your example then go with the http://php.net/ftp_rawlist function and search for the most recent file. This method depends on the file name though, and assumes the file naming convention will be continuous.

  5. If you don't assign an index, php starts the indexing at 0 anyway so there's no need to explicitly set it. 

     

    Answering your question directly: you can do what you're asking no problem but I'd keep the questions and answers together. They're related and shouldn't really be separated. 

     

    Take a look at http://uk3.php.net/manual/en/ref.filesystem.php for file system functions. More specifically fopen($file), fgets($handle) and fclose($handle).

     

    A, what I consider as better, alternative is to create an XML model storing your data in that. You can then use the DOMDocument() object to parse the data for you and easily cycle through all your questions and answers. Food for thought.

  6. RTM http://uk1.php.net/session_Register. session_register is deprecated as of 5.3 and removed as of 5.4. Assuming you're PHP version is up to date you shouldn't be using it.

     

    Set a session variable using the $_SESSION super global and test for it on pages requiring authentication. 

     

    Why are you stripping slashes from the password as well? You should be storing them in an encrypted form for added security. 

  7. Not necessarily, the response served up by the server is a 406, but in the process of handling the 406 it found a 404 as the error document couldn't be found. A simple visulisation:

     

    Client                  Server                 File System
               Request
       |---------------------->|                        |
       |                       | Handle Request         |
       |                       | 406                    |
       |                       |   Get error document   |
       |                       |----------------------->|
       |                       |                        |
       |                       |  Document not found    |
       |                       |<-----------------------|
       |  406 with 404 error   |                        |
       |<----------------------|                        |

    That said, PHP or something else could just be setting the HTTP status code and sending the response. 

  8. If you want to develop locally, which is generally what I do, you'll need to install a web server, PHP and potentially MySQL.

     

    Just get the latest releases for each; each can be found at their respective home sites. Alternatively, you can install a package such as WAMP or XAMPP although they often take a while to update so you wont necessarily have the most recent version.

  9. The server has experienced a 406 error and tried to handle it using some sort of error document but couldn't find the error document and has informed you of this.

     

    406 Not Acceptable

     

    The resource identified by the request is only capable of generating
    response entities which have content characteristics not acceptable
    according to the accept headers sent in the request.

     

    - RFC2616 HTTP/1.1, pp 67. Available at: https://tools.ietf.org/html/rfc2616#page-67

  10. What happens if the user changes their username? If username is unique and will never change, why don't you use it as the primary key?

     

    What have you attempted yourself? We're not about to write the code for you which is why your post implies you think?

  11. http://bit.ly/16FVsoK

    http://bit.ly/16FVKvJ

     

    No idea what you mean for the last one.

     

    I appreciate your new but this applies to life. Go and do your own research and put the effort in yourself and you'll learn a lot more. Come back with a specific problem and we can assist.

     

    If you want to know what a specific PHP function does, go to http://php.net/function_name where function_name is any function or even something similar and it'll explain everything.

     

    To get you started on your first task:

    1. http://php.net/read
    2. http://php.net/fopen
    3. http://php.net/file_get_contents

    Lots of options and ways you can do it. Each one will essentially get you to 1) Open the file, 2) Loop through its contents populating the dropdown.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.