Jump to content
Larry Ullman's Book Forums

Recommended Posts

Larry & Forum Members -

 

Sure could use some help.

 

I'm building a Registration application, per the instructions in Larry's book (4th Edition), but continue to receive the following error message following registration:

 

User Registration
An error occurred in script '/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php' on line 10: require(/kunden/homepages/41/d12345679/htdocs/mysite./mysqli_connect.php) [function.require]: failed to open stream: No such file or directory
Date/Time: 1-10-2012 12:17:21
Array
(
[GLOBALS] => Array
*RECURSION*
[_ENV] => Array
	(
		[CONTENT_LENGTH] => 117
		[CONTENT_TYPE] => application/x-www-form-urlencoded
		[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite
		[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
		[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
		[HTTP_ACCEPT_ENCODING] => gzip, deflate
		[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
		[HTTP_CACHE_CONTROL] => no-cache
		[HTTP_CONNECTION] => keep-alive
		[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb
		[HTTP_DNT] => 1
		[HTTP_HOST] => www.mysite.com
		[HTTP_PRAGMA] => no-cache
		[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php
		[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
		[PATH] => /bin:/usr/bin
		[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php
		[REDIRECT_STATUS] => 200
		[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[REDIRECT_URL] => /login5/htdocs/register.php
		[REMOTE_ADDR] => 66.66.132.5
		[REMOTE_PORT] => 52774
		[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[sCRIPT_URL] => /login5/htdocs/register.php
		[sERVER_ADDR] => 74.208.24.42
		[sERVER_ADMIN] => webmaster@mysite.com
		[sERVER_NAME] => mysite.com
		[sERVER_PORT] => 80
		[sERVER_SIGNATURE] =>
		[sERVER_SOFTWARE] => Apache
		[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[GATEWAY_INTERFACE] => CGI/1.1
		[sERVER_PROTOCOL] => HTTP/1.1
		[REQUEST_METHOD] => POST
		[QUERY_STRING] =>
		[REQUEST_URI] => /login5/htdocs/register.php
		[sCRIPT_NAME] => /login5/htdocs/register.php
		[sTATUS] => 200
		[ORIG_PATH_INFO] => /login5/htdocs/register.php
		[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
	)
[HTTP_ENV_VARS] => Array
	(
		[CONTENT_LENGTH] => 117
		[CONTENT_TYPE] => application/x-www-form-urlencoded
		[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite
		[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
		[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
		[HTTP_ACCEPT_ENCODING] => gzip, deflate
		[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
		[HTTP_CACHE_CONTROL] => no-cache
		[HTTP_CONNECTION] => keep-alive
		[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb
		[HTTP_DNT] => 1
		[HTTP_HOST] => www.mysite.com
		[HTTP_PRAGMA] => no-cache
		[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php
		[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
		[PATH] => /bin:/usr/bin
		[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php
		[REDIRECT_STATUS] => 200
		[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[REDIRECT_URL] => /login5/htdocs/register.php
		[REMOTE_ADDR] => 66.66.132.5
		[REMOTE_PORT] => 52774
		[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[sCRIPT_URL] => /login5/htdocs/register.php
		[sERVER_ADDR] => 74.208.24.42
		[sERVER_ADMIN] => webmaster@mysite.com
		[sERVER_NAME] => mysite.com
		[sERVER_PORT] => 80
		[sERVER_SIGNATURE] =>
		[sERVER_SOFTWARE] => Apache
		[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[GATEWAY_INTERFACE] => CGI/1.1
		[sERVER_PROTOCOL] => HTTP/1.1
		[REQUEST_METHOD] => POST
		[QUERY_STRING] =>
		[REQUEST_URI] => /login5/htdocs/register.php
		[sCRIPT_NAME] => /login5/htdocs/register.php
		[sTATUS] => 200
		[ORIG_PATH_INFO] => /login5/htdocs/register.php
		[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
	)
[_POST] => Array
	(
		[first_name] => John
		[last_name] => Smith
		[email] => posts@just-posted.info
		[password1] => 080557
		[password2] => 080557
		[submit] => Register
	)
[HTTP_POST_VARS] => Array
	(
		[first_name] => John
		[last_name] => Smith
		[email] => posts@just-posted.info
		[password1] => 080557
		[password2] => 080557
		[submit] => Register
	)
[_GET] => Array
	(
	)
[HTTP_GET_VARS] => Array
	(
	)
[_COOKIE] => Array
	(
		[__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2
		[__utmc] => 192530685
		[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/
		[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb
	)
[HTTP_COOKIE_VARS] => Array
	(
		[__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2
		[__utmc] => 192530685
		[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/
		[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb
	)
[_SERVER] => Array
	(
		[CONTENT_LENGTH] => 117
		[CONTENT_TYPE] => application/x-www-form-urlencoded
		[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite
		[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
		[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
		[HTTP_ACCEPT_ENCODING] => gzip, deflate
		[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
		[HTTP_CACHE_CONTROL] => no-cache
		[HTTP_CONNECTION] => keep-alive
		[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb
		[HTTP_DNT] => 1
		[HTTP_HOST] => www.mysite.com
		[HTTP_PRAGMA] => no-cache
		[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php
		[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
		[PATH] => /bin:/usr/bin
		[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php
		[REDIRECT_STATUS] => 200
		[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[REDIRECT_URL] => /login5/htdocs/register.php
		[REMOTE_ADDR] => 66.66.132.5
		[REMOTE_PORT] => 52774
		[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[sCRIPT_URL] => /login5/htdocs/register.php
		[sERVER_ADDR] => 74.208.24.42
		[sERVER_ADMIN] => webmaster@mysite.com
		[sERVER_NAME] => mysite.com
		[sERVER_PORT] => 80
		[sERVER_SIGNATURE] =>
		[sERVER_SOFTWARE] => Apache
		[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[GATEWAY_INTERFACE] => CGI/1.1
		[sERVER_PROTOCOL] => HTTP/1.1
		[REQUEST_METHOD] => POST
		[QUERY_STRING] =>
		[REQUEST_URI] => /login5/htdocs/register.php
		[sCRIPT_NAME] => /login5/htdocs/register.php
		[sTATUS] => 200
		[ORIG_PATH_INFO] => /login5/htdocs/register.php
		[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[php_SELF] => /login5/htdocs/register.php
		[REQUEST_TIME] => 1326215841
		[argv] => Array
			(
			)
		[argc] => 0
	)
[HTTP_SERVER_VARS] => Array
	(
		[CONTENT_LENGTH] => 117
		[CONTENT_TYPE] => application/x-www-form-urlencoded
		[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite
		[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
		[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
		[HTTP_ACCEPT_ENCODING] => gzip, deflate
		[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
		[HTTP_CACHE_CONTROL] => no-cache
		[HTTP_CONNECTION] => keep-alive
		[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb
		[HTTP_DNT] => 1
		[HTTP_HOST] => www.mysite.com
		[HTTP_PRAGMA] => no-cache
		[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php
		[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
		[PATH] => /bin:/usr/bin
		[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
		[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php
		[REDIRECT_STATUS] => 200
		[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[REDIRECT_URL] => /login5/htdocs/register.php
		[REMOTE_ADDR] => 66.66.132.5
		[REMOTE_PORT] => 52774
		[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php
		[sCRIPT_URL] => /login5/htdocs/register.php
		[sERVER_ADDR] => 74.208.24.42
		[sERVER_ADMIN] => webmaster@mysite.com
		[sERVER_NAME] => mysite.com
		[sERVER_PORT] => 80
		[sERVER_SIGNATURE] =>
		[sERVER_SOFTWARE] => Apache
		[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI
		[GATEWAY_INTERFACE] => CGI/1.1
		[sERVER_PROTOCOL] => HTTP/1.1
		[REQUEST_METHOD] => POST
		[QUERY_STRING] =>
		[REQUEST_URI] => /login5/htdocs/register.php
		[sCRIPT_NAME] => /login5/htdocs/register.php
		[sTATUS] => 200
		[ORIG_PATH_INFO] => /login5/htdocs/register.php
		[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php
		[php_SELF] => /login5/htdocs/register.php
		[REQUEST_TIME] => 1326215841
		[argv] => Array
			(
			)
		[argc] => 0
	)
[_FILES] => Array
	(
	)
[HTTP_POST_FILES] => Array
	(
	)
[_REQUEST] => Array
	(
		[first_name] => John
		[last_name] => Smith
		[email] => posts@just-posted.info
		[password1] => 080557
		[password2] => 080557
		[submit] => Register
		[__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2
		[__utmc] => 192530685
		[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/
		[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb
	)
[page_title] => User Registration
[HTTP_SESSION_VARS] => Array
	(
	)
[_SESSION] => Array
	(
	)
)
#0  my_error_handler(2, require(/kunden/homepages/41/d12345679/htdocs/mysite./mysqli_connect.php) [function.require]: failed to open stream: No such file or directory, /homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php, 10, Array ([GLOBALS] => Array ( *RECURSION*,[_ENV] => Array ([CONTENT_LENGTH] => 117,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CACHE_CONTROL] => no-cache,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb,[HTTP_DNT] => 1,[HTTP_HOST] => www.mysite.com,[HTTP_PRAGMA] => no-cache,[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[REDIRECT_URL] => /login5/htdocs/register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 52774,[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[sCRIPT_URL] => /login5/htdocs/register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.com,[sERVER_NAME] => mysite.com,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /login5/htdocs/register.php,[sCRIPT_NAME] => /login5/htdocs/register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /login5/htdocs/register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php),[HTTP_ENV_VARS] => Array ([CONTENT_LENGTH] => 117,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CACHE_CONTROL] => no-cache,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb,[HTTP_DNT] => 1,[HTTP_HOST] => www.mysite.com,[HTTP_PRAGMA] => no-cache,[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[REDIRECT_URL] => /login5/htdocs/register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 52774,[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[sCRIPT_URL] => /login5/htdocs/register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.com,[sERVER_NAME] => mysite.com,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /login5/htdocs/register.php,[sCRIPT_NAME] => /login5/htdocs/register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /login5/htdocs/register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php),[_POST] => Array ([first_name] => John,[last_name] => Smith,[email] => posts@just-posted.info,[password1] => 080557,[password2] => 080557,[submit] => Register),[HTTP_POST_VARS] => Array ([first_name] => John,[last_name] => Smith,[email] => posts@just-posted.info,[password1] => 080557,[password2] => 080557,[submit] => Register),[_GET] => Array (),[HTTP_GET_VARS] => Array (),[_COOKIE] => Array ([__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2,[__utmc] => 192530685,[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/,[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb),[HTTP_COOKIE_VARS] => Array ([__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2,[__utmc] => 192530685,[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/,[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb),[_SERVER] => Array ([CONTENT_LENGTH] => 117,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CACHE_CONTROL] => no-cache,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb,[HTTP_DNT] => 1,[HTTP_HOST] => www.mysite.com,[HTTP_PRAGMA] => no-cache,[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[REDIRECT_URL] => /login5/htdocs/register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 52774,[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[sCRIPT_URL] => /login5/htdocs/register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.com,[sERVER_NAME] => mysite.com,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /login5/htdocs/register.php,[sCRIPT_NAME] => /login5/htdocs/register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /login5/htdocs/register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[php_SELF] => /login5/htdocs/register.php,[REQUEST_TIME] => 1326215841,[argv] => Array (),[argc] => 0),[HTTP_SERVER_VARS] => Array ([CONTENT_LENGTH] => 117,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d12345679/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CACHE_CONTROL] => no-cache,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => __utma=192530685.1272331881.1326138801.1326138801.1326142093.2; __utmc=192530685; __utmz=192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/; PHPSESSID=928065e4b4ccd4542e5f1f6152b3b5cb,[HTTP_DNT] => 1,[HTTP_HOST] => www.mysite.com,[HTTP_PRAGMA] => no-cache,[HTTP_REFERER] => http://www.mysite.com/login5/htdocs/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d12345679/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[REDIRECT_SCRIPT_URL] => /login5/htdocs/register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[REDIRECT_URL] => /login5/htdocs/register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 52774,[sCRIPT_FILENAME] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[sCRIPT_URI] => http://www.mysite.com/login5/htdocs/register.php,[sCRIPT_URL] => /login5/htdocs/register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.com,[sERVER_NAME] => mysite.com,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwxyoUrQEAIAADB6cWI,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /login5/htdocs/register.php,[sCRIPT_NAME] => /login5/htdocs/register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /login5/htdocs/register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php,[php_SELF] => /login5/htdocs/register.php,[REQUEST_TIME] => 1326215841,[argv] => Array (),[argc] => 0),[_FILES] => Array (),[HTTP_POST_FILES] => Array (),[_REQUEST] => Array ([first_name] => John,[last_name] => Smith,[email] => posts@just-posted.info,[password1] => 080557,[password2] => 080557,[submit] => Register,[__utma] => 192530685.1272331881.1326138801.1326138801.1326142093.2,[__utmc] => 192530685,[__utmz] => 192530685.1326138801.1.1.utmcsr=mysite.com|utmccn=(referral)|utmcmd=referral|utmcct=/login4/htdocs/,[phpSESSID] => 928065e4b4ccd4542e5f1f6152b3b5cb),[page_title] => User Registration,[HTTP_SESSION_VARS] => Array (),[_SESSION] => Array ())) called at [/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php:10]
#1  require() called at [/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php:10]

Fatal error: require() [function.require]: Failed opening required '/kunden/homepages/41/d12345679/htdocs/mysite./mysqli_connect.php' (include_path='.:/usr/lib/php5') in /homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php on line 10

 

Can you identify the problem, and a possible solution.

 

Many thanks.

 

Mary -

Link to post
Share on other sites

in script '/homepages/41/d12345679/htdocs/mysite/login5/htdocs/register.php' on line 10: require(/kunden/homepages/41/d12345679/htdocs/mysite./mysqli_connect.php) [function.require]: failed to open stream: No such file or directory

 

It just means that on line 10 of the register.php file you are not giving the right path (URI) for your mysqli_connect.php file. And this is probably because this URI should not include htdocs/. It should probably end with d12345679/mysite/mysqli_connect.php.

 

This topic from the previous forum may help you (see neil_g_cnd's answer, nearly at the bottom of the page).

 

I hope this helps,

Link to post
Share on other sites

Paul & Jonathon -

 

Thanks for your replies.

 

Still having problems ...

 

My site structure is as follows:

 

Main Directory ... contains the (1) HTML directory, and the (2) mysqli_connect.php file

 

HTML Directory ... contains the (1) include directory, and the following files:

  • activate.php
  • change_password.php
  • forgot_password.php
  • index.html
  • index.php
  • login.php
  • logout.php
  • register.php

 

INCLUDE Directory ... contains the following files

  • config.inc.php
  • footer.html
  • header.html
  • layout.css

 

I continue to have problems with the Registration script, and get the following error message:

 

An error occurred in script '/homepages/41/d94940699/htdocs/mysite/register.php' on line 10: require(/kunden/homepages/41/d94940699/htdocs/mysite./mysqli_connect.php) [function.require]: failed to open stream: No such file or directory
Date/Time: 1-10-2012 17:49:19
Array
(
   [GLOBALS] => Array
*RECURSION*
   [_ENV] => Array
    (
	    [CONTENT_LENGTH] => 131
	    [CONTENT_TYPE] => application/x-www-form-urlencoded
	    [DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite
	    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
	    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
	    [HTTP_ACCEPT_ENCODING] => gzip, deflate
	    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
	    [HTTP_CONNECTION] => keep-alive
	    [HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf
	    [HTTP_DNT] => 1
	    [HTTP_HOST] => mysite.net
	    [HTTP_REFERER] => http://mysite.net/register.php
	    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
	    [PATH] => /bin:/usr/bin
	    [REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [REDIRECT_SCRIPT_URI] => http://mysite.net/register.php
	    [REDIRECT_SCRIPT_URL] => /register.php
	    [REDIRECT_STATUS] => 200
	    [REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [REDIRECT_URL] => /register.php
	    [REMOTE_ADDR] => 66.66.132.5
	    [REMOTE_PORT] => 54352
	    [sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [sCRIPT_URI] => http://mysite.net/register.php
	    [sCRIPT_URL] => /register.php
	    [sERVER_ADDR] => 74.208.24.42
	    [sERVER_ADMIN] => webmaster@mysite.net
	    [sERVER_NAME] => mysite.net
	    [sERVER_PORT] => 80
	    [sERVER_SIGNATURE] =>
	    [sERVER_SOFTWARE] => Apache
	    [uNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [GATEWAY_INTERFACE] => CGI/1.1
	    [sERVER_PROTOCOL] => HTTP/1.1
	    [REQUEST_METHOD] => POST
	    [QUERY_STRING] =>
	    [REQUEST_URI] => /register.php
	    [sCRIPT_NAME] => /register.php
	    [sTATUS] => 200
	    [ORIG_PATH_INFO] => /register.php
	    [ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
    )
   [HTTP_ENV_VARS] => Array
    (
	    [CONTENT_LENGTH] => 131
	    [CONTENT_TYPE] => application/x-www-form-urlencoded
	    [DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite
	    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
	    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
	    [HTTP_ACCEPT_ENCODING] => gzip, deflate
	    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
	    [HTTP_CONNECTION] => keep-alive
	    [HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf
	    [HTTP_DNT] => 1
	    [HTTP_HOST] => mysite.net
	    [HTTP_REFERER] => http://mysite.net/register.php
	    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
	    [PATH] => /bin:/usr/bin
	    [REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [REDIRECT_SCRIPT_URI] => http://mysite.net/register.php
	    [REDIRECT_SCRIPT_URL] => /register.php
	    [REDIRECT_STATUS] => 200
	    [REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [REDIRECT_URL] => /register.php
	    [REMOTE_ADDR] => 66.66.132.5
	    [REMOTE_PORT] => 54352
	    [sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [sCRIPT_URI] => http://mysite.net/register.php
	    [sCRIPT_URL] => /register.php
	    [sERVER_ADDR] => 74.208.24.42
	    [sERVER_ADMIN] => webmaster@mysite.net
	    [sERVER_NAME] => mysite.net
	    [sERVER_PORT] => 80
	    [sERVER_SIGNATURE] =>
	    [sERVER_SOFTWARE] => Apache
	    [uNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [GATEWAY_INTERFACE] => CGI/1.1
	    [sERVER_PROTOCOL] => HTTP/1.1
	    [REQUEST_METHOD] => POST
	    [QUERY_STRING] =>
	    [REQUEST_URI] => /register.php
	    [sCRIPT_NAME] => /register.php
	    [sTATUS] => 200
	    [ORIG_PATH_INFO] => /register.php
	    [ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
    )
   [_POST] => Array
    (
	    [first_name] => John
	    [last_name] => Smith
	    [email] => operations@mysite.com
	    [password1] => 080557
	    [password2] => 080557
	    [submit] => Register
    )
   [HTTP_POST_VARS] => Array
    (
	    [first_name] => John
	    [last_name] => Smith
	    [email] => operations@mysite.com
	    [password1] => 080557
	    [password2] => 080557
	    [submit] => Register
    )
   [_GET] => Array
    (
    )
   [HTTP_GET_VARS] => Array
    (
    )
   [_COOKIE] => Array
    (
	    [phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf
    )
   [HTTP_COOKIE_VARS] => Array
    (
	    [phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf
    )
   [_SERVER] => Array
    (
	    [CONTENT_LENGTH] => 131
	    [CONTENT_TYPE] => application/x-www-form-urlencoded
	    [DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite
	    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
	    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
	    [HTTP_ACCEPT_ENCODING] => gzip, deflate
	    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
	    [HTTP_CONNECTION] => keep-alive
	    [HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf
	    [HTTP_DNT] => 1
	    [HTTP_HOST] => mysite.net
	    [HTTP_REFERER] => http://mysite.net/register.php
	    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
	    [PATH] => /bin:/usr/bin
	    [REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [REDIRECT_SCRIPT_URI] => http://mysite.net/register.php
	    [REDIRECT_SCRIPT_URL] => /register.php
	    [REDIRECT_STATUS] => 200
	    [REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [REDIRECT_URL] => /register.php
	    [REMOTE_ADDR] => 66.66.132.5
	    [REMOTE_PORT] => 54352
	    [sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [sCRIPT_URI] => http://mysite.net/register.php
	    [sCRIPT_URL] => /register.php
	    [sERVER_ADDR] => 74.208.24.42
	    [sERVER_ADMIN] => webmaster@mysite.net
	    [sERVER_NAME] => mysite.net
	    [sERVER_PORT] => 80
	    [sERVER_SIGNATURE] =>
	    [sERVER_SOFTWARE] => Apache
	    [uNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [GATEWAY_INTERFACE] => CGI/1.1
	    [sERVER_PROTOCOL] => HTTP/1.1
	    [REQUEST_METHOD] => POST
	    [QUERY_STRING] =>
	    [REQUEST_URI] => /register.php
	    [sCRIPT_NAME] => /register.php
	    [sTATUS] => 200
	    [ORIG_PATH_INFO] => /register.php
	    [ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [php_SELF] => /register.php
	    [REQUEST_TIME] => 1326235759
	    [argv] => Array
		    (
		    )
	    [argc] => 0
    )
   [HTTP_SERVER_VARS] => Array
    (
	    [CONTENT_LENGTH] => 131
	    [CONTENT_TYPE] => application/x-www-form-urlencoded
	    [DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite
	    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
	    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
	    [HTTP_ACCEPT_ENCODING] => gzip, deflate
	    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
	    [HTTP_CONNECTION] => keep-alive
	    [HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf
	    [HTTP_DNT] => 1
	    [HTTP_HOST] => mysite.net
	    [HTTP_REFERER] => http://mysite.net/register.php
	    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
	    [PATH] => /bin:/usr/bin
	    [REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1
	    [REDIRECT_SCRIPT_URI] => http://mysite.net/register.php
	    [REDIRECT_SCRIPT_URL] => /register.php
	    [REDIRECT_STATUS] => 200
	    [REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [REDIRECT_URL] => /register.php
	    [REMOTE_ADDR] => 66.66.132.5
	    [REMOTE_PORT] => 54352
	    [sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [sCRIPT_URI] => http://mysite.net/register.php
	    [sCRIPT_URL] => /register.php
	    [sERVER_ADDR] => 74.208.24.42
	    [sERVER_ADMIN] => webmaster@mysite.net
	    [sERVER_NAME] => mysite.net
	    [sERVER_PORT] => 80
	    [sERVER_SIGNATURE] =>
	    [sERVER_SOFTWARE] => Apache
	    [uNIQUE_ID] => TwzAb0rQEAIAAC25gaA
	    [GATEWAY_INTERFACE] => CGI/1.1
	    [sERVER_PROTOCOL] => HTTP/1.1
	    [REQUEST_METHOD] => POST
	    [QUERY_STRING] =>
	    [REQUEST_URI] => /register.php
	    [sCRIPT_NAME] => /register.php
	    [sTATUS] => 200
	    [ORIG_PATH_INFO] => /register.php
	    [ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php
	    [php_SELF] => /register.php
	    [REQUEST_TIME] => 1326235759
	    [argv] => Array
		    (
		    )
	    [argc] => 0
    )
   [_FILES] => Array
    (
    )
   [HTTP_POST_FILES] => Array
    (
    )
   [_REQUEST] => Array
    (
	    [first_name] => John
	    [last_name] => Smith
	    [email] => operations@mysite.com
	    [password1] => 080557
	    [password2] => 080557
	    [submit] => Register
	    [phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf
    )
   [page_title] => Register
   [HTTP_SESSION_VARS] => Array
    (
    )
   [_SESSION] => Array
    (
    )
)
#0  my_error_handler(2, require(/kunden/homepages/41/d94940699/htdocs/mysite./mysqli_connect.php) [function.require]: failed to open stream: No such file or directory, /homepages/41/d94940699/htdocs/mysite/register.php, 10, Array ([GLOBALS] => Array ( *RECURSION*,[_ENV] => Array ([CONTENT_LENGTH] => 131,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf,[HTTP_DNT] => 1,[HTTP_HOST] => mysite.net,[HTTP_REFERER] => http://mysite.net/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://mysite.net/register.php,[REDIRECT_SCRIPT_URL] => /register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[REDIRECT_URL] => /register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 54352,[sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[sCRIPT_URI] => http://mysite.net/register.php,[sCRIPT_URL] => /register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.net,[sERVER_NAME] => mysite.net,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /register.php,[sCRIPT_NAME] => /register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php),[HTTP_ENV_VARS] => Array ([CONTENT_LENGTH] => 131,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf,[HTTP_DNT] => 1,[HTTP_HOST] => mysite.net,[HTTP_REFERER] => http://mysite.net/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://mysite.net/register.php,[REDIRECT_SCRIPT_URL] => /register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[REDIRECT_URL] => /register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 54352,[sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[sCRIPT_URI] => http://mysite.net/register.php,[sCRIPT_URL] => /register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.net,[sERVER_NAME] => mysite.net,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /register.php,[sCRIPT_NAME] => /register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php),[_POST] => Array ([first_name] => John,[last_name] => Smith,[email] => operations@mysite.com,[password1] => 080557,[password2] => 080557,[submit] => Register),[HTTP_POST_VARS] => Array ([first_name] => John,[last_name] => Smith,[email] => operations@mysite.com,[password1] => 080557,[password2] => 080557,[submit] => Register),[_GET] => Array (),[HTTP_GET_VARS] => Array (),[_COOKIE] => Array ([phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf),[HTTP_COOKIE_VARS] => Array ([phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf),[_SERVER] => Array ([CONTENT_LENGTH] => 131,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf,[HTTP_DNT] => 1,[HTTP_HOST] => mysite.net,[HTTP_REFERER] => http://mysite.net/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://mysite.net/register.php,[REDIRECT_SCRIPT_URL] => /register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[REDIRECT_URL] => /register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 54352,[sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[sCRIPT_URI] => http://mysite.net/register.php,[sCRIPT_URL] => /register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.net,[sERVER_NAME] => mysite.net,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /register.php,[sCRIPT_NAME] => /register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[php_SELF] => /register.php,[REQUEST_TIME] => 1326235759,[argv] => Array (),[argc] => 0),[HTTP_SERVER_VARS] => Array ([CONTENT_LENGTH] => 131,[CONTENT_TYPE] => application/x-www-form-urlencoded,[DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[DOCUMENT_ROOT] => /kunden/homepages/41/d94940699/htdocs/mysite,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5,[HTTP_CONNECTION] => keep-alive,[HTTP_COOKIE] => PHPSESSID=65d1e8247e65c5323fc34c627fe103cf,[HTTP_DNT] => 1,[HTTP_HOST] => mysite.net,[HTTP_REFERER] => http://mysite.net/register.php,[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,[PATH] => /bin:/usr/bin,[REDIRECT_DBENTRY] => /kunden/homepages/41/d94940699/htdocs/mysite:d0000#CPU 6 #MEM 10240 #CGI 18 #NPROC 12 #TAID 35876564 #WERB 0 #LANG 3 #PARKING 1,[REDIRECT_SCRIPT_URI] => http://mysite.net/register.php,[REDIRECT_SCRIPT_URL] => /register.php,[REDIRECT_STATUS] => 200,[REDIRECT_UNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[REDIRECT_URL] => /register.php,[REMOTE_ADDR] => 66.66.132.5,[REMOTE_PORT] => 54352,[sCRIPT_FILENAME] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[sCRIPT_URI] => http://mysite.net/register.php,[sCRIPT_URL] => /register.php,[sERVER_ADDR] => 74.208.24.42,[sERVER_ADMIN] => webmaster@mysite.net,[sERVER_NAME] => mysite.net,[sERVER_PORT] => 80,[sERVER_SIGNATURE] => ,[sERVER_SOFTWARE] => Apache,[uNIQUE_ID] => TwzAb0rQEAIAAC25gaA,[GATEWAY_INTERFACE] => CGI/1.1,[sERVER_PROTOCOL] => HTTP/1.1,[REQUEST_METHOD] => POST,[QUERY_STRING] => ,[REQUEST_URI] => /register.php,[sCRIPT_NAME] => /register.php,[sTATUS] => 200,[ORIG_PATH_INFO] => /register.php,[ORIG_PATH_TRANSLATED] => /kunden/homepages/41/d94940699/htdocs/mysite/register.php,[php_SELF] => /register.php,[REQUEST_TIME] => 1326235759,[argv] => Array (),[argc] => 0),[_FILES] => Array (),[HTTP_POST_FILES] => Array (),[_REQUEST] => Array ([first_name] => John,[last_name] => Smith,[email] => operations@mysite.com,[password1] => 080557,[password2] => 080557,[submit] => Register,[phpSESSID] => 65d1e8247e65c5323fc34c627fe103cf),[page_title] => Register,[HTTP_SESSION_VARS] => Array (),[_SESSION] => Array ())) called at [/homepages/41/d94940699/htdocs/mysite/register.php:10]
#1  require() called at [/homepages/41/d94940699/htdocs/mysite/register.php:10]

Fatal error: require() [function.require]: Failed opening required '/kunden/homepages/41/d94940699/htdocs/mysite./mysqli_connect.php' (include_path='.:/usr/lib/php5') in /homepages/41/d94940699/htdocs/mysite/register.php on line 10

 

I'm anxious to try the proposed solution which is to use:

 

require $_SERVER['DOCUMENT_ROOT'] . '/rest/of/path/to/file.php';

 

What, specifically, should the syntax be for '/rest/of/path/to/file.php'; ?

 

If the mysqli_connect.php file is the main directory, should the above syntax be: '../../mysqli_connect.php'; in lieu of the DEFINE function (found in the config.inc.php) ?

 

Many thanks for the help.

 

Mary -

Link to post
Share on other sites

The first thing I notice that doesn't look right to me is this "/kunden/homepages/41/d94940699/htdocs/mysite./mysqli_connect.php" - why is there a full stop/period/dot before '/mysqli_connect.php?

 

What set up are you using? Locally? if so MAMP/WAMP/XAMPP etc or is it live?

Link to post
Share on other sites

Hello, Zrakot,

 

Try this script from different locations (on your computer/local host, on your webhost's server, and in different folders).

It should help you with URIs and URLs:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Server test</title>

<style type="text/css">

.bleu { color: #2200cc; /* blue */ }

h2 { margin-top: 2em; margin-bottom: 0.7em; }

h3 { margin-top: 1.2em; margin-bottom: 0.5em; }

p { margin-top: 0 }

</style>

</head>

<body>

 

<h3>IP address of the server host</h3>

<p><span class="bleu">$_SERVER['SERVER_ADDR']</span> =

<?php echo $_SERVER['SERVER_ADDR'] ?>

</p>

 

<h3>Server name</h3>

<p><span class="bleu">$_SERVER['SERVER_NAME']</span> =

<?php echo $_SERVER['SERVER_NAME'] ?>

</p>

 

<h2>URIs</h2>

<h3>Root folder</h3>

<p>(PHP manual: "The document root directory under which the current script is executing, as defined in the server's configuration file.")<br />

<span class="bleu">$_SERVER['DOCUMENT_ROOT']</span> =

<?php echo $_SERVER['DOCUMENT_ROOT'] ?>

</p>

 

<h3>Absolute path for this script from root folder</h3>

<p>(PHP manual: "The filename of the currently executing script, relative to the document root.")<br />

<span class="bleu">$_SERVER['PHP_SELF']</span> =

<?php echo $_SERVER['PHP_SELF'] ?>

</p>

 

<h3>Absolute path for this script</h3>

<p><span class="bleu">$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF']</span> =

<?php echo $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'] ?>

</p>

 

<h3>Absolute pathname of the currently executing script</h3>

<p><span class="bleu">$_SERVER['SCRIPT_FILENAME']</span> =

<?php echo $_SERVER['SCRIPT_FILENAME'] ?>

</p>

 

<h3>Current script's path</h3>

<p>(PHP manual: This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file.)<br />

<span class="bleu">$_SERVER['SCRIPT_NAME']</span> =

<?php echo $_SERVER['SCRIPT_NAME'] ?>

</p>

 

<h3>Folder where this script is kept</h3>

<p><span class="bleu">dirname($_SERVER['PHP_SELF'])</span> =

<?php echo dirname($_SERVER['PHP_SELF']) ?>

</p>

 

<h2>URLs</h2>

<h3>Host name</h3>

<p>(PHP manual: Contents of the <em>Host</em>: header from the current request, if there is one.)<br />

<span class="bleu">$_SERVER['HTTP_HOST']</span> =

<?php echo $_SERVER['HTTP_HOST'] ?>

</p>

 

<h3>Complete URL</h3>

<p><span class="bleu">$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']</span>

<?php echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] ?>

</p>

 

<h2>User's IP Address</h2>

<p>(PHP manual: "The IP address from which the user is viewing the current page.")<br />

<span class="bleu">$_SERVER['REMOTE_ADDR']</span> =

<?php echo $_SERVER['REMOTE_ADDR'] ?>

</p>

 

</body>

</html>

Link to post
Share on other sites

Jonathon -

 

Here is the code I'm using to access mysqli_connect (in Register.php):

 

// Need the database connection:
require $_SERVER['DOCUMENT_ROOT'] . '../mysqli_connect.php';

 

Here, for your reference, is the entire set of code for Register.php:

 

<?php # Script 18.6 - register.php
// This is the registration page for the site.
require ('includes/config.inc.php');
$page_title = 'Register';
include ('includes/header.html');
if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form.
// Need the database connection:
require $_SERVER['DOCUMENT_ROOT'] . '../mysqli_connect.php';

// Trim all the incoming data:
$trimmed = array_map('trim', $_POST);
// Assume invalid values:
$fn = $ln = $e = $p = FALSE;

// Check for a first name:
if (preg_match ('/^[A-Z \'.-]{2,20}$/i', $trimmed['first_name'])) {
 $fn = mysqli_real_escape_string ($dbc, $trimmed['first_name']);
} else {
 echo '<p class="error">Please enter your first name!</p>';
}
// Check for a last name:
if (preg_match ('/^[A-Z \'.-]{2,40}$/i', $trimmed['last_name'])) {
 $ln = mysqli_real_escape_string ($dbc, $trimmed['last_name']);
} else {
 echo '<p class="error">Please enter your last name!</p>';
}

// Check for an email address:
if (filter_var($trimmed['email'], FILTER_VALIDATE_EMAIL)) {
 $e = mysqli_real_escape_string ($dbc, $trimmed['email']);
} else {
 echo '<p class="error">Please enter a valid email address!</p>';
}
// Check for a password and match against the confirmed password:
if (preg_match ('/^\w{4,20}$/', $trimmed['password1']) ) {
 if ($trimmed['password1'] == $trimmed['password2']) {
  $p = mysqli_real_escape_string ($dbc, $trimmed['password1']);
 } else {
  echo '<p class="error">Your password did not match the confirmed password!</p>';
 }
} else {
 echo '<p class="error">Please enter a valid password!</p>';
}

if ($fn && $ln && $e && $p) { // If everything's OK...
 // Make sure the email address is available:
 $q = "SELECT user_id FROM users WHERE email='$e'";
 $r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));

 if (mysqli_num_rows($r) == 0) { // Available.
  // Create the activation code:
  $a = md5(uniqid(rand(), true));
  // Add the user to the database:
  $q = "INSERT INTO users (email, pass, first_name, last_name, active, registration_date) VALUES ('$e', SHA1('$p'), '$fn', '$ln', '$a', NOW() )";
  $r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));
  if (mysqli_affected_rows($dbc) == 1) { // If it ran OK.
   // Send the email:
   $body = "Thank you for registering at Mysite.net. To activate your account, please click on this link:\n\n";
   $body .= BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a";
   mail($trimmed['email'], 'Registration Confirmation', $body, 'From: admin@mysite.net');

   // Finish the page:
   echo '<h3>Thank you for registering! A confirmation email has been sent to your address. Please click on the link in that email in order to activate your account.</h3>';
   include ('includes/footer.html'); // Include the HTML footer.
   exit(); // Stop the page.

  } else { // If it did not run OK.
   echo '<p class="error">You could not be registered due to a system error. We apologize for any inconvenience.</p>';
  }

 } else { // The email address is not available.
  echo '<p class="error">That email address has already been registered. If you have forgotten your password, use the link at right to have your password sent to you.</p>';
 }

} else { // If one of the data tests failed.
 echo '<p class="error">Please try again.</p>';
}
mysqli_close($dbc);
} // End of the main Submit conditional.
?>

<h1>Register</h1>
<form action="register.php" method="post">
<fieldset>

<p><b>First Name:</b> <input type="text" name="first_name" size="20" maxlength="20" value="<?php if (isset($trimmed['first_name'])) echo $trimmed['first_name']; ?>" /></p>

<p><b>Last Name:</b> <input type="text" name="last_name" size="20" maxlength="40" value="<?php if (isset($trimmed['last_name'])) echo $trimmed['last_name']; ?>" /></p>
<p><b>Email Address:</b> <input type="text" name="email" size="30" maxlength="60" value="<?php if (isset($trimmed['email'])) echo $trimmed['email']; ?>" /> </p>

<p><b>Password:</b> <input type="password" name="password1" size="20" maxlength="20" value="<?php if (isset($trimmed['password1'])) echo $trimmed['password1']; ?>" /> <small>Use only letters, numbers, and the underscore. Must be between 4 and 20 characters long.</small></p>
<p><b>Confirm Password:</b> <input type="password" name="password2" size="20" maxlength="20" value="<?php if (isset($trimmed['password2'])) echo $trimmed['password2']; ?>" /></p>
</fieldset>

<div align="center"><input type="submit" name="submit" value="Register" /></div>
</form>
<?php include ('includes/footer.html'); ?>

 

Thanks, Jonathon.

 

Mary -

Link to post
Share on other sites

All -

 

I have opted to change the code from:

 

require $_SERVER['DOCUMENT_ROOT'] . '../mysqli_connect.php';

 

to:

 

require ('mysqli_connect.php');

 

Still can not explain what the problem was, but it is now resolved using the modified code above.

 

If anyone can tell me what the problem was ... it would be very instructive and appreciated.

 

Thank you.

 

Mary -

Link to post
Share on other sites

Mary,

 

If your mysqli_connect.php is located in the /kunden/homepages/41/d94940699/htdocs/mysite directory, then you could use require $_SERVER['DOCUMENT_ROOT'] . '/mysqli_connect.php';

 

require $_SERVER['DOCUMENT_ROOT'] . '../mysqli_connect.php'; would be looking in the /kunden/homepages/41/d94940699/htdocs folder.

 

The code that is working for you will be fine as long as the page with the require statement is in the same folder as the mysqli_connect.php script.

 

What I do is I have my connection script in a folder named 'secure' that is located off the document root folder, and I've protected that folder with a .htaccess file that prevents any access via a browser. This protects the file from being read so the username and password remain unknown. I can then include that connection script with the exact same statement from any script in any folder:

require_once $_SERVER['DOCUMENT_ROOT'] . '/secure/db_connect.inc.php';

My .htaccess file in the secure folder has the following:

# .htaccess file to control folder access
# This folder should not be accessable to general browsing.
# Only PHP scripts may access this folder.


# disable directory browsing
Options All -Indexes

# prevent folder listing
IndexIgnore *

# prevent access to any file
<FilesMatch "^.*$">
Order Allow,Deny
Deny from all
</FilesMatch>

Anyone trying to browse the secure folder will get a Forbidden message, and will not even be able to see what files are located there, much less read them. This is about as safe as you can make it, and I can copy and paste the require statement into any script that needs it, and it always works.

  • Upvote 2
Link to post
Share on other sites

Paul -

 

I like your approach as it is more secure. Will definitely give it a try.

 

Maybe you can help me with something else...

 

Following a user's successful login - I would like to present he or she with a multi-page form. Upon submitting the multi-page form, the user's input should be stored in his or her mysql record. Can you explain how this can be accomplished? Sessions?

 

Also, I would like for the user to be able to view, change, etc. his or her data input. How do I go about doing that?

 

Many thanks.

 

Mary -

Link to post
Share on other sites

Hi Mary,

 

Session variables are a good way to make the form values accessable to multi-page forms. You could also have each form just post the values collected to the next form in the sequence, which can then be stored in hidden form elements so you can pass it along until you reach the final form. As long as the information you are collecting isn't of a sensitive nature, such as Social Security Numbers or usernames and passwords, using hidden form elements should be fine. Otherwise you should use session variables, and probably https to make it sufficiently secure.

 

For allowing users to modify their data, I would save their user id in a session variable once they log in. Then you could use that to query the database for their information, and populate a form for editing the information. The Content Management chapter (at least that's where it is in my 2nd Edition book) has examples of how to retrieve database information into a form for editing.

  • Upvote 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...