Jump to content

everisk

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by everisk

  1. Thank you for a more complete example, effigy! I'll try that out.
  2. I have a form where user is supposed to post large amount of data for processing (say more than 50,000 rows of data). How do I make sure that those data get processed? I consider using set_time_limit(0) set max_execution_time to zero, but I was told that the script might still terminates because of some other setting in Apache. I think BigDump has similar capability but I dont know how it works .. something like the script restarts itself before timeout and continue processing? Any help is appreciated. Thanks!
  3. Your email might be blocked by the email provider (such as Hotmail, Gmail, or etc). This can happen if you send bulk mailing.
  4. Discomatt, thank you for your help! I think i got it.
  5. Hello, I dont understand a little about RegEx but cannot really understand how to use all the funtions . I need to convert link tag <a href ....> that DOES NOT already have the css in them. Such as <a href="http://www.google.com" style="font-size: 11px;" other properties> should NOT matched but <a href="http://www.google.com" .. other properties> should match and a style="..." should be added. I understand that I need to use preg_replace for that but dont know how to use it Any help would be much appreciated. Thanks!
  6. Hi, I am using jQuery date picker from http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/. It works great but then I have a function where user can add more row in the table (via AJAX and PHP) and in the new row should also have the date picker. However, the date picker broke and just doesnot show up in the new row. Please help~ Many thanks in advance. Below is cut from my code <head> <link type="text/css" rel="stylesheet" href="datePicker.css"> <!-- jQuery --> <script type="text/javascript" src="Scripts/jquery-1.2.1.js"></script> <!-- required plugins --> <script type="text/javascript" src="Scripts/date.js"></script> <!-- jquery.datePicker.js --> <script type="text/javascript" src="Scripts/jquery.datePicker.js"></script> <script type="text/javascript" charset="utf-8"> $(function() { $('input.date-pick').datePicker({startDate:'01/01/2005'}).val(new Date().asString()).trigger('change'); $('input.calendar-start').datePicker({startDate:'01/<?php print date("m");?>/<?php print date("Y");?>'}); }); </script> </head> <body> <table> <tr> <td><input type="input" name="start_date[0]" id="start_date[0]" size="11" maxlength="10" class="calendar-start" value=" " /></td> </tr> <tr> <td><a href="javascript:addMoreRow();">[add more row]</a> | <a href="javascript:removeRow();">[remove row]</a></td> </tr> </table> </body> In the PHP file to add more row Nothing in the head section .. just some PHP code . .no javascript call to jQuery . I did try to add javascript call to jQuery and etc. but still it doesn't work <table> <tr> <td><input type="input" name="start_date[<?php print $sno;?>]" id="start_date[<?php print $sno;?>]" size="10" maxlength="10" class="calendar-start" value="" /></td> </tr> </table>
  7. I have an input put box like <input name="oamnt[9]" id="oamnt[9]" size="8" maxlength="10" value="7500.00" type="input"> <input name="oamnt[12]" id="oamnt[12]" size="8" maxlength="10" value="500.00" type="input"> How do I get javascript to loop through the array? Notice that my array number is not a consecutive number but rather an id of smth else. Does Javascript has a loop function similar to foreach in PHP?
  8. Hi Lemmin, thank you noticing my mistake. Silly me. After i take out the extra 'r' it works. Thank you so much for your help.
  9. Hi, I have a function where I'll add value of all array (named amnt) after a button is clicked. However, the function doesn't seem to loop correctly (it seems to be running forever) and didn't output the totalAmnt value in the last line. Below is my code. How do I fix this? Thanks. function calculateTotalAmnt() { var loopno = parseFloat(document.getElementById("serviceno").value); var totalAmnt = parseFloat(0); var i; for(i = 0; i<=loopno; i++) { var toget = "amnt["+i+"]"; totalAmnt = parrseFloat(totalAmnt) + parseFloat(document.getElementById(toget).value); } document.write("here"+totalAmnt); //this output doesn't show }
  10. Hi, I'm very new to Javascript and found a very strange behaviour when trying to add 2 numbers. DOnt know if i got everything right. Below is my code. price = document.getElementById("price").value; vat_p = (price*0.07)+price; document.getElementById("price").value=vat_p; Instead of adding (price*0.07) to price, price was appended to the result of (price*0.07).Help please~
  11. Hi, I have quite a long script that need some time processing, but I need to output some message to Flash file before the script ends. Currently, I can output the message but Flash will not get the message unless the script ends (which is too long for user to wait). I googled the answer and tried to add it into my script. But ,with my script, when the page stops loading (or the loading bar stops) it doesn't continue the rest of the script. Please help A portion of my code <?php include "conn.php"; ignore_user_abort(true); //Receives values from Flash Form $from_email = strtolower(trim($_REQUEST['from_email'])); $from_name = strtolower(trim($_REQUEST['from_name'])); $to_email = strtolower(trim($_REQUEST['to_email'])); $user_message = trim($_REQUEST['user_message']); //user type message $from_name = iconv("UTF-8", "TIS-620", $from_name); $user_message = iconv("UTF-8", "TIS-620", $user_message); //some process //--------insert all value into raw_input table--------// $raw_to_email = strip_tags(fullclean($to_email)); $sql = "insert into raw_input (from_email, from_name, to_email, user_message, fdate, message) values ('$from_email', '$from_name', '$raw_to_email', '$user_message', '$tdate', $message)"; mysql_query($sql); $response = "writ=Ok&writing=Ok"; header("Connection: close"); header("Content-Length: " . mb_strlen($response)); echo $response; //to output to flash before the script ends flush(); ob_flush(); flush(); ob_flush(); flush(); ob_flush(); test_fuc(); function test_fuc() { print "test get called<br />"; sleep(10); print "script continued"; } ?>
  12. Thanks. From your comment I figured out a way by setting Default timezone in php.ini.
  13. Hi, I'm trying to POST HTML code of a webpage by using AJAX, but I got 'html[object HTMLDivElement]' as a response. Below is my code. Thanks! print '<div id="html_content" name="html_content" style="display: none;">'; print $html; print '</div>'; print 'View your email in: <input type="submit" name="type" id="type" value="Preview1" onClick="sendRequest(this.value);"> <input type="submit" name="type" id="type" value="Preview2" onClick="sendRequest(this.value);">'; Ajax Code function createRequestObject() { var req; if(window.XMLHttpRequest){ req = new XMLHttpRequest(); } else if(window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } else { alert('Problem creating the XMLHttpRequest object'); } return req; } var http = createRequestObject(); function sendRequest(content_type, html_content) { var url = "get_content.php"; var htm = document.getElementById("html_content"); var params = "type=" + encodeURIComponent(content_type) + "html" + document.getElementById("html_content"); http.open("POST", url, "true"); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = handleResponse; http.send(params); } function handleResponse() { document.getElementById('loadingImage').style.display = 'block'; if (http.readyState == 4 && http.status == 200) { var response = http.responseText; if(response) { document.getElementById('loadingImage').style.display = 'none'; document.getElementById('content').innerHTML = response; } } }
  14. Hi, I have a problem when I use a simple date function to print date and time, the time part is always +1 hour. For example, Current time is 2008-04-04 13:49:42 Date function prints 2008-04-04 14:49:42 I check that the server time is correct as well as the time zone. Any idea? I'm just puzzled! Thanks a lot.
  15. Oh right. Sorry.. I made some mistakes. Look like it's working now. Thanks a lot, Barand!
  16. thank you. but that doesn't seem to work
  17. Thank you for all your responses. The thing is i'm quite an amateur in PHP so I dont know how to write my own function to sort the array :'( . If anyone can help, I'd greatly appreciate it.
  18. I have an array that looks like below. I'd like to sort it in by [ctor] in descending order. Help please~. Thanks. Array ( [1] => Array ( [url] => www.abc.com [stimes] => 154 [ctor] => 19.06 ) [2] => Array ( [url] => www.123.com [stimes] => 90 [ctor] => 11.14 ) [3] => Array ( [url] => www.xyz.com [stimes] => 180 [ctor] => 22.28 ) )
  19. Oh that's is exactly what i'm doing xmlHttp.onreadystatechange=handleResponse(mesg); So how should I write the function so that 'mesg' will be used in handleResponse()? thanks.
  20. Actually it is not static .. there are multiple ajaxContent DIV on my page and i uniquely identify it with the parameter 'mesg'
  21. what if i have it define it like this? function handleResponse(mesg) { var divid2 = "ajaxContent"+mesg; if (http.readyState == 4 && http.status == 200) { var response = http.responseText; if(response) { document.getElementById(divid2).innerHTML = response; } } }
  22. Thanks! I have another related question. I use AJAX in my script and need to show the response to a correct unique DIV. I tried creating a function just like what phpQuestioner gave "stylechange" but pass both divid and response to the function. But that doesn't seem to work. if (http.readyState == 4 && http.status == 200) { // Text returned FROM the PHP script var response = http.responseText; if(response) { // UPDATE ajaxTest content document.getElementById(divid).innerHTML = response; } }
  23. I would like to switch style of DIV from none to block but since there are multiple DIV in the page so I need to assign a unique number to it. My current code is not working var divid = "loadingImage"+nl; document.getElementById(divid).style.display = 'block'; The error in FireBug says "document.getElementById(divid) has no properties". Help please~
×
×
  • 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.