Posts by gamesongz

    Danku voor je snelle reactie.
    Ik heb inderdaad gedaan wat je zei.
    Maar nog steeds dezelfde error.


    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/u601239250/public_html/index.php on line 121

    Hallo, wanneer ik wil inloggen/Registreren komt er een error.
    Dit was voordat ik verhuisde van host, er helemaal niet.
    dus, ik vind het maar een beetje raar.


    Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in/home/u601239250/public_html/index.php on line 120


    Code: (een klein deel)


    [PHP]


    if($dead = "false"){
    include('connect.php');
    $pass1 = md5($pass1);
    $query = mysql_query("SELECT status FROM members WHERE username = '$username' and password = '$pass1'");
    $rows = mysql_num_rows($query);
    if($rows > 0){
    $row = mysql_fetch_assoc($query);
    $username = mysql_real_escape_string($username);
    $_SESSION['login']=true;
    $_SESSION["username"]=$username;
    $_SESSION['rank'] = $row['status'];
    print "<font size=1 face=verdana><br />Succesfull logged in!";
    }
    else{
    [/PHP]

    Hallo,
    Wanneer Iemand, of ik, naar mijn website wil gaan.
    Krijgt hij deze error:
    Fout 310 (net::ERR_TOO_MANY_REDIRECTS): Er zijn te veel omleidingen.




    Wat kan ik aan mijn script veranderen, om deze te laten werken?


    EDIT: #Slotje.
    Problem Solved


    Wat moet ik hier precies aan veranderen?
    Om meerdere files te kunen uploaden?

    Dit is hoe ik hem wou importen:



    Code
    CREATE TABLE gebruikers ( 
    id int(10) NOT NULL auto_increment, 
    gebruikersnaam varchar(100), 
    password varchar(250), 
    datum varchar(20), 
    mail varchar(100), 
    PRIMARY KEY(id))

    Wel, Verder in de index.php pagina, heb ik deze ook nog staan.


    [PHP]<?php
    // Simple PHP Upload Script: http://coursesweb.net/php-mysql/


    $uploadpath = ''; // directory to store the uploaded files
    $max_size = 200000000; // maximum file size, in KiloBytes
    $alwidth = 90000; // maximum allowed width, in pixels
    $alheight = 80000; // maximum allowed height, in pixels
    $allowtype = array('mp3'); // allowed extensions
    $fileCount = (int) count(glob($uploadpath . "*.mp3"));
    $newfilename = 'song' . ($fileCount + 1) . '.mp3'; //New File Name




    if(isset($_FILES['fileup']) && strlen($_FILES['fileup']['name']) > 1) {
    $uploadpath = $uploadpath . basename( $_FILES['fileup']['name']); // gets the file name
    $sepext = explode('.', strtolower($_FILES['fileup']['name']));
    $type = end($sepext); // gets extension
    list($width, $height) = getimagesize($_FILES['fileup']['tmp_name']); // gets image width and height
    $err = ''; // to store the errors


    // Checks if the file has allowed type, size, width and height (for images)
    if(!in_array($type, $allowtype)) $err .= 'Upload Failed, Invalid Extension';
    if($_FILES['fileup']['size'] > $max_size*1000) $err .= '<br/>Maximum file size must be: '. $max_size. ' KB.';
    if(isset($width) && isset($height) && ($width >= $alwidth || $height >= $alheight)) $err .= '<br/>The maximum Width x Height must be: '. $alwidth. ' x '. $alheight;


    // If no errors, upload the image, else, output the errors
    if($err == '') {
    if(move_uploaded_file($_FILES["fileup"]["tmp_name"], "" . $newfilename)) {
    echo 'Song successfully uploaded';
    echo '<br />Link To Song <input type="text" class="optionstxt" readonly style="width:300px;" value="http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$newfilename.'">';



    }
    else echo '<b>Unable to upload the file.</b>';
    }
    else echo $err;
    }
    ?> [/PHP]

    Hallo, Dus ik volgde een tutorial.


    Maar stuiterde op het volgende probleem.



    Ik heb dus een header, ((login/member beheer header) in de top van mijn pagina.



    Maar. Ipv dat hij die header weergeeft.


    Geeft hij 2 errors.


    Code
    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/u638112868/public_html/index.php:11) in /home/u638112868/public_html/index.php on line 38
    
    
    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/u638112868/public_html/index.php:11) in /home/u638112868/public_html/index.php on line 38


    En dit is het script, waarop het eerste zicht niks fout aan blijkt te zijn.





    Dus ik zou het erg waarderen, als iemand wist wat hier fout aan is.


    Mvg, Fabio

    Hoe kan ik hiervan precies een multiple upload maken?


    Forms heb ik al. :D


    Ik zou graag dat ie 3 Files kan uploaden.



    ik heb er ondertussen dit van gemaakt.
    Bedankt voor alle hulp!
    Alleen vroeg ik mij af, als het mogelijk is. een Lijst te hebben met alle .mp3 files.



    [PHP]<?php
    // Simple PHP Upload Script: http://coursesweb.net/php-mysql/


    $uploadpath = ''; // directory to store the uploaded files
    $max_size = 200000000; // maximum file size, in KiloBytes
    $alwidth = 90000; // maximum allowed width, in pixels
    $alheight = 80000; // maximum allowed height, in pixels
    $allowtype = array('mp3'); // allowed extensions
    $fileCount = (int) count(glob($uploadpath . "*.mp3"));
    $newfilename = 'song' . ($fileCount + 1) . '.mp3'; //New File Name



    if(isset($_FILES['fileup']) && strlen($_FILES['fileup']['name']) > 1) {
    $uploadpath = $uploadpath . basename( $_FILES['fileup']['name']); // gets the file name
    $sepext = explode('.', strtolower($_FILES['fileup']['name']));
    $type = end($sepext); // gets extension
    list($width, $height) = getimagesize($_FILES['fileup']['tmp_name']); // gets image width and height
    $err = ''; // to store the errors


    // Checks if the file has allowed type, size, width and height (for images)
    if(!in_array($type, $allowtype)) $err .= 'Upload Failed, Invalid Extension';
    if($_FILES['fileup']['size'] > $max_size*1000) $err .= '<br/>Maximum file size must be: '. $max_size. ' KB.';
    if(isset($width) && isset($height) && ($width >= $alwidth || $height >= $alheight)) $err .= '<br/>The maximum Width x Height must be: '. $alwidth. ' x '. $alheight;


    // If no errors, upload the image, else, output the errors
    if($err == '') {
    if(move_uploaded_file($_FILES["fileup"]["tmp_name"], "" . $newfilename)) {
    echo 'Song successfully uploaded';
    echo '<br />Link To Song <input type="text" class="optionstxt" readonly style="width:300px;" value="http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$newfilename.'">';



    }
    else echo '<b>Unable to upload the file.</b>';
    }
    else echo $err;
    }
    ?> [/PHP]