Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Issue with running my script
Old 11-08-2005, 07:32 AM Issue with running my script
Nahele's Avatar
Extreme Talker

Posts: 204
Trades: 1
So I'm running a authentication script for a website I'm working on. The login page works fine and submits to the file that is supposed to authorize but an error page comes up saying execute access is denied. The actual script was tested on my personal server and worked fine but now I'm trying to run on a windows based server and having issues. I figued it was a permissions issue so tried changing that and just said 'command not understood'.

www.cwvfx.com/login.php

just try any username and password and it will bring up the error page.
Nahele is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-08-2005, 12:10 PM
Average Talker

Posts: 23
Trades: 0
After login, it gave me a (Page Not Found) Error!
__________________

Please login or register to view this content. Registration is FREE

Latest Article:
Choosing a Web Host: Beware Marketing Tricks
alafoo is offline
Reply With Quote
View Public Profile Visit alafoo's homepage!
 
Old 11-08-2005, 02:38 PM
Nahele's Avatar
Extreme Talker

Posts: 204
Trades: 1
A 'page not found' error? I never got that, what is the address when the error comes up?
Nahele is offline
Reply With Quote
View Public Profile
 
Old 11-08-2005, 05:50 PM
Average Talker

Posts: 20
Location: Benevento
Trades: 0
show the source code
__________________

Please login or register to view this content. Registration is FREE
j2be is offline
Reply With Quote
View Public Profile Visit j2be's homepage!
 
Old 11-08-2005, 11:48 PM
Nahele's Avatar
Extreme Talker

Posts: 204
Trades: 1
Here is the code for the page that has the error
PHP Code:
<?
    
//Set cookies for sessions
    
setcookie ("USERNAME"$_POST['username']);
    
setcookie ("PASSWORD"$_POST['password']);

  include_once (
"auth.php");
    include_once (
"authpaths.php");

  
$username =  $_POST['username'];
  
$password =  $_POST['password'];

    
$Auth = new auth();
    
$detail $Auth->authenticate($username$password);

    if (
$detail==0)
    {
    
?><HEAD>
        <SCRIPT language="JavaScript1.1">
        <!--
            location.replace("<? echo $failure?>");
        //-->

        </SCRIPT>
      </HEAD>
    <?
    
}
    else 
    {
    
?><HEAD>
        <SCRIPT language="JavaScript1.1">
        <!--
            location.replace("<? echo $success?>");
        //-->
        </SCRIPT>
      </HEAD>
    <?
      
}
?>
And this is the auth.php file that it calls:

PHP Code:
<?php
    
include_once ("authpaths.php");

class 
auth{
//DB Setings
    
var $HOST "####";
    var 
$USERNAME "####";
    var 
$PASSWORD "####";
    var 
$DBNAME "####";

    function 
authenticate($username$password) {
        
$query "SELECT * FROM users WHERE username='$username' AND password='$password' AND access_level <> 0";
        
$connection mysql_connect($this->HOST$this->USERNAME$this->PASSWORD);
        
        
$SelectedDB mysql_select_db($this->DBNAME);
        
        
$result mysql_query($query); 
        
        
$numrows mysql_num_rows($result);
        
$row mysql_fetch_array($result);
        
        
// CHECK IF THERE ARE RESULTS
        // Logic: If the number of rows of the resulting recordset is 0, that means that no
        // match was found. Meaning, wrong username-password combination.
        
if ($numrows == 0) {
            return 
0;
        }
        else {
            return 
$row;
        }
    }
}
There are some other functions in there but have not been used and are all commented out at the moment. The '####' are in place of secure information and removed for obvious reasons but are correct.
Nahele is offline
Reply With Quote
View Public Profile
 
Old 11-09-2005, 03:23 AM
Nahele's Avatar
Extreme Talker

Posts: 204
Trades: 1
Alright I got it all settled, found out I could switch operating systems so switched to linux and all is good now.
Nahele is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Issue with running my script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33297 seconds with 12 queries