DRT Software Support Forum

Support Forum => Tarqo IMS Product Support => MembershipEase - Instant Membership Site Creator => Topic started by: arizonakid on June 10, 2010, 07:38:02 AM

Title: Using <?php include inside a members only site
Post by: arizonakid on June 10, 2010, 07:38:02 AM
I am trying to use a <?php include statement in my members pages to allow members to view topics but I keep getting an error reference authorization failure

failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required

How can I code the authorization within the php file

Thanks

Tony Prodger
Title: Re: Using <?php include inside a members only site
Post by: kiosk2 on June 11, 2010, 02:00:39 PM
Are you logged in when you try to view the page?
Title: Re: Using <?php include inside a members only site
Post by: arizonakid on June 11, 2010, 03:10:23 PM
I am logged in as the administrator

Tony
Title: Re: Using <?php include inside a members only site
Post by: kiosk2 on June 12, 2010, 12:43:01 AM
Try logging in as a user and viewing. If not, PM me log in details and I'll take a look.
Title: Re: Using <?php include inside a members only site
Post by: arizonakid on June 12, 2010, 05:30:06 AM
I have created a user id = fredsmith with a password of password.
the members site is http://www.reallybasic.com/members. If you select PHP from the top menu  you will see my error. The right mouse button is not disabled so you should be able to see the source

Many thanks

Tony
ps.  I am away for periods today but will check in as often as I can and no it has nothing to do with the Football World Cup
Title: Re: Using <?php include inside a members only site
Post by: kiosk2 on June 15, 2010, 07:25:54 AM
Hi Tony

I see what you mean - does that page open ok if it's not included in the locked area?  I can't see how it could be affected.
Title: Re: Using <?php include inside a members only site
Post by: arizonakid on June 15, 2010, 10:06:48 AM
Yes I have no problems with the page outside the protected area

Tony
Title: Re: Using <?php include inside a members only site
Post by: Johnny Slater on June 15, 2010, 04:59:08 PM
It's trying to load http://www.reallybasic.com/php/includes/contents.html
when it should be loading http://www.reallybasic.com/members/php/includes/contents.html
Title: Re: Using <?php include inside a members only site
Post by: kiosk2 on June 16, 2010, 02:27:51 AM
Good spot Johnny - Tony, does that fix it?
Title: Re: Using <?php include inside a members only site
Post by: arizonakid on June 16, 2010, 03:31:34 AM
Yes Good spot Johnny - but it doesn't appear to have solved the problem, my error codes are now as below. I need to reboot and clean off the old files to give it a clean restart. Thanks for your time guys

Tony

'Warning: include(http://www.reallybasic.com/members/php/includes/contents.html) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /home/reallyba/public_html/members/php/index.php on line 28

Warning: include() [function.include]: Failed opening 'http://www.reallybasic.com/members/php/includes/contents.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/reallyba/public_html/members/php/index.php on line 28

Warning: include(http://www.reallybasic.com/members/php/includes/optinbox.html) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /home/reallyba/public_html/members/php/index.php on line 29

Warning: include() [function.include]: Failed opening 'http://www.reallybasic.com/members/php/includes/optinbox.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/reallyba/public_html/members/php/index.php on line 29'
Title: Re: Using <?php include inside a members only site
Post by: arizonakid on June 18, 2010, 04:38:16 AM
Hi guys

Kevin Yank from Sitepoint gave me the solution. He said it was bad practice to use URL's in include statements. I changed the include statement to point to the file. i.e <?php include('includes/contents.html');?>

Works brilliantly

Thanks again for all your advice and suggestions

Tony