Jump to content

SergeiSS

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by SergeiSS

  1. I also don't know how to ask google about this task But I can direct you, I give you an algorithm. 1. You need daemon at your server. It could be PHP daemon. 2. This daemon must receive your request to start that lengthy procedure and start it. 3. Daemon answers to browser that it has started your task. 4. Your JS script will periodically ask (via AJAX) that daemon about the state of the task. 5. While in process it returns one state, when finished it returns another state. You may use ajax or WebSocket to connect JS script and server. The second one, I think, is preferrable for this task, because server can send to the browser any information without additional requests.
  2. Everyone can remove this code and you won't get to know that script was used.
  3. I think I understand what you like to do. 1. Use normal AJAX. 2. Another possibility - iframe, hidden iframe. Just create your URL (in JS) and set iframe's SRC equal to this URL. Script will be loaded into this iframe. Moreover, you may send some JS commands from iframe to the main frame in order to get the feedback.
  4. Do you know about PrintScreen button? It's better to use it than your camera in order to show the screen About your question. Try to set style = "width: 100%;position: fixed;bottom: 0px;" for the div with id="sub_wrap". It might help you - phone and e-mail will be always at the bottom of the screen.
  5. What is the meaning of the last qoute in this line? You have incorrect syntax here Maybe this is the only problem? Also, you insert raw POST data into the MySQL. It's bad! Then... What for do you "require_once 'header.php';" in 2 places???
  6. Well... I see PNG in the data. But you try to use it as JPEG. Maybe this is a problem? Try to change header("Content-type: image/jpeg"); to header("Content-type: image/png");
  7. Just imagine - you take your phone, dial number and called subscriber answered. After that you may talk to that man. Internet connection is similar to phone call. First you need a connection and when this connection is established two programs (client and server) may talk. In other words your question is "Is it possible to talk to a remote person without making a call to his phone?" What can you answer to this question?
  8. It's easy to do 1. onsubmit="return false;" you should remove that - as it was said earlier. 2. Create a function to submit a form. Let it be form_caller(). This function have to set a special JS variable (V) and then call submit() function for a from. 3. Create second function, let's name it submit_check. It checks the state of special variable V and return true if V is set and return false otherwise. 4. Write for the form onsubmit="return submit_check()". 5. It's ready. If you press Enter, submit_check() is called and return false. Form is not submitted. If you call form_caller(), then submit_check() will return true and form will be submitted. I hope that this explanation in clear enough.
  9. I think there is a "slight" difference between "you give him/her bad anwswer", "your answer is right" and "using something like json_encode() ... is better". Do you agree with me?
  10. What is wrong in my answer? Endorphin tries to create a list of comma-separated values. His task was to remove the last comma. Am I right? And I show the way how to create a string without comma at it's end. Do you agree? OK, again - where my answer is wrong? Even if he would like to use multidimensional array, he can use my code. He just need to change it a little.
  11. You'd better do it in another way. The more accurate (and more compact) code is the next if($via != null) { $points=array(); foreach($via as $point) { if($point != "") $points[]="{location:'$point'}"; } if( count( $points > 0 ) ) echo "var points = [".implode( ',', $points)."];\n";
  12. This might help you: http://ru2.php.net/manual/en/class.directoryiterator.php Look for DirectoryIterator::getMTime
  13. Yes, it's possible. And from my point of view it's the preferred method. Because if something is wrong in the input data, I can show all data entered and give to user a chance to change it. When data is correct I can process it and do anything I wish. If I need, I can root to another script or do something here, in this script.
  14. I think you need GD2 or Imagick library if you like to do it inside PHP. You may save resized images at you server or resize them 'on the fly', dynamically, every time when you need it. In the first case you save a time (but need some space on a server), in the second case you save a space on your server (but need a time to resize every time when you need a smal copy).
  15. Maybe this http://phpexcel.codeplex.com/releases/view/45412 helps you. Try it.
  16. The direct answer to your question is "no". But if you explain what do you like to get (I mean algorithm), then we can think together and find out a good solution for you needs. PS. I could be ajax of course, but maybe not. It's up to you, what is your aim.
  17. The only way to measure load time is to do it on client side. If it's not possible because of any reason - it's impossible at all. As I told already it this topic "PHP solution is not correct It will show page preparation time."
  18. Really? Maybe you are just absent-minded? The first recommendation in this topic was to use exactly this function - pathinfo().
  19. What is the main problem? To create a new filename in an easy name? You may use pathinfo() function http://ru.php.net/manual/en/function.pathinfo.php in order to get all filename parts. Then you may change something and create a new filename.
  20. Maybe JS? In the beginning, when loading is started, set first JS variable, make it equal the current client's time. And also when page is loaded read the current time. Calculate the difference between that times and you will know the loading time. BTW, do you expect a long period of time? Why do you like to control it? PS. scootstah, PaulRyan - PHP solution is not correct It will show page preparation time. TC would like to know how long this page is transfered from server to client.
  21. It's not a good idea to use file() in this case. I'd prefer to use fopen()-fgets()/fread()-fwrite()-fclose(). If the size of the file is big you may have a problem with memory.
  22. Well... I explain an algorithm as I see it. You need functions fopen(), fgets() (fread), fwrite() and some others. Read your file line by line, add any info and write it in another file. Then remove old file and finally give your new file the name of an old file. In the result your will have that you need.
  23. It's possible, of course The algorithm is depends on if you have just one string or more strings. Better say, if this string is the last in the file or not the last. The reason is that if this info is the last in the file, you may add new info very easy. If it's not the last info you have to rewrite your file.
  24. It seems that it's better for you to look for a person who can do it for you. If you pay some money. Or, maybe, he can do something and explain it to you.
  25. I understand nothing at all... - You are talking about javascript array (?), in the same time you are showing the PHP code and you are asking in "PHP coding". - You don't show the code that create that graph - did you create it in JS or in PHP? - What advice, what about do you like to hear?
×
×
  • 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.