Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
jrws is on a distinguished road
 
Posts: 4
Join Date: Jul 2008
Default Access? - 07-18-2008, 05:15 AM

I used the search and couldn't find any help so here it is.
When I had uploaded my files I used the command include_once('include/functions.php');
I then got an error that I was not able to use the command include, so I tried require same error. Any help please. I think it is something to do with permissions.
Reply With Quote
(#2 (permalink))
Old
Junior Member
Tarman is on a distinguished road
 
Posts: 6
Join Date: Jul 2008
Default 07-18-2008, 06:37 PM

Mine works and I am using this code hope this helps:

Code:
<?
     include ('includes/header.php');
?>
Reply With Quote
(#3 (permalink))
Old
Red-X's Avatar
Senior Member
Red-X is on a distinguished road
 
Posts: 353
Join Date: Jun 2008
Send a message via AIM to Red-X
Default 07-18-2008, 10:08 PM

Can you post the error message you're getting? And if you can the code you're using?
Reply With Quote
(#4 (permalink))
Old
Junior Member
jrws is on a distinguished road
 
Posts: 4
Join Date: Jul 2008
Default 07-19-2008, 02:36 AM

Thanks I will try that.

@RedX
If I get the error I will post again.
Reply With Quote
(#5 (permalink))
Old
Red-X's Avatar
Senior Member
Red-X is on a distinguished road
 
Posts: 353
Join Date: Jun 2008
Send a message via AIM to Red-X
Default 07-19-2008, 02:39 AM

Ok, I'll be here.
Reply With Quote
(#6 (permalink))
Old
rhuan.barreto's Avatar
Junior Member
rhuan.barreto is on a distinguished road
 
Posts: 6
Join Date: Jul 2008
Send a message via MSN to rhuan.barreto
Default 07-19-2008, 02:42 AM

i'm having the same error.
i cant use the vars defined in a include

the code is

Code:
include '../includes/functions.php';

if (isset($_POST['usuario']) && isset($_POST['senha'])) {
	$con = mysql_connect("$mysql_host","$mysql_user","$mysql_password");
	$db = mysql_select_db($mysql_database,$con);
	if($db) {
		$user = $_POST['usuario'];
		$query = mysql_query("SELECT user, hash FROM siteuser WHERE user='".$user."'");
		if ($query) {
			while ($result = mysql_fetch_row($query)) {
				if($result[0]=$_POST['usuario']) {
						$hash = md5(md5($_POST['senha']));
						if ($result[1]=$hash) {
							login();
							break;
						} else {
							header("Location: login.php?msg=Dados+Incorretos");
							break;
						}
				}
			}
		} else {
			header("Location: login.php?msg=Dados+Incorretos");
		}
	}
} else {
			header("Location: login.php?msg=Dados+Incorretos");
}
on the include functions.php there are the vars of the mysql and the function login().
the page is displaying the content of the include and its not recognizing the vars of the mysql for the connection
Reply With Quote
(#7 (permalink))
Old
Red-X's Avatar
Senior Member
Red-X is on a distinguished road
 
Posts: 353
Join Date: Jun 2008
Send a message via AIM to Red-X
Default 07-19-2008, 02:43 AM

Change it to..

PHP Code:
include("../includes/functions.php"); 
Reply With Quote
(#8 (permalink))
Old
rhuan.barreto's Avatar
Junior Member
rhuan.barreto is on a distinguished road
 
Posts: 6
Join Date: Jul 2008
Send a message via MSN to rhuan.barreto
Default 07-19-2008, 04:17 AM

i changed but same error.

you can see the error on the site www.andect.org.br
do a simple login on the box on the top of the page
Reply With Quote
(#9 (permalink))
Old
Red-X's Avatar
Senior Member
Red-X is on a distinguished road
 
Posts: 353
Join Date: Jun 2008
Send a message via AIM to Red-X
Default 07-19-2008, 04:36 AM

I changed somethings I hope it works, I can't find any more erros

PHP Code:
<?php
include("../includes/functions.php");

if (isset(
$_POST["usuario"]) && isset($_POST["senha"])) {
    
$con mysql_connect($mysql_host$mysql_user$mysql_password);
    
$db mysql_select_db($mysql_database$con);
    if(
$db) {
        
$user $_POST["usuario"];
        
$query mysql_query("SELECT user, hash FROM siteuser WHERE user='{$user}'");
        if (
$query) {
            while (
$result mysql_fetch_row($query)) {
                if(
$result[0]=$_POST['usuario']) {
                        
$hash md5(md5($_POST["senha"]));
                        if (
$result[1]=$hash) {
                            
login();
                            break;
                        } else {
                            
header("Location: login.php?msg=Dados+Incorretos");
                            break;
                        }
                }
            }
        } else {
            
header("Location: login.php?msg=Dados+Incorretos");
        }
    }
} else {
            
header("Location: login.php?msg=Dados+Incorretos");
}
?>
Reply With Quote
(#10 (permalink))
Old
rhuan.barreto's Avatar
Junior Member
rhuan.barreto is on a distinguished road
 
Posts: 6
Join Date: Jul 2008
Send a message via MSN to rhuan.barreto
Default 07-19-2008, 05:32 AM

i solved the problem
the problem was on my functions.php file
i forgot to put the block <?php ?> on the file

tnx you were so helpful!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com