Jump to content

satya61229

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by satya61229

  1. Here for($counter = 0;$row=mysql_fetch_array($query); $counter++) I think you are starting from 0 and going till last +1 . Try with usual while($row=mysql_fetch_assoc($query) {}
  2. You can use htmlentities with ENT_NOQUOTES parameter. Plz check here- http://php.net/manual/en/function.htmlentities.php
  3. session_id can be useful to know is session has started or not: http://www.satya-weblog.com/2009/10/php-session-is-session-set.html
  4. and google also suggest doing it. Use H1 first then h2, h3. It tells about structure of website
  5. See if you are reading large file in memory then this is going to happen. In this case just increase the memory size for php for that script. If it is just a script that is causing the problem then check the script. Search for PHP memory_limit . ini_set('memory_limit', 'size in bytes'); http://stackoverflow.com/questions/415801/allowed-memory-size-of-33554432-bytes-exhausted-tried-to-allocate-43148176-bytes
  6. yes use curl and use a marker to mark those area. Recently for one ticket I have added a text when accessed with certain parameter. Like I will access that page using /test.php?mypage=1 Then in that case I will add a php code there where I will check that if mypage=1 will be in parameter then I will output {content} .... {/content}. In this case using regex on the content grabbed is easier. I have also added exit after my content so that my page access from the specified page can be faster.
  7. Not sure but please check you are using the right editor which understand the utf-8, utf-16. and if it understand then save it in right encoding also.
  8. 1. Create an Iframe. 2. Use Javascript for submitting/redirecting the page the page. 3. Before redirecting/submitting, set the iframe src attribute using JS. 4. You are done.
  9. It is working for me. Just replaced port number from XXXX from something valid. Check if you have some error. error_reporting(E_ALL);
  10. You can get lots of pagination code on the net. I have a code both in Ajax and non-Ajax version you can use. http://www.satya-weblog.com/tag/pagination
  11. I also do not know and also suspect there may be any. On Linux/unix system you may run the linux command though. Look for that.
  12. For lots of headers and attachment I always suggest using a library written and tested for sending email. One is phpmailer. Simple mail() function is not very good to use for us.
  13. You need few things for redirect problem after users logout. I am in no mood of writing those long code written on blog. So search in the blog mentioned below. I am 100 % sure you will get the answer.
  14. but I think file upload is not supported through ajax. People use iframe which do the tricks and that looks like ajax.
  15. This article may also be helpful to you - Export Data from database to excel sheet if yes then this may also be helpful: http://www.satya-weblog.com/2007/07/design-dynamically-generated-data-excel.html
  16. Actually you need several things. The code about show and hide is the code you have: if (e.getAttribute("id") == id) { e.style.display = "block"; } else { e.style.display = "none"; Other than that you need to check which element you passed and what is the status of that element. Above it is checking if it is block (make it appear) then make it none (make it disappear).
  17. Are you looking for this article? I think so! Check, Uncheck All Checkboxes
  18. I hope that function above will work. Then you can use the split() method of Js. This should work for creating array from text box - var arr1 = document.getElementById('txt1').split(" ");
  19. You should use regex. May be this: preg_replace('@<a(.*)[>](.*)</a>@imU', '', $text);
  20. I may catch one but for other! Please Remember, I want to catch either of the one (inline or external script) at a time.
  21. See, javascript and PHP do not know each other. But from serverside if you output like this: echo "document.getElementById('myID').value= '$myValue'"; then it will be execute directly at client side. also check here for these things: http://www.satya-weblog.com/2008/05/passing-value-from-php-html-javascript.html For input box, you can go like this: First try to work with simple input box (no hide/unhide) and fix everything related to functionality. then when you find everything good then you can proceed with hide/unhide play. It will be little difficult. First stage will be: <div id="div1" style="display:none"> <input name="txt1" type=text value=""> </div> Second stage, when you got a value : Before the above hidden html code, through js code in Ajax complete section, write something like: document.getElementById('div1').style.display = 'block'; etc. Difficult? huh! yes it is but you can do. Good luck!
  22. Hi I am looking for regex for taking external Javascript tag (and not inline js) inside array and removing those external javascript entry from html. Similarly I want to do with inline script but in separate array. // external js script <script src="file.js"></script> // inline <script> var js= 0; </script> Now, I want to get script with src attribute in an array and remove those from the code. and similar for inline script. Thank You! Currently I have this code. Whatever I do I could not achieve what I want. something missed everytime. <?php ob_start(); ?> HTML code ... ... .. <?php ///* $s_header = ob_get_contents(); ob_end_clean(); preg_match_all('/(script|src)=("|\')[^"\'>]+/i', $s_header, $media); $js = preg_replace('/(src)+("|\'|="|=\')(.*)/i', "$3", $media[0]); // get inline //preg_match_all('/<script([^>].*)(^src).*([^>]*)>/i', $s_header, $jsInline); $reg = ''; function strip_tags_content($text, $tags = '', $invert = FALSE) { global $reg; preg_match_all('/<(.+?)[\s]*\/?[\s]*>/si', trim($tags), $tags); $tags = array_unique($tags[1]); if(is_array($tags) AND count($tags) > 0) { if($invert == FALSE) { return preg_replace('@<(?!(?:'. implode('|', $tags) .')\b)(\w+)\b.*?>.*?</\1>@si', '', $text); } else { $reg = '<('. implode('|', $tags) .')\b.*?>.*?</\1>'; return preg_replace("@$reg@si", '', $text); } } elseif($invert == FALSE) { return preg_replace('@<(\w+)\b.*?>.*?</\1>@si', '', $text); } return $text; } $s_header = strip_tags_content($s_header, '<script>', true); foreach ($js as $jsFile) { $allJs .= "<script src='$jsFile'></script>\n"; } echo $s_header.$allJs; //echo '<hr>'; //print_r($js); //print_r($jsInline); ?>
  23. Posting any question here will be good. as you will get reply from any one who is available.
  24. So, if you Ajax function is working correctly then on the callback function, when everything is ready and you populate select option, there you put some js code and put your data on input box. Your input box should be hidden first. When you got Ajax Complete state then put data on input box and un hide them.
×
×
  • 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.