Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AyKay47

  1. Use a nested foreach loop:

     

    $bestek = array ('vorken' => 5, 'messen' => 6, 'lepels' => 7);
    $servies = array ('borden' => 5, 'kopjes' => 6, 'schalen' => 2);
    $keuken = array ('bestek' => $bestek, 'servies' => $servies);
    echo "<table border='1'>";
    foreach( $keuken as $val )
    {
    foreach( $val as $k => $v )
    {
    echo "<tr>";
    echo "<td>" . $k . "</td><td>" . $v . "</td>";
    echo "</tr>";
    }
    }
    echo "</table>";

  2. barands post was for information gathering purposes not a solution.

    If I understand your logic correctly, you first need to solve the problem of iterating through all of the photos in the directory.

    Perhaps something like this in between the <form> tags:

     

    //loop through files
    foreach( $files as $image )
    {
     //generate html input elements for each image
     echo "<input type='hidden' name='image[]' value='$image' />";
     echo "<input type='text' name='count[]' />";
    }

     

    Then when validating form input:

     

    //perform any scrubbing necessary on user input
    $image = $_POST['image'];
    $count = $_POST['count'];
    //initialize other necessary variables
    $dateStamp = date("m-d-y");
    $timeStamp = date("H:i.s");
    $DBHandle = fopen("imageDB.csv", "a");
    if($DBHandle)
    {
     //iterate through $_POST values from form and insert into csv file
     foreach( $image as $key => $img )
     {
       $data = "$img,$count[$key],$dateStamp,$timeStamp\n";
       fwrite($DBHandle, $data);
     }
    }
    

     

    This will display all of the images and corresponding text fields in the same form. When the user submits the form the script will store the necessary data into the csv file.

    Keep in mind that this is only a skeleton to get you on the right path.

  3. "Array" is what is output when attempting to output an array directly, which is what $files is.

    To maintain the CSV structure, perhaps implodeing the $files array using a particular character would be the best solution so that you can explode it upon reading the file:

     

    $filesStr = implode("-", $files);

     

    You could also insert a new line per $files element or store the data inside a database, depends on your logic

  4. Typically a "logged in" field in a database will monitor whether or not a user has logged in (0 - not logged in, 1 - logged in).

    If someone else with the same credentials attempts to log in, validate the login using the "logged in" fields value.

    This field can also be used with session timeout logic.

  5. Define "doesn't work", are any errors received?

    This bit of code should put you on the right path:

     

    WebClient client = new WebClient();
    string url = String.Format("http://www.domain.com/mail.php?to={0}&subject={1}&message={2}", "email@email.com", "recipient@email.com", "message");
    client.DownloadString(url);
    // rest of code

  6. Holaaa!! a mi me salia el mismo error con WAMPSERVER y lo soluciones con el SQ SMTP Server 3,... tal como sale en el siguiente link:

     

    http://www.emagister...dor-correo-smtp

     

     

    el correo me lo mando a SPAM. shocked.gif ... download SQ SMTP

     

    y siguiendo este codigo:

     

    <?php

    ini_set("SMTP","localhost");//Cambien mail.cantv.net Por localhost ... ojo, ojo OJO

    ini_set("smtp_port",25);

    ini_set("sendmail_from","turemitente@gmail.com");

     

    $too = "xxxxx@yahoo.com" ;//pon tu correo para probar, your email

    $subject = "TEST" ;

    $message = "User message" ;

    $user_email = "xxxxxxxxxxx@gmail.com" ; // valid POST email address

     

    $headers = "From: $user_email " ;

    $headers .= "Reply-To: $too " ;

    $headers .= "Return-Path: $too " ;

    $headers .= "X-Mailer: PHP/" . phpversion (). " " ;

    $headers .= 'MIME-Version: 1.0' . " " ;

    $headers .= 'Content-type: text/html; UTF-8' . " " ;

     

    if( mail ( $too , $subject , $message , $headers )) echo 'SENT' ;

     

    ?>

     

     

    My php.ini is:

     

     

    ; http://php.net/smtp

    SMTP = localhost

    ; http://php.net/smtp-port

    smtp_port = 25

     

    Please start a new thread in english.

  7. Seems to me like the first solution is analogous to the second solution only it requires much less code to implement.

    Either way you will need to add additional code with each sub-page that you create.

    If a user types in an id of say 1000000 then it will trigger the default value of the switch statement which should be a generic page like the home page/main page etc.

  8. Adding to what DavidAM has already mentioned regarding passwords, using hashing algorithms such as MD5, SHA1 and SHA256 is discouraged as these algorithms are trivial to crack.

    A hashing function such as crypt implementing an algorithm such as CRYPT_BLOWFISH coupled with a correctly formatted salt provides the most "computationally expensive" algorithm.

    Ergo making it extremely difficult and near impossible for an attacker to crack.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.