Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

php faggot

Name: noko 2011-03-22 16:46

ERROR, ERROR, ERROR, ERROR
Notice: Undefined variable
Warning: Missing argument 2 for fileInfo()
Warning: Missing argument 3 for fileInfo()
Notice: Undefined variable: name

and so on...

i can make this system easy, and much more advanced(with lotzz of if()'z), but i think i missed a very big basic-part of PHP.

Please can anyone help me?

<?php
// Enables Sessions
session_start();

// MYSQL connection
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());



FILE.php
if($_SESSION['access'] == "granted") {

//    Retrive informations from MYSQL row
function fileInfo($id, $name, $content) {
    $query = mysql_query("SELECT * FROM smartcms_files WHERE id='{$id}' LIMIT 1");
    while($file = mysql_fetch_array($query)) {
        if($id == $file['id']) {
       
            $id            = $row['id'];
            $name        = $row['filename'];
            $content    = $row['filecontent'];
           
        }
    }
}

//    Connects to specific MYSQL row.
if(isset($_GET['id'])) {
    $fileid         = fileInfo($id);
    $filename         = fileInfo($name);
    $filecontent     = fileInfo($content);
}
else {
echo "Please Choose a File";
}

}

?>

Name: Anonymous 2011-03-22 17:21

It reads right there, you're missing arguments for fileInfo() and name isn't defined.

if(isset($_GET['id'])) {
fileInfo($fileid, $filename, $filecontent);
}

...and so on, I can't be bothered with this. You need to learn how functions work.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List