Jump to content

requinix

Administrators
  • Posts

    15,064
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. You cannot "decrypt" the password. Read those other threads.
  2. I don't think you'll find much help here if you're looking for a point-and-click way to develop a PHP application. Frankly the idea of developers working that way terrifies me. You're more likely to get help if you can actually work with the PHP code itself. Like, you can post what you have here and we can make suggestions on what to do and you can go into the code and manually make the changes. Yes, but I have no idea what you're trying to actually accomplish. What are these queries supposed to help you do? How would you use them? And I don't know if I want the answer to this, but I'll ask anyways: select text as aboutme from texts where profile_id = 1 and about_me = 11. I assume profile_id=1 means "this table has text for lots of different profiles, and in this case I want the text for profile #1". Is that right? 2. What does the about_me column represent?
  3. Yeah, I saw the bit where you said the original wasn't OOP code. But that bit I posted isn't OOP either, so I figured it came from the tutorial and you were only putting stuff into classes. The three problems I saw with it: 1. If $i starts at 0 and only ever increases, $i will always be >=0. The loop cannot possibly end on its own. That's a sign that it's either the wrong structure to use (a while or do/while may be more appropriate, if anything at all) or there is something wrong with the loop as a whole. 2. $id gets its value the exact same way each time through the loop. Nothing changes. You're needlessly recalculating the value over and over again. 3. If $id is null then the loop ends. If $id is not null then the loop begins again at the top (ie, with $i++ then $i>=0 then the $id line). The code after that if block will never execute. More on topic, var_dump($status_replies_); //no output on var_dumpvar_dump() will always produce output. If there is no output then either you aren't seeing it or the code isn't even executing in the first place. (See #3.) And there are other problems. while ($row = $status_replies_) {4. One = is assignment, two ==s is comparison. Unfortunately neither is appropriate here.5. I take it $status_replies_ is supposed to be an array? Then this should probably be a foreach loop instead. while ($row1 = $status2view) { for ($j = 0; $j >= 0; $j++) {Same as before. if ($row1==NULL) { break; }6. $row1 never changes value within the loop. Either this code executes on the first time through or the loop never ends. Unless whatever code comes after the stuff you've posted alters it. Or does some weird stuff where it alters $status2view and then manually (see #1) leaves the for loop. So. What is this tutorial you're working from? I'm worried that you're starting off with bad information.
  4. Where is this tutorial you found? Because for ($i= 0; $i >=0 ; $i++) { $id=array_column($status2view ,'update_id'); //gives output on var_dump if ($id==NULL) { break; }else { continue; }is very wrong. For at least three different reasons.
  5. Your code is a bit... messed up, with the values. Which is why you're getting something completely different than what you want to get. What is $image_x and _y for? I'm guessing that the thumbnail is supposed to be {$image_x}x{$image_y} in size? But isn't 8x8 tiny for a thumbnail?
  6. But didn't you get that ID when you put the image in the folder? What's the rest of your code? Particularly the bits that involve the database.
  7. You. Cannot. Return. From. The. Success. Or. Failure. Handlers. It will NOT make the socket_open() function return a value. If you want to log to the console (or do something else) on success or on failure then put that code inside the handlers themselves.
  8. So no. But the PHP Installation & Configuration forum sure sounds appropriate.
  9. What you need is stopPropagation. It prevents an event from being "bubbled" up to be handled by parent elements. Put a handler on both the body and the weblink/webdropdown elements, have body's work the way it does now, and have the others' merely call stopPropagation on the event object.
  10. The ready state changes more than once during the lifetime of the connection. That's why there is a .readyState value you can look at. Only make a decision regarding connected/not connected when readyState is 4, which corresponds to the request having completed.
  11. What does the script do? Are there any errors logged? Is cron set up to email you the results?
  12. Word wrap isn't against the rules. You just need a really wide monitor and a really high resolution.
  13. By the way, the one-liner: $input = "dog,white cat,white cat,black cat,white dog,black bird,white"; $output = current(array_map(function($i){return ksort($i)&&array_walk($i,function(&$v){$v=implode(": ",array_reverse(func_get_args()));})?implode("\n",$i):array();},array(array_map(function($i){return arsort($i)&&array_walk($i,function(&$v){$v=implode(" ",func_get_args());})?implode(", ",$i):array();},array_reduce(preg_split('/\r\n?|\n/',$input),function($c,$i){return@++$c[strtok($i,",")][strtok("")]?$c:$c;},array()))))); echo $output;Obfuscated a bit so it's longer than it needs to be.
  14. It's not a super-simple one-liner. You say you have code that isn't working? What is it?
  15. gizmola found and fixed a problem with the emailing system, which handles things like notifications, verification emails, and password resets. It'll be chugging through a backlog of emails for a bit so you may receive some emails for stuff that doesn't matter anymore. There was also a problem with the CAPTCHA verification on the registration page that has also been addressed.
  16. If you're saying that by moving the PDFs outside the web root then that's not entirely true. What matters is whether Google can find a URL (and it's very good at that*) and whether it can get the contents of the URL. Simply hiding the PDFs behind a PHP script isn't enough - it needs to require authentication too. It'll help you with the good bots, but you won't be protected from the bad bots who don't respect robots.txt. * If you use Google Talk, share a link with someone over it, and they click the link, Google will pick it up. At work, we've had them discover development sites that way - they weren't supposed to be publicly accessible but they were misconfigured. The sites got indexed. After applying a robots.txt to our environments and firewalling the boxes, it took a few weeks for the index to lose the sites.
  17. If the PDFs can be publicly viewable, as in anybody on the internet should be able to see them (if they had the link), then go ahead and leave the directory web-accessible. If not, and I suspect not since these are bills that users are sending to people, then don't. Put the directory somewhere else and then make a PHP script which authenticates the user and then serves (outputs the contents of) the PDF.
  18. How often to do you need to access the information? Can it change during the lifetime of the user's session? When and why?
  19. Is what you posted your real code? Because it's incomplete. Like, you need a call to .send() in there. I'm not sure he meant "websockets" as in the tech - more like "open a socket to a website" in the general networking terms.
  20. AJAX is asynchronous - it does not happen linearly with the rest of your code. web_socket_open() will finish executing immediately and then eventually sometime later the onreadystatechange function will fire. Nevermind that the return will only return from that anonymous function and not web_socket_open(). function web_socket_open(href){ var request = new XMLHttpRequest(href); request.onreadystatechange = function() { if (request.readyState === 4 && request.status === 200) { console.log(true); } console.log(false); } } web_socket_open('http://127.0.0.1:8080');And notice that if everything is good you'll see a true and false output.
  21. Done. You should be receiving an email notification about it.
  22. Javascript cannot interact directly with PHP code or with your database. Use a form. <form action="" method="post"> <button type="submit" name="comehome">Click Me</button> </form>then if (isset($_POST["comehome"])) { // insert the record } // continue on as normalIt's not onclick because that requires AJAX and you said you wanted this thing done quickly. Which is a bad mentality for a programmer to have but whatever.
  23. Don't put the placeholders (which is what they are) inside of quotes. They aren't strings but, well, placeholders. Placeholders for real values which will come after you've called bindparam() and execute().
  24. But... isn't your AJAX hitting PHP in the first place? Because that's where the "html" comes from, and that's presumably the "id=msg results" you're talking about.
  25. I agree with scootstah: this is better served with an interface and an implementing class. Closures/callbacks/anonymous functions are more for simple tasks, like how Jacques's example where it just dumps out a value. The mere fact that the function is named "save" suggests it should conform to a specific signature (be that ($col1, $col2) or (array $cols)) and thus in a class. Fun fact: PHP 7 supports anonymous classes, so one could do... well, it doesn't look particularly pretty so I won't post the example code for it. But if you're concerned about lots of one-off classes, this would be marginally better.
×
×
  • 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.