I recently created many web applications by using PHPMaker and most of time, I want to know what is the Root URL or Homepage URL of each web application. This is very important since I have customized the PHPMaker template that needs this Root or Homepage URL as the prefix of password activation URL. I have to define the Root or Homepage URL that usually are difference between one web applications and the others. Unfortunately, up to PHPMaker 9 has not provided the function in order to return this Root or Homepage URL.
Actually, Root or Homepage URL depends on where you put your web files. For example, if you have a domain www.mydomain.com and you put all of your generated web files under the "public_html", then the Root or Homepage URL should return as www.mydomain.com. But, if you put all of your generated web files under "myapp" sub-directory under that "public_html", then the Root or Homepage URL should return as www.mydomain.com/myapp. Now I hope you know what the Root or the Homepage URL is. In other words, it depends on where you put your generated web files.
So, the following customization will add a new function that you can use to get the Root or Homepage URL of your web applications that generated by PHPMaker. A simple function yet so powerful.
Updated on July 22, 2012: This customization has been implemented in PHPMaker version 9.0.3, it matches to each other, and as a result, it works properly.
Updated on September 5, 2012: This customization has been implemented in PHPMaker version 9.0.4, it matches to each other, and as a result, it works properly.
Updated on November 29, 2012: This customization has been implemented in PHPMaker version 9.1.0, it matches to each other, and as a result, it works properly.
Updated on February 9, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.
[hidepost]
-
Open your \Script\ewshared.php file, and find this code:
?> <!--##/session##-->
before the first line of that code, please insert the following code:
// Begin of modification Home Page URL, by Masino Sinaga, June 19, 2012 function ms_RootHomepageUrl() { $sUrl = ew_FullUrl(); return substr($sUrl, 0, strrpos($sUrl, "/")); } // End of modification Home Page URL, by Masino Sinaga, June 19, 2012 - Re-generate your script files using PHPMaker as always.
[/hidepost]
[…] Please note that since this customization is related with my customization in the articles: – How to Use Email Template Based on the Selected Language in Websites that Created with PHPMaker 9.0.1 – How to Get Root or Homepage URL of Websites that Generated by PHPMaker 9.0.2 […]