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
strange php syntax error... help, please!
Old 12-30-2010, 06:32 AM strange php syntax error... help, please!
Average Talker

Posts: 14
Name: bam margera
Location: /home/blackhatdbl
Trades: 0
Parse error: syntax error, unexpected T_VARIABLE in /dir_that_i_can't_show/inc/func.inc on line 13

/inc/func.inc
:
PHP Code:
<?php
// Function to check if user is logged in
function login() {
    if (isset(
$_POST['submit'])) {
        
$enc=fue($_POST['pass'],3);
        
$sql="SELECT * FROM users WHERE pass = '" $enc "' AND name = '" $_POST['user'] . "'";
        if (
mysql_query($sql)) {
            
setcookie("cookie"$enc$hour);
            
setcookie("cookie1"$_POST['user'], $hour);
        } else
            
$err=1;
    } else {
        
$sql="SELECT * FROM users WHERE pass='" $co "' AND name='" $co1 "'";
        if (
$row=mysql_fetch_array($sql)) {
            
setcookie("cookie"$co$hour);
            
setcookie("cookie1"$row['name'], $hour);
        } else
            
$err=1;
    }

    if (
$err != 1) {
        
mysql_query("UPDATE FROM users SET online = '" $hour "' WHERE pass = '" $co "' AND name = '" $co1 "'");
        return 
0;
    } else {
        return 
1;
    }
}

// Function to check which user are online
function online() {
    if (
login() == 0) {
        
$sql="SELECT name FROM users WHERE online >= '" time();
        while(
$row=mysql_fetch_array($sql)); {
            echo 
$row;
            echo 
"</td></tr><tr><td>";
        }
    } else 
header("Location: index.php");
}

// Ultimate encryption function
// f(ucking) u(ncrackable) e(ncryption)
function fue($hash,$ti) {
    for(
$i=$ti$i>0$i=$i-1) {
        
$hash=base64_encode($hash);
        
$hash=md5($hash);
        
$hash=sha1($hash);
    }
    return 
$hash;
}
?>
/inc/config.inc:
PHP Code:
<?php

//MySQL DataBase//
//    Settings    //
$dbhost='localhost'// DB Host
$dbuser='I wont'// DB User
$dbpass='show'// DB User password
$db='you'// DB to connect
//    Do not change    //
mysql_connect($dbhost$dbuser$dbpass) or die('Error: ' mysql_error()); // Connects to your Database
mysql_select_db($db) or die('Error: ' mysql_error()); // Selects the correct DB

//Security//
//    Settings    //
$tout=3200// Idle time before the cookie gets deleted
//    Do not change    //
$co=$_COOKIE['cookie']; // Cookie to store pass
$co1=$_COOKIE['cookie1']; // Cookie to store name
$hour=time() + $tout// Add the timeout value to the current time so the cookie will be deleted
?>
/index.php:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    </head>
    <body>
        <?php
        include_once("inc/config.inc");
        include_once("inc/func.inc");

        if (login() == 0)
            header("Location: members.php");
        elseif (isset($_POST['user']) && isset($_POST['pass']) && login() != 0)
            echo "Error!!";
        ?>
        <div align="center">
            <form action="index.php" method="POST">
                <input type="text" name="user" /><br />
                <input type="password" name="pass" /><br />
                <input type="submit" name="submit" />
            </form>
        </div>
    </body>
</html>
pickyj is offline
Reply With Quote
View Public Profile Visit pickyj's homepage!
 
 
Register now for full access!
Old 12-30-2010, 07:01 AM Re: strange php syntax error... help, please!
Junior Talker

Posts: 2
Name: Gav
Trades: 0
You are missing a period . before $co1.
therealgl is offline
Reply With Quote
View Public Profile
 
Old 12-30-2010, 07:08 AM Re: strange php syntax error... help, please!
Average Talker

Posts: 14
Name: bam margera
Location: /home/blackhatdbl
Trades: 0
thank you sooooooooooooooooooooooooooooooo much!!!
i'll start knocking my head on the screen!!!!!!!!!!!!!!!!!
pickyj is offline
Reply With Quote
View Public Profile Visit pickyj's homepage!
 
Old 01-07-2011, 11:59 AM Re: strange php syntax error... help, please!
Average Talker

Posts: 18
Name: David
Location: Sweden
Trades: 0
You shouldn't store passwords in cookies unhashed. Huge security risk.
__________________

Please login or register to view this content. Registration is FREE
- View random youtube videos easily & instantly!


Please login or register to view this content. Registration is FREE
- Dubstep.nu recommends great dubstep songs everyday!
FlyHour is offline
Reply With Quote
View Public Profile Visit FlyHour's homepage!
 
Old 01-07-2011, 12:10 PM Re: strange php syntax error... help, please!
Average Talker

Posts: 14
Name: bam margera
Location: /home/blackhatdbl
Trades: 0
check the fue function...
__________________

Please login or register to view this content. Registration is FREE
- The network for you
pickyj is offline
Reply With Quote
View Public Profile Visit pickyj's homepage!
 
Old 01-07-2011, 01:17 PM Re: strange php syntax error... help, please!
Average Talker

Posts: 14
Name: bam margera
Location: /home/blackhatdbl
Trades: 0
i agree with you...
can't you see the you're in a forum that we talk ENGLISH????????????
__________________

Please login or register to view this content. Registration is FREE
- The network for you
pickyj is offline
Reply With Quote
View Public Profile Visit pickyj's homepage!
 
Reply     « Reply to strange php syntax error... help, please!
 

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.22772 seconds with 12 queries