require?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bfdexp
Forum Newbie
Posts: 7
Joined: Wed Jul 05, 2006 2:14 pm

require?

Post by bfdexp »

Another interesting issue for everyone:

My infamous log-in script works great, except one issue with HTTPS.

In the beginning of the script, I use a mySQL Link resource to point to some mySQL files and variables. It is the first line in my code:

Code: Select all

<?php require($_SERVER["DOCUMENT_ROOT"]."/Connections/dbase.php"); ?>
It works fine when I vist the log-in as mysite.com/sec/login.php

However it no longer works when I visit the log-in with a shared SSL. It is because I have to visit the page in a differnt way, https://ipnumber/~username/sec/login.php

When I visit the site as a HTTPS, I think it is not finding the URL, here is the error:


Warning: main(/Connections/dbase.php): failed to open stream: No such file or directory in /home/username/public_html/sec/login.php on line 1

Warning: main(/Connections/dbase.php): failed to open stream: No such file or directory in /home/usename/public_html/sec/login.php on line 1

Fatal error: main(): Failed opening required '/Connections/dbase.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/sec/index.php on line 1
bfdexp
Forum Newbie
Posts: 7
Joined: Wed Jul 05, 2006 2:14 pm

Any Suggestions?

Post by bfdexp »

Any suggestions how I can require this file. I really can't figure any way of doing it????
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

you could probably creat a copy of your database include and place it inside your secure folder, and call it from there.
Post Reply