Jump to content

quelle

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Posts posted by quelle

  1. Background image isnt resizable, and in my case trick works based on browser size

    background images ARE resizeable in CSS.  What the OP seems to need is background-size: cover;

    I obviously missed somewhere the part where i say without CSS 3 please

  2. If you want the picture to be under/behind everything, why not use background-image: ? Seeing as that is, in fact, what you want to use it as.

    Background image isnt resizable, and in my case trick works based on browser size

  3. I have <img> element called right after <body> one. The image element includes following id with attributes and serves as a background of whole page(body) with possibility of resizing(thats the function of this part of code):

     

     

    #img.source-image {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
    

     

     

     

    How come this image overrides following id's background

     

     

    #mainPicture
    {
    clear:both;
    width:670px;
    height:345px;
    background-color:#160306;
    }
    

     

    And not just this id, every div which includes id from css with background

     

    What I want is actually this picture to be under everything

  4. Try using the Notepad++ editor to write your code, it is great for quickly finding syntax errors like this because you can have it show you which IF's are connected to which ELSE's etc, and you can click a brace and it will highlight the corresponding closing brace.

     

     

    if(isset($_POST['login'])){
    

     

    On another note I'm guessing your login variable is the form's submit button? If so then you have a compatibility problem with IE. See Why isset post is not compatible with Internet Explorer.

    Since im using firefox i didnt notice it yet but thanks for ur help

  5. dAMN im really a cock sucker lolz, i closed brackets for else and didnt for whole if lol thanks tenyon for pointing out mistakes :) btw u said

    I disagree with using ($_SERVER['REQUEST_METHOD'] == 'POST'). I think you should simply create a hidden form field.

     

    IE <input type="hidden" name="formSubmitted" value="1">

     

    Then check it like:

     

    if (isset($_POST['formSubmitted'])) {

    }

    Can u indicate where i used that method?

  6. On 25th and 29 th line

    <?php
    include('includes/functions.php');
    session_start();
    
    if(isset($_POST['login'])){	
    if(isset($_POST['username'])){		
    	if(isset($_POST['password'])){
    		$query = mysql_query('SELECT * FROM users WHERE Username = $_POST["username"]') or die(mysql_error());
    		$user = mysql_fetch_array($query);
    
    		if($_POST['password'] == $user['Password']){
    			echo "Uspješan login!";
    			$_SESSION['user'] = $user['username'];
    			header('Location: index.php');
    
    		} else {
    			echo "Provjerite login detalje!";
    			include('login.php');
    		}
    
    	} else {
    		echo "Password netačan!";
    		include('login.php');
    
    } else {
    	echo "Username netačan!";
    	include('login.php');
    
    } else {
    echo "Niste ispunili sve podatke!";
    include('login.php');
    }
    ?>

  7. well if you don't want to use array slice maybe try this:

     

        if($value<=$min ||$value>=$max)
    

    Thanks cssfreakie rly for ur help :)

    Btw this line of code could be used better as, right?

    while ($value => $min || $value <= $max)
    

  8. If you check the manual for array_slice, you'll see what the parameters mean. In my example, I use 1 for the second parameter because it denotes which position to start taking values from. We want to skip the first, 0th element, so we start at 1. The third parameter is how far away from the end we want to stop. We want to stop collecting values 1 away from the end, so we choose -1.

     

    For example, you can try this code:

     

    $input = array("a", "b", "c", "d", "e");
    
    print_r(array_slice($input, 1, -1)); // array('b', 'c', 'd')

    Aha thanks for a nice explanation, i have a better view on it from now on :)

  9. Depends on how you define "middle values".

     

    If you mean any values that aren't at the absolute ends, then yes you could do that (or in the case of only 3 or 4 elements). But if you're only looking for the middle 1 or 2 values inside an array of length greater than 4, then you'll need more information than just the maximum and minimum values of the array, without sorting of course.

    Yeah thats exact what I mean, the second way was explained but im looking for the first way, doing it without array_splice. I was thinking about array_splice before this but it is a little bit difficult to understand even ur simple example, i would put (array_slice($arr, 0, -1); cuz i want to cut the first one and the last one ...

  10. ////////////////////////////////////////////////////
    function maximal($niz)
    {
    	$mxm = $niz[0];
    
    	for ($i=0; $i < count($niz); $i++) {
        	if($niz[$i]>$mxm) {
        	$mxm = $niz[$i];
        		}
        	}
        echo $mxm, "<br />";
    }
    ////////////////////////////////////////////////////
    function minimal($niz)
    {
    	$mnm = $niz[0];
    
    	for ($i=0; $i < count($niz); $i++) {
        	if($niz[$i]>$mnm) {
        	$mnm = $niz[$i];
        		}
        	}
        echo $mnm, "<br />";
    }
    ////////////////////////////////////////////////////

    Lets say i've got these 2 functions and im asking is it possible to check values in an array if they are different from these 2 and list them as middle values ?

     

    Btw this part here

    echo "Middle value: " . $arr[floor($s / 2)];

    This will be used when $s is not dividable with 2 ?

  11. Im working on 2 functions which will check lowest and biggest value in array. So this code works fine, but only problem it isnt function

    <?php 
    $brojevi = array(25, 14, 62);
        $mxm = $brojevi[0];
    
        for ($i=0; $i < count($brojevi); $i++) {
        if($brojevi[$i]>$mxm) {
        $mxm = $brojevi[$i];
        	}
        }
        echo $mxm;
    
    /////////////////////////////////////////////////////
    
    	$brojevi = array(25, 14, 62);
        $mnm = $brojevi[0];
    
        for ($i=0; $i < count($brojevi); $i++) {
        if($brojevi[$i]<$mnm) {
        $mnm = $brojevi[$i];
        	}
        }
        echo $mnm;
    
    ?>

    And now code which doesnt work - the functions part

    <?php
    ////////////////////////////////////////////////////
    function max($niz)
    {
    	$mxm = $niz[0];
    
    	for ($i=0; $i < count($niz); $i++) {
        	if($niz[$i]>$mxm) {
        	$mxm = $niz[$i];
        		}
        	}
        return $mxm;
    }
    ////////////////////////////////////////////////////
    function min($niz){
    	$mnm = $niz[0];
    
    	for ($i=0; $i < count($niz); $i++) {
        	if($niz[$i]>$mnm) {
        	$mnm = $niz[$i];
        		}
        	}
        return $mnm;
    };
    ////////////////////////////////////////////////////
    
    $jabuke = array(15, 25, 559, 554);
    $kruske = array(12, 9, 2, 44);
    
    max($jabuke);
    min($kruske);
    
    ?>

    I need this badly tommorow :D

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