Where is this file??

I created a custom page with the Administration center on my Dolphin Website. The page is as shown below:

http://mysite.com/page/contactme

Where is this file on my server? I noticed there isn't even a folder on the server titled "page" so where do I find this file. The reason being is, I am trying to make a php script calling for that file:

 

<?php include ("http://www.mysite.com/page/contactme"); ?>

Thanks for your help!

Quote · 4 Mar 2012

It does not exist.

Pages built in page builder are dynamically generated from information in the database via viewpage.php. the /page/ in the url is translated by the rewrite rules in .htaccess.

Welcome to the world of database driven websites.

Having the builder actually create physical pages would be a serious security risk because the folder that those pages are created in would have to be writable by the web server. Also the pages created would be owned by the web server. Both of those facts would allow a hacker to alter the content of any of those pages at will. Thus, the reason why it's not done like that.

In other words there is no physical page.

So you can try this instead.

<?php include ('http://www.mysite.com/viewPage.php?ID=contactme'); ?>

https://www.deanbassett.com
Quote · 4 Mar 2012

Wow. You really are impressive! Thanks so much for all your help! I must ask though, how did you get so smart with the Dolphin structure and files? Is there a book or manual I am missing out on? 

Thanks again!!

Quote · 4 Mar 2012

There is just one more problem with this, When you are logged in to the site, it does not save your login status when you go to the new page. For example, 

My site: http://mysite.com/ - You're logged in on every page 

Custom Page: http://mysite.com/about/contactme/contactform.php - Not logged in even if you are already on the main site.

Custom Page Code:

 

<?php
 
$includeFile = file_get_contents("http://www.mysite.com/viewPage.php?ID=contactme");
 
echo $includeFile;
?>
So is there any php script or code that I can use to fix this?
Thanks!

 

Quote · 4 Mar 2012

 

Wow. You really are impressive! Thanks so much for all your help! I must ask though, how did you get so smart with the Dolphin structure and files? Is there a book or manual I am missing out on? 

Thanks again!!

 No. No book. over 4 years of looking at the code and using dolphin.


https://www.deanbassett.com
Quote · 4 Mar 2012

 

There is just one more problem with this, When you are logged in to the site, it does not save your login status when you go to the new page. For example, 

My site: http://mysite.com/ - You're logged in on every page 

Custom Page: http://mysite.com/about/contactme/contactform.php - Not logged in even if you are already on the main site.

Custom Page Code:

 

<?php
 
$includeFile = file_get_contents("http://www.mysite.com/viewPage.php?ID=contactme");
 
echo $includeFile;
?>
So is there any php script or code that I can use to fix this?
Thanks!

 

Your saying mysite.com for both of those links. But i have to ask. Is this http://mysite.com/about/contactme/contactform.php link a dolphin site? I know you do not want to include real urls to your site, but that information would help. If you have to different domain names, then use two different domain names in your fake names so it paints a clearer picture.

I am guessing it not the same site. Because it would not make sense to create a page in a dolphin website only to include it in that manner in another script in the same dolphin website.

So if my guess is correct, and your trying to include a page from dolphin into a page on another website, and that page required logon to the dolphin site, then it won't work. The cookies that are used to store the logon information from one site are not transfered to another site. So if thats what you are tring to do, then you may as well forget it.


https://www.deanbassett.com
Quote · 4 Mar 2012

What I am trying to do is make a page on my website with the basic header, navbar, styles, and footers. The only way I have discovered how to do this was using this php include way. If you have any suggestions on how to do this, please let me know. Here are the real urls that I am trying to use this idea on.

http://my-cabinet.com/page/cgames_actiongames

which would go to 

http://my-cabinet.com/games/action/

The reason I would like it like this is the url is easier to remember. Also, I have a subdomain

http://games.my-cabinet.com/action/ which the file would be also. 

 

Edit: I understand using an iframe html code would work, but I viewed this as a waste of time because when someone would click on a link in it, the URL wouldn't change. 

Quote · 4 Mar 2012

 

What I am trying to do is make a page on my website with the basic header, navbar, styles, and footers. The only way I have discovered how to do this was using this php include way. If you have any suggestions on how to do this, please let me know. Here are the real urls that I am trying to use this idea on.

http://my-cabinet.com/page/cgames_actiongames

which would go to 

http://my-cabinet.com/games/action/

The reason I would like it like this is the url is easier to remember. Also, I have a subdomain

http://games.my-cabinet.com/action/ which the file would be also. 

 

Edit: I understand using an iframe html code would work, but I viewed this as a waste of time because when someone would click on a link in it, the URL wouldn't change. 

Including the page on the last url with the subdomain would not work. It is techinically a different domain, thus logons would not be maintained.

But you do not need to do anything with the second one. If all you want is to have the first url to read like the second one then a simple addition to the htaccess file would do that.

For example. Adding this to the .htaccess file just after....

RewriteRule ^page/(.*)$  viewPage.php?ID=$1 [QSA,L]

If you add this...

RewriteRule ^games/action/(.*)$  viewPage.php?ID=cgames_actiongames [QSA,L]

That would simply treat http://my-cabinet.com/games/action/ as if it were http://my-cabinet.com/page/cgames_actiongames No seperate php file would be needed. And no include. Just a simple rewrite to change the way the url looks.

Now as for the subdomain. Not going to happen and maintain logons. The only way there is a iframe.









https://www.deanbassett.com
Quote · 4 Mar 2012

Wow. I can't thank you enough for this!! I've decided to just delete the sub domain. Way too much hassle with that. Thank You! I never realized I could rewrite any url I wanted to with .htaccess! Amazing.

Quote · 4 Mar 2012

Well not exactly. You can't just rewrite any URL. The new URL cannot conflict with one that already exists. You have to be carefull with URL conflicts.

And i made a error in that addition i provided. Should read like this.

RewriteRule ^games/action/(.*)$  viewPage.php?ID=cgames_actiongames/$1 [QSA,L]

https://www.deanbassett.com
Quote · 4 Mar 2012

The one you wrote before did work, but I will fix it to the updated one anyway. Thanks!

Quote · 4 Mar 2012

The first one does not allow the passing of any additional parameters on the url. The second one does. I made the correction just in case you may need to pass additional parameters to the page on the url.

https://www.deanbassett.com
Quote · 4 Mar 2012

Oh, I understand now, how it works. Thanks again for all your help!!

Quote · 4 Mar 2012

Now, as of today, this does not work. This is exactly how my .htaccess file looks:

Options -MultiViews -Indexes
 
<IfModule mod_php4.c>
#php_flag register_globals Off
</IfModule>
<IfModule mod_php5.c>
#php_flag allow_url_include Off
#php_flag register_globals Off
</IfModule>
 
<IfModule mod_rewrite.c>
RewriteEngine on
 
RewriteRule ^blogs/{0,1}$   modules/boonex/blogs/blogs.php [QSA,L]
RewriteRule ^blogs/all/{0,1}$  modules/boonex/blogs/blogs.php?action=all  [QSA,L]
RewriteRule ^blogs/all/([0-9]+)/([0-9]+)/{0,1}$  modules/boonex/blogs/blogs.php?page=$2&per_page=$1  [QSA,L]
RewriteRule ^blogs/top/{0,1}$   modules/boonex/blogs/blogs.php?action=top_blogs [QSA,L]
RewriteRule ^blogs/top/([0-9]+)/([0-9]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=top_blogs&page=$2&per_page=$1 [QSA,L]
RewriteRule ^blogs/top_posts/{0,1}$   modules/boonex/blogs/blogs.php?action=top_posts [QSA,L]
RewriteRule ^blogs/top_posts/([0-9]+)/([0-9]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=top_posts&page=$2&per_page=$1 [QSA,L]
RewriteRule ^blogs/tag/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=search_by_tag&tagKey=$1 [QSA,L]
RewriteRule ^blogs/tag/{0,1}$   modules/boonex/blogs/blogs.php?action=search_by_tag&tagKey= [QSA,L]
RewriteRule ^blogs/posts/([^/.]+)/tag/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=search_by_tag&tagKey=$2&ownerName=$1 [QSA,L]
RewriteRule ^blogs/posts/([^/.]+)/category/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2 [QSA,L]
RewriteRule ^blogs/entry/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_post&postUri=$1 [QSA,L]
RewriteRule ^blogs/entry/{0,1}$    modules/boonex/blogs/blogs.php?action=show_member_post&postUri= [QSA,L]
RewriteRule ^blogs/posts/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerName=$1 [QSA,L]
RewriteRule ^blogs/posts/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerName= [QSA,L]
RewriteRule ^blogs/posts/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerName=$1&page=$3&per_page=$2 [QSA,L]
RewriteRule ^blogs/posts/([^/.]+)/category/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2&page=$4&per_page=$3 [QSA,L]
RewriteRule ^blogs/home/{0,1}$   modules/boonex/blogs/blogs.php?action=home [QSA,L]
RewriteRule ^blogs/all_posts/{0,1}$   modules/boonex/blogs/blogs.php?action=all_posts [QSA,L]
RewriteRule ^blogs/popular_posts/{0,1}$   modules/boonex/blogs/blogs.php?action=popular_posts [QSA,L]
RewriteRule ^blogs/featured_posts/{0,1}$   modules/boonex/blogs/blogs.php?action=featured_posts [QSA,L]
RewriteRule ^blogs/tags/{0,1}$   modules/boonex/blogs/blogs.php?action=tags [QSA,L]
RewriteRule ^blogs/show_calendar/{0,1}$   modules/boonex/blogs/blogs.php?action=show_calendar [QSA,L]
RewriteRule ^blogs/my_page/{0,1}$   modules/boonex/blogs/blogs.php?action=my_page&mode=main [QSA,L]
RewriteRule ^blogs/my_page/add/{0,1}$   modules/boonex/blogs/blogs.php?action=my_page&mode=add [QSA,L]
RewriteRule ^blogs/my_page/manage/{0,1}$   modules/boonex/blogs/blogs.php?action=my_page&mode=manage [QSA,L]
RewriteRule ^blogs/my_page/pending/{0,1}$   modules/boonex/blogs/blogs.php?action=my_page&mode=pending [QSA,L]
RewriteRule ^blogs/my_page/edit/([0-9]+)/{0,1}$  modules/boonex/blogs/blogs.php?action=edit_post&EditPostID=$1 [QSA,L]
RewriteRule ^blogs/member_posts/([0-9]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=show_member_blog&ownerID=$1 [QSA,L]
RewriteRule ^blogs/category/([^/.]+)/{0,1}$   modules/boonex/blogs/blogs.php?action=category&uri=$1 [QSA,L]
 
RewriteRule ^ads/{0,1}$  modules/boonex/ads/classifieds.php?Browse=1 [QSA,L]
RewriteRule ^ads/my_page/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page [QSA,L]
RewriteRule ^ads/my_page/add/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=add [QSA,L]
RewriteRule ^ads/my_page/edit/([0-9]+)/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=add&EditPostID=$1 [QSA,L]
RewriteRule ^ads/my_page/edit/([0-9]+)/dimg/([0-9]+)/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=add&EditPostID=$1&dimg=$2 [QSA,L]
RewriteRule ^ads/my_page/manage/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=manage [QSA,L]
RewriteRule ^ads/my_page/pending/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=pending [QSA,L]
RewriteRule ^ads/my_page/disapproved/{0,1}$  modules/boonex/ads/classifieds.php?action=my_page&mode=disapproved [QSA,L]
RewriteRule ^ads/cat/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds.php?catUri=$1 [QSA,L]
RewriteRule ^ads/all/cat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds.php?catUri=$3&page=$2&per_page=$1 [QSA,L]
RewriteRule ^ads/subcat/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds.php?scatUri=$1 [QSA,L]
RewriteRule ^ads/all/subcat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds.php?scatUri=$3&page=$2&per_page=$1 [QSA,L]
RewriteRule ^ads/entry/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds.php?entryUri=$1 [QSA,L]
RewriteRule ^ads/tag/([^/.]+)/{0,1}$  modules/boonex/ads/classifieds_tags.php?tag=$1 [QSA,L]
RewriteRule ^ads/calendar/{0,1}$  modules/boonex/ads/classifieds.php?action=show_calendar [QSA,L]
RewriteRule ^ads/categories/{0,1}$  modules/boonex/ads/classifieds.php?action=show_categories [QSA,L]
RewriteRule ^ads/tags/{0,1}$  modules/boonex/ads/classifieds.php?action=tags [QSA,L]
RewriteRule ^ads/all_ads/{0,1}$  modules/boonex/ads/classifieds.php?action=show_all_ads [QSA,L]
RewriteRule ^ads/top_ads/{0,1}$  modules/boonex/ads/classifieds.php?action=show_top_rated [QSA,L]
RewriteRule ^ads/popular_ads/{0,1}$  modules/boonex/ads/classifieds.php?action=show_popular [QSA,L]
RewriteRule ^ads/featured_ads/{0,1}$  modules/boonex/ads/classifieds.php?action=show_featured [QSA,L]
 
RewriteRule ^search/tag/([^/.]+)/{0,1}$  search.php?Tags=$1 [QSA,L]
 
RewriteRule ^browse/([^/.]+)/([^/.]+)/([^/.]+)$ browse.php?sex=$1&age=$2&country=$3 [QSA,L]
 
RewriteRule ^m/(.*)$  modules/index.php?r=$1 [QSA,L]
 
RewriteRule ^forum/groups/(.*)$  modules/boonex/forum/$1?orca_integration=groups [QSA,L]
RewriteRule ^forum/events/(.*)$  modules/boonex/forum/$1?orca_integration=events [QSA,L]
RewriteRule ^forum/store/(.*)$  modules/boonex/forum/$1?orca_integration=store [QSA,L]
RewriteRule ^forum/$  modules/boonex/forum/index.php [QSA,L]
RewriteRule ^forum/(.*)$  modules/boonex/forum/$1 [QSA,L]
 
RewriteRule ^page/(.*)$  viewPage.php?ID=$1 [QSA,L]
 
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
RewriteRule ^([^/]+)$ profile.php?ID=$1 [QSA,L]
RewriteRule ^games/action/(.*)$  viewPage.php?ID=cgames_actiongames [QSA,L]
RewriteRule ^games/adventure/(.*)$  viewPage.php?ID=cgames_adventuregames [QSA,L]
RewriteRule ^games/arcade/(.*)$  viewPage.php?ID=cgames_arcadegames [QSA,L]
RewriteRule ^games/sport/(.*)$  viewPage.php?ID=cgames_sportgames [QSA,L]
RewriteRule ^games/puzzle/(.*)$  viewPage.php?ID=cgames_puzzlegames [QSA,L]
 
RewriteRule ^games/action(.*)$  viewPage.php?ID=cgames_actiongames [QSA,L]
RewriteRule ^games/adventure(.*)$  viewPage.php?ID=cgames_adventuregames [QSA,L]
RewriteRule ^games/arcade(.*)$  viewPage.php?ID=cgames_arcadegames [QSA,L]
RewriteRule ^games/sport(.*)$  viewPage.php?ID=cgames_sportgames [QSA,L]
RewriteRule ^games/puzzle(.*)$  viewPage.php?ID=cgames_puzzlegames [QSA,L]
 
</IfModule>
 
AddType application/vnd.adobe.air-application-installer-package+zip .air
AddType application/x-shockwave-flash .swf
AuthName "public_html"
AuthUserFile "/home/mcabinet/.htpasswds/public_html/passwd"
 
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml
 
 

Any suggestions on help of why its not working now? And also, how do I get the url on my site

viewPage.php?ID=cgames_home 

to be http://my-cabinet.com/games/ and still have the other URLs like http://my-cabinet.com/games/action still work?

 

Thanks! :)

Quote · 7 Mar 2012

You have your new rewrites in the wrong location.

They should be directly under the rewrite for page.

RewriteRule ^page/(.*)$  viewPage.php?ID=$1 [QSA,L]

Directly under this rule. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The profile rewrite needs to be the last one.

Also the last few entries are missing a trailing /

RewriteRule ^games/action(.*)$  viewPage.php?ID=cgames_actiongames [QSA,L]

Missing / after ^games/action

However. Remove them all.

Put them back in one at a time at the proper location and test after you add each one.

Reversing changes is always the first step when touble shooting.



https://www.deanbassett.com
Quote · 7 Mar 2012

That worked! Now how do I do the other thing I asked? And how do I make it so the URL doesnt have to be case sensitive?

Quote · 7 Mar 2012

I will have to look into the home thing. I am not sure.

As for case insensitivity. Linux servers are case-sensitive. To make the URLS case insensitive would be very difficult, and again, it's something i would have to lookup and test. I have not tried to do it in years. If i remember correctly it is complex and you would need to change all those rules you just added. Perhaps every single rewrite rule in there would have to be changed.

You can do a google search for case insensitive .htaccess

You will see how it's done, and the total pain in the neck it is. You may be better off asking your host to configure apache to be case insensitive.


https://www.deanbassett.com
Quote · 8 Mar 2012

Sorry for the constant questioning, but one more thing. How would I create the .htaccess file to make

http://my-cabinet.com/games/   = http://my-cabinet.com/ViewPage.php?ID=cgames

and

http://my-cabinet.com/games/actionhttp://my-cabinet.com/ViewPage.php?ID=cgames_actiongames

 

Currently, whenever i make the first addition to the .htaccess file, it makes all the folders and urls after /games/ to go to that page (http://my-cabinet.com/ViewPage.php?ID=cgames)

Example: http://my-cabinet.com/games/url/unknown/random/jfldshfkjsl.ghg would still display that same page.

Thanks so much for your continued help.

Quote · 17 Mar 2012

Does anyone Know how do do this? Thanks!!

Quote · 18 Mar 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.