![]() |
#1
|
|||
|
|||
![]()
Is there a defined game url in the script somewhere?
A lot of my code uses things such as across multiple pages: So once this action is submitted Code:
$TableForm = new Form("multiform", "page/action", "post"); So if the form gets shown again using: Code:
$TableForm = new Form("multiform", "page/action", "post"); I am now at mygameurl.com/page/action/page/action = ERROR I rather not hard-code the URL.
__________________
|
#2
|
||||
|
||||
![]()
Try "../../page/action"? Doing so creates a relative path regardless and will go up two directories (if possible, if not, it'll stop at the root).
If this doesn't work I think there is such a thing that you were asking for (but I can't remember where to find it).
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#3
|
||||
|
||||
![]()
Umm? Are you talking about something like DOMAIN.SCRIPTPATH?
I'm taking these from the inc/config.php file. I've never used these before, but if you add include("../inc/config.php"); to each page, you should be able to fetch DOMAIN and SCIPTPATH. If that doesn't work, you could still try your actual domain... though that's not ideal. Edit: Also found this $mysidia->path->getAbsolute() It should work if you've added the $mysidia = Registry::get("mysidia"); to the page. Try: $TableForm = new Form("multiform", "{$mysidia->path->getAbsolute()}page/action", "post"); Last edited by Hwona; 01-26-2016 at 06:34 PM. |
#4
|
|||
|
|||
![]()
Thanks @Wallie987
__________________
|
#5
|
||||
|
||||
![]()
Yeah Wallie987 is right, the method getAbsolute() on Path object will return the absolute path of your site, and it will be useful for you.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
![]() |
|
|
What's New? |
What's Hot? |
What's Popular? |