Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2016, 01:55 AM
FounderSim FounderSim is offline
Member
 
Join Date: Sep 2014
Posts: 65
Gender: Male
Credits: 7,599
FounderSim is on a distinguished road
Default DEFINED GAME URL?

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");
I would then be on mygameurl.com/page/action and then form would be shown again:

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.
__________________
Reply With Quote
  #2  
Old 01-26-2016, 08:43 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,531
Kyttias is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 01-26-2016, 05:52 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,816
Hwona is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 01-27-2016, 01:09 AM
FounderSim FounderSim is offline
Member
 
Join Date: Sep 2014
Posts: 65
Gender: Male
Credits: 7,599
FounderSim is on a distinguished road
Default

Thanks @Wallie987
__________________
Reply With Quote
  #5  
Old 01-27-2016, 09:55 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,979
Hall of Famer is on a distinguished road
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:47 PM.

Currently Active Users: 9803 (0 members and 9803 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636