Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 6:23 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
Posted: Sat Jan 19, 2008 1:56 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jan 19, 2008 1:44 pm
Posts: 5
I have installed the runphp plugin to run a php script on a static content page. I used the runphp plugin to include a php page from includes directory:

{runphp} include_once 'includes/energie.php';{/runphp}

The script is running fine except for one issue:

I need the url of the current page for a form. I tried it this way:

$url = $_SERVER['PHP_SELF'];


But this way i get redirected to the wrong page.

Any idea?


Top
  E-mail  
 
Posted: Sun Jan 27, 2008 9:11 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Jul 17, 2007 10:58 pm
Posts: 24
Take a look at the information here: http://php.about.com/od/learnphp/qt/_SERVER_PHP.htm and see if using
$_SERVER['REQUEST_URI']  helps


Top
  E-mail  
 
Posted: Sun Jan 27, 2008 9:35 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jan 19, 2008 1:44 pm
Posts: 5
Thanks this was very helpfull!


Top
  E-mail  
 
Posted: Thu Nov 20, 2008 12:21 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Thu Nov 08, 2007 6:00 pm
Posts: 109
Location: A Coruña (Galiza)
This method is better (Using the Joomla API):
Code:
$myabsoluteurl=JURI::base();


But I don't know if is possible call to the JURI method directly from runphp plugin.

Please let us know about the results if somebody tries this trick. ???

_________________
From the code to the reality!


Top
  E-mail  
 
Posted: Tue Oct 20, 2009 10:38 am 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Mon Aug 27, 2007 7:30 am
Posts: 95
Location: 54°58'47.86"N 2°15'49.28"W
juanparati wrote:
This method is better (Using the Joomla API):
Code:
$myabsoluteurl=JURI::base();


But I don't know if is possible call to the JURI method directly from runphp plugin.

Please let us know about the results if somebody tries this trick. ???


Yes, works for me. But JURI::base() is the base URL of course, not the page you are on. For that you need JURI::current()

_________________
Circumpunct
(Still a few of us Brianists around.)


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group