Showing posts with label Scripts. Show all posts
Showing posts with label Scripts. Show all posts

Friday, June 21, 2013

“Go Back” Button

  1. Browsers already have "back" buttons, so you'd better have a darn good reason for needing to put one on your page!
  2.  
  3. Input button with inline JavaScript
  4. <input type="button" value="Go Back From Whence You Came!" onclick="history.back(-1)" />
  5.  
  6. This is totally obtrusive, but you could fix that by only appending this button through JavaScript.
  7.  
  8. PHP
  9.  
  10. If JavaScript isn't a possibility, you could use the HTTP_REFERER, sanitize it, and echo it out via PHP.

  11. <?php
  12. $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  13. echo "<a href='$url'>back</a>";
  14. ?>

Thursday, June 13, 2013

Your last visit on site script

  1. Your last visit on site script js script:
  2.  
  3. demo : http://adf.ly/Q5aax
  4.  
  5. visit this site  http://adf.ly/Q5aax  and copy this code:
  6.  
  7. <script type="text/javascript">
  8. function getCookie(c_name)
  9. {
  10. if(document.cookie.length>0)
  11. {
  12. c_start=document.cookie.indexOf(c_name + "=" );
  13. if (c_start!=-1)
  14. {
  15. c_start=c_start + c_name.length+1;
  16. c_end=document.cookie.indexOf(";",c_start);
  17. if (c_end==-1) c_end=document.cookie.length;
  18. return unescape(document.cookie.substring(c_start,c_end));
  19. }