Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Posts posted by DeanWhitehouse

  1. What the hell, is that your code?

     

    Do this

    <?php   
        error_reporting(E_ALL);
    
       $findimage = mysql_query ("Select * FROM `phpbb_files`") or die(mysql_error());
       echo mysql_num_rows($findimage);
    
       while ($row = mysql_fetch_array($findimage)){
       $image ="uploads/"; 
       $image .= $row['shortname'];
    
    echo "<img src=\"".$image."\"  alt=\"Image can not be found\" />";
    }
    ?>

    And tell us what it says

  2. Ok, you will need these two functions first of all

     

    http://uk3.php.net/manual/en/function.imagecolorat.php

    http://uk3.php.net/manual/en/function.getimagesize.php

    second one only if you don't know the image size

     

    And then what i would do is loop using a for loop, and have it go pixel by pixel ( across the top) and when it reaches the edge of the image get it to go down one, etc.

     

    $image_x = 200;
    $image_y = 200;
    $y = 0;
    for($x = 0;$x <= $image_x;$x++
    {
    if($x == $image_x)
    {
    	$x = 0;
    	$y += 1;
    }
    if($y == $image_y)
    	$y = 0;
    
    $color = imagecolorat  ($image,$x,$y);
    
    $y ++;
    }
    

    Slightly improved

  3. <?php   
        error_reporting(E_ALL);
        $findimage = mysql_query ("Select * FROM `phpbb_files`");
       
       while ($row = mysql_fetch_array($findimage)){
       $image ="./uploads/"; 
       $image .= $row['shortname'];
    
    echo "<img src=\"".$image."\"  alt=\"Image can not be found\" />";
    }
    ?>
    

    Try that

  4. <?php
    
    $Questions["ch1"] = "ch1";
    $Questions["ch2"] = "ch2";
    $Questions["ch3"] = "ch3";
    $Questions["ch4"] = "ch4";
    $Questions["ch5"] = "ch5";
    $Questions["ch6"] = "ch6";
    $Questions["ch7"] = "ch7";
    $Questions["ch8"] = "ch8";
    $Questions["ch9"] = "ch9";
    $Questions["ch10"] = "ch10";
    $Questions["ch11"] = "ch11";
    $Questions["chDontCountMe12"] = "ch12";
    $Questions["ch13"] = "ch13";
    
    $PositiveFirstCriteria = 0;
    
    for($i = 1; $i <= 13; $i++)
    {
        if(strlen(trim($Questions["ch".$i])) > 0)
        {
            $PositiveFirstCriteria++;
    
            echo "<p>Count: ". $i .", ". $PositiveFirstCriteria ."</p>";
        }
    }
    ?>

    Just changed one thing

     

  5. Blade is not being condescending or negative (at least I don't think he's trying to be), but form validation in PHP takes a toll on your sanity depending on how long the form gets.  My site has a form with 15 fields to fill in, which is 77 lines of HTML/PHP, and a registration validator that is 157 lines, so about 200 lines of code for a 15 field registration page.
    

    That not why i said it, if i had loads of fields i would make a way to loop through them.

     

    We are giving up our free time to help people with php problems, we are not here just to write code for you. Laziness doesn't benefit you in learning a language.

  6. I have made a login, register, and logout script. 

     

    Please don't lie then, it makes us assume you know enough to just use the logic we tell you.

     

    I'm afraid we won't just hand you the code, please post in the freelance section or attempt to create the code yourself and when you hit a problem we will help

  7. Now be honest did you write the login or did you copy and paste from the internet (or similar), because i have given you all the information you would need if you wrote a login script using a db and sessions, and if you haven't used sessions i have given a link to a site on how to protect pages using sessions.

×
×
  • 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.