Jump to content

hennzo

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by hennzo

  1. Hi, I haven't taken a lot of time to go through your code, but first change this: $answer = $_POST['submit']; by: $answer = $_POST['answer'];
  2. the code echo "<li class="sliding-element"><h3>Projects Page</h3></li> "; should be : echo "<li class=\"sliding-element\"><h3>Projects Page</h3></li> "; OR echo '<li class="sliding-element"><h3>Projects Page</h3></li> ';
  3. try this: <html> <title>test</title> <body> <?php $images = "images/"; # Location of galleries $cols = 4; # Number of columns to display $max = 5; # Maximum number of galleries to show if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $files[] = $file; } } closedir($handle); } natcasesort($files); $colCtr = 0; echo "<div id=\"updates\"><table><tr>"; $c = count($files); //$c = the number of files in the array, minus 1 = highest index in the array. $start = ($_GET['page'] > 1)? ($_GET['page'] - 1)*$max : 1; $end = (($c - $max) > 0)? ($c - $max)$max - ($c)); for($i = $c - $start; $i >= $end; $i--) //$i = $c, $i is greater than the array count minus $max, $i de-increments on each loop. This will give us a countdown for the number of galleries required. { if($colCtr %$cols == 0) echo "</tr><tr>"; echo "<td><img src=\"" . $images . $files[$i] . "/head_bg_form.gif\" width=\"240px\" height=\"180px\" alt=\"" . $alt . "\" /></td>"; //echo'ing out the $file[$i] on the loop, will give us the last required number of files in the file array. $colCtr++; } echo "</table></div>" . "\r\n"; //pagination echo '<table><tr>'; $nbpages = ceil(($c+1)/$max); $current_page = isset($_GET['page'])? $_GET['page'] : 1; for($page=1; $page <= $nbpages; $page++){ if($page == $current_page){ echo '<td><span>'.$page.'</span></td>'; }else{ echo '<td><a href="?page='.$page.'"><span>'.$page.'</span></a></td>'; } } echo '</tr></table>'; ?> </body> </html> It's better to use natcasesort() than sort(). Otherwise 002 will be greater than 012.
  4. Hi, instead of urlencode(), use rawurlencode()
  5. Hi, the easiest way is to use a relative link. instead of write this: <?php echo "<img src=\"C:\wamp\www\fermpix\Pics\'{$row["Name"]}'\">";?> ----------------------------------------------- Write this: <?php echo "<img src=\"/fermpix/Pics/{$row["Name"]}\" />";?> if your DOCUMENT_ROOT is "C:\wamp\www" <?php echo "<img src=\"/Pics/{$row["Name"]}\" />";?> if your DOCUMENT_ROOT is "C:\wamp\www\fermpix" or simply <?php echo "<img src=\"Pics/{$row["Name"]}\" />";?> if your Pics is your image folder and it is located in the same level as your PHP file.
  6. Hi, I am new in this forum. I saw your question, and I registered just to answer it. Instead of write this code: <input type="radio" name="userGroup" id="1" value="<?php echo $group1; ?>" /> <input type="radio" name="userGroup" id="2" value="<?php echo $group1; ?>" /> <input type="radio" name="userGroup" id="3" value="<?php echo $group1; ?>" /> Write like this : <?php switch($_POST['userGroup']){ case '1': $group1= 'checked'; break; case '2': $group2= 'checked'; break; default: $group3= 'checked'; } ?> <input type="radio" name="userGroup" id="1" value="1" <?php echo $group1; ?> /> <input type="radio" name="userGroup" id="2" value="2" <?php echo $group2; ?> /> <input type="radio" name="userGroup" id="3" value="3" <?php echo $group3; ?> /> Which means that group3 is checked by default. If you don't want any default checked, just put it in the case option like others.
×
×
  • 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.