Jump to content

Cristian

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by Cristian

  1. Sorry for the noobie question, I am just a beginner still. I am trying to use the readdir function to echo back all the contents of a folder. The directory that I want to read back has 31 empty folders. I am able to get them to read back, but they are in a random order and there are two additional files at the top named "." and ".." -- any idea how to fix these? Here is my code and pictures:

     

    $path = "c:/test/";

    if(is_dir($path)) {

    if($dir_handle = opendir($path)) {

    while($filename = readdir($dir_handle)) {

    echo "filename: {$filename}<br>";

    }

    closedir($dir_handle);

    }

    }

     

    post-129076-13482403230879_thumb.jpg

    post-129076-1348240323103_thumb.jpg

  2. Hello,

     

    I have a very basic html/css file where I am trying to display a grey background with a blue header, and on the left, top and right sides of the blue header I can't seem to get rid of the grey margin/padding.

     

    <html>
    <head>	
    	<title>#</title>
    	<style type="text/css">
    		html {background: #dcd1cd;}
    		div#top{position:relative; width:100%; height:390px; background: #1e6fb0; margin:0px; padding:0px;} 
    	</style>
    </head>
    <body>
    <div id="top">
    </div>
    </body>
    </html>

     

    post-129076-13482403229305_thumb.jpg

  3. Hello everyone. I am new here and I just started learning PHP; I apologize in advance for how stupid this question will seem to most of you I'm sure. I'm following a video guide and typing what the instructor says (I've checked it like 10 times) but for some reason he isn't getting an error and I am.

     

    I am just trying to do simple arithmetic.

    <html>
    <head>
    	<title>Numbers - Christopher</title>
    </head>
    <body>
    	<?php
    		$var1 = 3;
    		$var2 = 4;
    	?>
    
    	Basic Math: <?php echo ((1 + 2 + $var1) * $var2) / 2 – 5; ?><br />
    
    </body>
    </html>

     

    The answer that comes up on his screen is 7. On mine, it says this:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\christopher\numbers.php on line 11. I'm sure there is something stupid that I am missing. Anyone care to help out the newbie :)?

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