DEFINED GAME URL?

Forum
Last Post
Threads / Messages

FounderSim

Member
Member
Joined
Sep 23, 2014
Messages
65
Points
0
Mysidian Dollar
4,975
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.
 
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).
 
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:
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.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,134
Members
1,604
Latest member
grandcorsair
BETA

Latest Threads

Latest Posts

Top