Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. function string_limit_words($string, $word_limit) {
  2. $words = explode(' ', $string);
  3. echo $string;
  4. print_r($words);
  5. return implode(' ', array_slice($words, 0, $word_limit));
  6. }
  7. $blog='';
  8.  
  9.  
  10. if($_SERVER["REQUEST_METHOD"] == "POST")
  11. {
  12. $title=mysql_real_escape_string($_POST['title']);
  13. $body=mysql_real_escape_string($_POST['body']);
  14. $title=htmlentities($title);
  15. $body=htmlentities($body);
  16. $date=date("Y/m/d");
  17.  
  18. $newtitle=string_limit_words($title, 6);
  19. $urltitle=preg_replace('/[^a-z0-9]/i',' ', $newtitle);
  20.  
  21. $newurltitle=str_replace(" ","-",$newtitle);
  22. $url=$date.'/'.$newurltitle.'.html';
  23.  
  24. $datetag = "seo";
  25.  
  26. $tag=$date.'/'.$newurltitle.'.html';
  27.  
  28. $tag = '/'.$newurltitle.'.html';
  29.  
  30. mysql_query("insert into blog(title,body,url,taglist) values('$title','$body','$url','$datetag')");
  31. //$blogurl="http://demos.9lessons.info/seo/$url";
  32. $blogurl="$url";
  33.  
  34. <h2>listtag pag<a href="taglist/<?php echo $datetag; ?>?page=2"> taglist.php/<?php echo $datetag; ?> tag list</a></h2>
  35.  
  36. echo $_GET['datetag'];
  37.  
  38. $_GET['datetag']; and $_GET[page];
  39.  
  40. http://localhost/nwr/seo/seo/taglist/seo?page=2
  41.  
  42. echo $_GET['datetag'];
  43. $_GET[page];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement