Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Hey guys, I wrote a script that send emails to our subscribers from church about 920. I also want this emails to be send by packages, where every 10 sec to be send 10 emails, for this issue I'm using sleep php function.. and cron job from the server. Where is the problem? When I ran the script from my local machine I've got 90 packages, if I run the script from the remote server (we're using godaddy shared server), I've got only 61 packages. There are the links to the scripts... cron. php -> http://pastebin.com/wXRs1Adt array's mails -> http://pastebin.com/vDdPd5mN Any help would be appreciated!
  2. Sorry about that The code above works just fine, but to this topic -> http://forums.phpfreaks.com/topic/269366-switch-content-not-working-please-help-fix/ About the real one you could use "this" javascript object and css property to hide this button. Try, <script> $(document).ready(function(){ $(".buttons").click(function () { $(this).css("display", "none"); var divname= this.value; $("#"+divname).show("slow").siblings().hide("slow"); }); }); </script>
  3. Christian, it's not my code. I posted it into a wrong section! This answer belongs to here -> http://forums.phpfre...lease-help-fix/ @lovephp I thought you 're double posting, ignore my answer for that, please. Thank you j.
  4. Don't make double posts, please.
  5. What result do you get? <script type="text/javascript"> function checkForm(frm) { alert (frm); return false; .......... </script>
  6. I've got a correct result. index.php <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.js"></script> <script language="Javascript" type="text/javascript"> <!-- function swapContent(cv) { //$("#myDiv").html('<img src="loader.gif"/>').show(); var url = "test.php"; $.post(url, {contentVar: cv} ,function(data) { console.log(data); //$("#myDiv").html(data).show(); }); } //--> </script> <style type="text/css"> #myDiv{ width:200px; height:150px; padding:12px; border:#666 1px solid; background-color:#FAEEC5; font-size:18px; } </style> </head> <body> <a href="#" onclick="return false" onmousedown="javascript:swapContent('con1');">Content1</a> <a href="#" onclick="return false" onmousedown="javascript:swapContent('con2');">Content2</a> <a href="#" onclick="return false" onmousedown="javascript:swapContent('con3');">Content3</a> <div id="myDiv">My default content for this page element when the page initially loads</div> </body> </html> test.php <?php if (isset($_POST['contentVar'])) if($_POST['contentVar'] == 'con1') echo 'Con1 is here'; elseif($_POST['contentVar'] == 'con2') echo 'Con2 is here'; elseif($_POST['contentVar'] == 'con3') echo 'Con3 is here'; else echo 'Something else'; ?>
  7. Well, what about with differen charset and collation like UTF ?
  8. Well, in reality you can use either method and I've seen scripts using the GET method to delete database information and POST method just to retrieve information from the server. I think (and not only me) that the GET method is suited to request that don't affect the state of database or files on the server. In other words use it when you want to get information. The POST is suited for sending data that will change information on the server. That's why I said, he/she to use POST data method.
  9. A little correction if (!preg_match("/^[a-zA-Z0-9]+$/" )) to if (!preg_match("/^[a-zA-Z0-9]+$/", $uname ))
  10. @White_Lily, don't forget to use post method, when you are trying to delete or update some data in your DB.
  11. Have you ever checked this value ? You will see the real value - is undefind <script type="text/javascript"> function doValidate() { console.log(document.registerform.textbox1.value); } </script>
  12. Do you want to sniff the LAN or you are an admin and have full access to the router ?
  13. Example, $arrInfo = array( 'www.bind.com' => array( 0 =>array( 'url' => 'http://www.bing.com/kee', 'parse' => array( 'schame' => 'http', 'host' => 'www.bing.com', 'path' => '/kee_' ), 'md5' => 'e69d3a5bb987448e30ec8559c3634caf' ) ) ); echo $arrInfo['www.bind.com'][0]['parse']['host'].'<br />'; // www.bing.com echo $arrInfo['www.bind.com'][0]['md5']; // e69d3a5bb987448e30ec8559c3634caf
  14. Try, $host = ['www.bing.com'][0]['parse']['host']; $md5 = ['www.bing.com'][0]['md5'];
  15. If your problem is <some text></some text> tags, just find and replace them in the string with <li> or [li]....
  16. One more solution, I used the pattern of the link posted by @Zane... SELECT c.playerID, AVG(c.final_score) as average FROM sleuth_game c INNER JOIN ( SELECT a.puzzleID FROM sleuth_game a INNER JOIN sleuth_game b ON (a.playerID = b.playerID) AND (a.final_score <= b.final_score) GROUP BY a.puzzleID HAVING COUNT(*) <= 3) AS x ON (c.puzzleID = x.puzzleID) GROUP BY c.playerID HAVING COUNT(*) > 2 Result: +-----------+------------+ | playerID | average | +-----------+------------+ | 101 | 50.0000 | | 103 | 45.0000 | +----------+-------------+
  17. @cliftonbazaar, you have to create another sub-query after AVG(SELECT........) to count and limit the number of final_score to 4 order by puzzleID DESC, I think..
  18. I tested it. It works, but him mysql structure is not very well at all.. Result is: +----------+------------------+ | playerID | AVG(final_score) | +----------+------------------+ | 101 | 43.7500 | | 103 | 45.0000 | +----------+------------------+ P.S Hm....now I saw that he wants to count only first three results from playerID = 101, but I count all of them. That's why my average is 43.7500.
  19. Try with sub-query, SELECT playerID, AVG(final_score) FROM `sleuth_game` WHERE `sleuth_game`.`playerID` IN( SELECT playerID FROM `sleuth_game` GROUP BY playerID HAVING COUNT( playerID ) > 2) GROUP BY playerID
  20. I'm not sure for others browsers, you could check -> https://developer.mozilla.org/en-US/docs/DOM/FileReader
  21. I'm not sure that you know differences between encryption and hashing.
  22. Ah, my apology. You want to match new lines $pattern = '/^[\n\r]?[a-z0-9_\/a\-\<li\>(.*?)<\/li\>\ ]+/i'; if(preg_match($pattern, $va1)){ echo 'true'; } else { echo 'false'; } @Christian, you pattern won't work, why are you using [\\n\\r] ?
  23. Try, preg_match('/^[a-z0-9_\/a\-\<li\>(.*?)<\/li\>\ ]+[^\n]?$/i',$va1)
  24. Could you show us the text that you'd like to validate, also your RegEx string, and finally var_dump($va1).
  25. Check this out -> http://www.sitepoint.com/hierarchical-data-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.