Jump to content

SergeiSS

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by SergeiSS

  1. You have to include onmouseover/onmouseout events to the cell where you move you mouse. Inside these events you may do whatever you wish. In my example just one function is called from every event. Inside that functions you may do any actions: change styles of any element, disable/enable every element, add more elements, change elements' positions... It's up to you what to do, according the design that you like.
  2. It's not PHP, it's JS only. You have to create onmouseover event for every cell in the first table. In that events you have to call one special function (you create it) and pass to that function a parameter, showing the cell to be highlighted. And also you need a function that set it back. HTML code: ... onmouseover="highlight_cell( 'cell_101' )" onmouseout="unhighlight_cell( 'cell_101')" .... JS code: function highlight_cell( cell ) { document.getElementById( cell ).style=special_cell_style; } function unhighlight_cell( cell ) { document.getElementById( cell ).style=initial_cell_style; }
  3. You are comparing time as strings - it's not correct. You have to use DateTime object http://ru.php.net/manual/en/book.datetime.php Read about it and about it's diff method. It could be useful in your case
  4. Do you ever heard about function MAX() in MySQL? You need it.
  5. I think that you are doing correct all things. You just don't understand it If you read about a way how float values are stored and processed, it could be more clear. The point is that there is an accuracy (or better say precision?) of float values. It could be that you save 3.0 but it coule be read next time as 2.999999999999. And what happen if you read 2 values and substract (or add) them? You'd get exactly what you described. Read here http://en.wikipedia.org/wiki/Floating_point#Minimizing_the_effect_of_accuracy_problems Look for words "Minimizing the effect of accuracy problems".
  6. First of all you have to echo $query; and then show here the result. Also it could be nice to start it in this way mysql_query( $query ) or die( mysql_error()); If you have an error message - also show it here.
  7. I think it's my language problem because English is not my native language.... But could you explain more detail your question?
  8. I'd say that your DB is not 'normalized'. You keep a list of features in one field. But you'd better keep it in different rows. Maybe you need one more table... Read about it, for example, here http://en.wikipedia.org/wiki/Database_normalization
  9. OK. As I told you already you may use FTP. Just load your file to an FTP server - automatically from your Selverlight application - and then start PHP script. It will connect to FTP and download that file.
  10. Where do you have "My Documents" folder? On your computer, not on the server? If yes, you may use FTP. It could be at your server (where you have your PHP script) or at any other server. You might create a local application to do it. But you may be sure that in any case it's impossible to load a file via PHP script (HTML page) without command from user. This is because of security reason.
  11. It seems you are talking about many people including me Yes, you are right - I don't like to write a code for people who don't like to think. From my point of view, I'm 'helping' a man when pointing him to find a correct solution. Of course I can write some lines of code - but it possible just in one case. When the man is trying to think and write a code. If he fails - I can correct his code or write a new one. I like to help such people - because I see that they are able to think. But if you wish... You may write a code for anyone You see - here there are some (not too much) people who are waiting for such a man like you They don't like to think, they like that you think instead of them.
  12. You need AJAX. Read about it. There is a lot of information in the internet. In short: you send a request to your server, it perform all that you need and then required information is sent back to client (browser).
  13. Do you see that your code is highlighted? I think you see. Check it - in the beginning it highlighted correctly, but at the end it's highlighted incorrectly. It means that you lose something, somewhere in the middle there is an error. Check colors - I hope that you are able to find the place with error It's easy to do. PS. If you fail to find I can help of course.
  14. You can't call PHP function from onmouseover. You may call only JS function. If you any information from the server, use AJAX.
  15. zeta1600 - why do you use PHP tags at every line? You may place a lot of code inside these tags <?php a lot of lines with PHP code here ?>
  16. Do you ever heard about helps? For example, about this one: http://php.net/manual/en At that site there are descriptions for some functions, like json_encode and json_decode. Try to read it and you understand. I hope that you understand Also I hope that my previous answer can help you.
  17. I hope this code helps you // your data are inserted into a string $s='{"menu": { "header": "SVG Viewer", "items": [ {"id": "Open"}, {"id": "OpenNew", "label": "Open New"}, null, {"id": "ZoomIn", "label": "Zoom In"}, {"id": "ZoomOut", "label": "Zoom Out"}, {"id": "OriginalView", "label": "Original View"}, null, {"id": "Quality"}, {"id": "Pause"}, {"id": "Mute"}, null, {"id": "Find", "label": "Find..."}, {"id": "FindAgain", "label": "Find Again"}, {"id": "Copy"}, {"id": "CopyAgain", "label": "Copy Again"}, {"id": "CopySVG", "label": "Copy SVG"}, {"id": "ViewSVG", "label": "View SVG"}, {"id": "ViewSource", "label": "View Source"}, {"id": "SaveAs", "label": "Save As"}, null, {"id": "Help"}, {"id": "About", "label": "About Adobe CVG Viewer..."} ] }} '; // process and output a decoded info echo '<pre>'. print_r( json_decode( $s, true ), true). '</pre>'; Instead of printing you may assign it to an array and process it. PS. In my browser I see this Array ( [menu] => Array ( [header] => SVG Viewer [items] => Array ( [0] => Array ( [id] => Open ) [1] => Array ( [id] => OpenNew [label] => Open New ) [2] => [3] => Array ( [id] => ZoomIn [label] => Zoom In ) [4] => Array ( [id] => ZoomOut [label] => Zoom Out ) [5] => Array ( [id] => OriginalView [label] => Original View ) [6] => [7] => Array ( [id] => Quality ) [8] => Array ( [id] => Pause ) [9] => Array ( [id] => Mute ) [10] => [11] => Array ( [id] => Find [label] => Find... ) [12] => Array ( [id] => FindAgain [label] => Find Again ) [13] => Array ( [id] => Copy ) [14] => Array ( [id] => CopyAgain [label] => Copy Again ) [15] => Array ( [id] => CopySVG [label] => Copy SVG ) [16] => Array ( [id] => ViewSVG [label] => View SVG ) [17] => Array ( [id] => ViewSource [label] => View Source ) [18] => Array ( [id] => SaveAs [label] => Save As ) [19] => [20] => Array ( [id] => Help ) [21] => Array ( [id] => About [label] => About Adobe CVG Viewer... ) ) ) )
  18. You mean that this explanation with examples http://ru2.php.net/manual/en/function.json-encode.php is not enough for you? OK, what else do you like to know?
  19. Maybe there is no difference when "normal" people (not programmers) are talking. For them there is no difference. But not for scripts! //If you do loop like this do { .... } while ( $i < 100 ); // and another loop while( $i < 100 ) { ... } You may get different results when use these two loops. Do you agree? If you say to a newbie "use do-while loop"... What do you think - what will he do? A bet he will use the first type of loop It doesn't matter if you mean the second type. He will use the first one. I'm talking about it because I saw this type of misunderstanding many-many times.
  20. Let me add something. It's correct behavior because of security reason. You may have some secret information inside you PHP page, for example login-password for access to DB. It's not a good idea to send it to another server. Let me assume that you use Apache as web-server. You may say Apache to don't process PHP file but send them like a text. In such a case you may use your scripts at another servers. But you'll have a very big hole in your site's security. Also you are not able to use (process) script at a "root" server 'on one computer at work'. Do you still like to let other servers to use you PHP files in the same way like your server do?
  21. You may do it of course - I mean 'That made me chuckle'. But in the code "while-do" loop is used and it's quite correct. It seems that you know only "do-while" loop and you've never heard about "whild-do" loop. "While-do" first of all checks a condition. If it's true it go inside and perform a code. It could happen that the code inside loop is not performed at all. As concerned "do-while" loop you are right - 'script will "do" something at least once' ©.
  22. Your question is common that's why the first answer (set of answers) would be common also. First, you have to create a structure inside PHP which is equivalent to your data. This is the main. You may use class(es) to do it. Second, about data. In your example "allow" is related to "TR Cpt. K. Reese" from "moderator" group - is it true? What about "deny" - is it related to this or other user? And what about data concerning to other users? How are they structured?
  23. You show A LOT OF CODE. For me it's not interesting to go through this code and look for the point where you output this link. It seems that a lot of people are thinking in the same way Just a small question. Do you know <a> tag and it's structure? If you know it you know the answer to your question. Look for info about this tag anywhere in the internet.
  24. 2 people answered, I'll be the 3-d men What could be another way from your point of veiw? In any case you need to save this info anywhere on a disk. In any case it will be a file! But if you use a singe file you have to care of dobble-access to a file at one time. From the other hand, if you use MySQL or any other DB, that DB is carring about it. Because DB uses files also but it controls access. In other words... Let DB to work for you. Like you do it now. "Just make sure to optimize your database" ©
×
×
  • 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.