MyBB Community Forums

Full Version: get current page url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how to get current page url

i want to get current page url in postbit templet
The general method is:

Add the following code to a page:
<?php
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>

You can now get the current page URL using the line:
<?php
  echo curPageURL();
?>
it will work on postbit templet ?

using {$mybb->settings['bburl']}/{$post['postlink']}

return url http://www.visionarysoft.com/Thread-I-m-...on?pid=946

want to remove last ?pid=946 from url