Jump to content

jayjay960

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Posts posted by jayjay960

  1. So, I need a table to look like this:

     

    #############
    #     #     #
    #############
    #     #     #
    #############
    #           #
    #############

     

    Now just using plain html, that would be easy enough to do, just adding colspan="2" to the last cell, however, I'm using css tables, as in, this is what my table looks like:

    <style>
    .table { display: table; }
    .tr { display: table-row; }
    .td { display: table-cell; }
    </style>
    
    <div class="table">
    <div class="tr"><div class="td">Cell 1</div><div class="td">Cell 2</div></div>
    <div class="tr"><div class="td">Cell 3</div><div class="td">Cell 4</div></div>
    <div class="tr"><div class="td">Cell 5</div></div>
    </div>

     

    Now, what I want to know is if there is a CSS equivalent to colspan that lets one cell take up more room. I've tried just setting width: 100%;, and using the html colspan="2" but neither work. I have the CSS2 specification pdf which is helpful, but I haven't been able to find any answers in there. Can anyone help?

  2. <?php
    
    $C = 0;
    
    while($C <= 4){
    
    $drawing = rand(1, 99);
    $drawings[$C] = $drawing;
    for ($n = 0; $n <= $C; $n++)
    {
    if ($drawing==$drawings[$n])
    {
    while ($drawing==$drawings[$n])
    {
    $drawing = rand(1, 99);
    $drawings[$C] = $drawing;
    }
    }
    }
    
    echo ''.$drawing.'.';
    
    $C++;
    }
    
    ?>
    

     

    There, I think that should work

  3. The better way to do that would be:

    <?php
    
    $left_title = stripslashes($_POST['left_title']);
    $left_text = stripslashes($_POST['left_text']);
    
    $images[1] = $_FILES['image1']['tmp_name'];
    $image1main = $_FILES['image1']['name']; //image 1
    $src = imagecreatefromjpeg($images[1]);
    
    $images[2] = $_FILES['image2']['tmp_name'];
    $image2main = $_FILES['image2']['name']; // image 2
    $src2 = imagecreatefromjpeg($images[2]);
    
    $images[3] = $_FILES['image3']['tmp_name'];
    $image3main = $_FILES['image3']['name']; // image 3
    $src3 = imagecreatefromjpeg($images[3]);
    
    
    for ($n = 1; $n <= $number_of_images_uploaded; $n++)
    {
    list($width,$height)=getimagesize($images[$n]);
    $newwidth=600;
    $newheight=($height/$width)*$newwidth;
    $tmp=imagecreatetruecolor($newwidth,$newheight);
    imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
    $filename = "/home/users/web/b2075/moo.petenaylor/websites/d/dogs/images/front/". $_FILES['image'.$n]['name'];
    imagejpeg($tmp,$filename,100);
    imagedestroy($src);
    imagedestroy($tmp);
    }
    
    
    // Validation
    //saving record to MySQL database
    
    //(\"$item_category\",\"$title\",\"$description\",\"$price\",\"$postage\",\"$condition\",\"$item_code\",\"$image1main\",\"$image2main\",\"$image3main\",\"$image4main\")" ;
    
    @$pfw_strQuery = "INSERT INTO `front_page_text`(`left_title`,`left_text`,`image1`,`image2`,`image3`)VALUES (\"$left_title\",\"$left_text\",\"$image1main\",\"$image2main\",\"$image3main\")" ;
    ?>

     

    That should work. assuming $number_of_images_uploaded contains (surprise surprise!) the number of images that were uploaded.

    Also I replaced $image1, $image2 and $image3 with one array $images.

  4. Ok, this is driving me insane. Here is a script that runs at the start of each page (before any html):

    <?php
    $rememberme = false;
    if (isset($_POST['rememberme']))
    {
    	$rememberme = true;
    	$logintime = time();
    }
    if ($rememberme || isset($_SESSION['rememberme']))
    {
    	session_set_cookie_params($_SESSION['logintime']+(60*60*24*30));
    }
    session_start();
    if ($rememberme)
    {
    	$_SESSION['rememberme'] = true;
    }
    ?>
    What I'm trying to do is have it so that when you login and have checked the checkbox named 'rememberme', the session cookie lasts for 30 days. Currently, if you log in without checking the box the cookie will expire at the end of the session as normal, however, if you tick the remember me box, the exact same thing happens. No expiry date. What's annoying me is that if I put session_set_cookie_params(60*60*24*30); directly before session_start();, it works fine and the cookie has an expiry date, but once I try to check if the user chose remember me, it stops working. The first thing I tried was simply:
    [code]<?php
    if (isset($_POST['rememberme']))
    {
    session_set_cookie_params(60*60*24*30);
    }
    session_start();
    ?>

     

    But that didn't work, and since then I've tried every possible way of doing this I could think of, including destroying the session cookie before setting the cookie params, and even just setcookie('PHPSESSID', session_id(), '', 60*60*24*30);, and I've had different results each time, including (from the look of it) my $_SESSION variables being reset, being able to log in without checking the box but not with, and getting errors from session_start() that say my headers have already been sent.

     

    I would really, really appreciate help with this, it's driving me insane..

  5. Wait, do you want a form to submit as soon as the page loads? You'd need javascript for that:

     

    document.getElementById('form id here').submit();

     

    I'm sure there's a much better way of doing what you want to accomplish with redirecting, but you'll have to be more clear about what you're trying to do.

  6. We'll need the whole script, that line tells us nothing.

     

    You would want it to go to ?page=flights&from=Atlanta#to. If you select the city using a dropdown box, it most likely uses a form with the method GET, in which case all you would need to do is add a hidden input element to that form like so:

     

    <input type="hidden" name="page" value="flights" />

  7. This isn't possible with php, php is a server-side language which means everything is processed and parsed on the server and the client just gets the page that comes out the other end. if you wanted to just use php you would have to reload the page.

     

    Also, yes you would probably get shot and die a most painful death if you used an iframe, but you could also try ajax. That uses javascript to load a page and then you could put the results in a div or something.

  8. If you're going to be doing advanced-ish stuff like this (involving mysql anyway), you should probably learn html and css for designing web pages. wysiwyg editors like dreamweaver usually add a lot of unnecessary code, plus you don't have as much control. www.w3schools.com have some html and css tutorials, or it might even be worth taking out a book on html from your library.

  9. Hopefully you know about editing themes in Joomla because I haven't got a clue, but if you do, you can use z-index to set the depth of elements. e.g. <div style="z-index: 1;" /> will show below <div style="z-index: 2;" />

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