Jump to content

king arthur

Members
  • Posts

    335
  • Joined

  • Last visited

    Never

Posts posted by king arthur

  1. I am currently looking to take on any work that involves any of the above languages, whether it be for long term projects or small one-off jobs. URLs and code samples supplied on request. Having over 20 years coding experience much of it as a freelance programmer means I know what it takes to get the job done. Rates open to negotiation. If anyone is interested please PM me here or hit me up on ICQ 435681346

  2. You can get the same page to behave differently depending on if the form has already been submitted or not. When a form is submitted by POST method for example, there will be $_POST variables containing the values from the form fields. So you can check to see if these exist.

    if(isset($_POST["your_form_field_name"]))
    {
    
    .....do something with the submitted form values...
    
    }
    else
    {
    
    ....output the form as it has not yet been submitted...
    
    }
    

  3. Ok I'll explain it again.

     

    I have an overlay that appears when you move the mouse over a thumbnail picture. The overlay shows you the full size picture along with some text.

     

    This overlay consists of a div which is positioned absolutely relative to the document body. I position it by finding the offset position of the thumbnail and adding that with a certain amount of offset etc to the div's style.left and style.top properties. Inside the div are the img, and some spans of text.

     

    Now, that all works fine. I don't need to know how to make the div appear and so on, that's all done.

     

    I just wanted to make it look nicer by having the div translucent, by setting its opacity to 0.8. Well that works fine too, so I get a slightly faded white box on a black background, with some of the text and so on underneath showing through slightly. That's the effect I want.

     

    But a side effect, that I can't seem to get rid of, is that the img within the div also has opacity 0.8, even if I try to set it to 1.0. No matter how or where I set the opacity of the image, it still refuses to take on anything other than the opacity value of the div that contains it.

     

    That is what I need help with.

  4. Ok now try putting a containing div around that image element, and set the opacity of the div to one value and see if you can set the opacity of the image independently of that. Because that is what I am having a problem doing. Nothing to do with hover properties as my img is not a link.

  5. Hover property? I don't see how that relates to my problem, please explain.

     

    I put styles inline while I am developing a page, it's only after all styles are set for good that it's worth moving them to an external sheet.

  6. On my page I have some thumbnail photos. I have an overlay div which I position near the thumbnail on an onmouseover event, inside this div is the full size photo and some text. I thought it would look nice if I made the div slightly transparent using opacity, and it does - but I can't get the photo to lose the opacity. I've tried just setting the opacity property back to opaque in the local style setting for the img tag, I've tried putting another div around it and setting that to opaque, I've tried setting it explicitly in the javascript function that positions the overlay and sets the img's src property, but it just doesn't seem to want to lose the opacity value that I've given the containing div. Is it not possible to do this?

     

    For example I have:

    <div id="overlaybox" style="color:black;background-color:white;position:absolute;top:0px;left:0px;filter:alpha(opacity=80);opacity:.80;z-index:10;text-align:center;width:100px;height:100px;margin:0px;padding:20px;visibility:hidden;">
    <img id="overlay_img" src="blah" alt="Blah" style="filter:alpha(opacity=99);opacity:1.0;" />
    </div>
    

     

    and the img just ignores its own style setting and inherits it from the overlay div seemingly no matter what I do.

  7. There are several ways you could fix this.

     

    $match1 = "";
    if (!empty($Topic)){
    $match1 = ($Topic);
    }
    if (!empty($Subtopic)){
    $match1 .= ($match1=="") ? $Subtopic : ", " . $Subtopic;
    }
    if (!empty($Theswords)){
    $match1 .= ($match1=="") ? $Subtopic : ", " . $Subtopic;
    }
    

     

    or you could do

     

    $match1 = "";
    if (!empty($Topic)){
    $match1 = $Topic;
    }
    if (!empty($Subtopic)){
    $match1 .= ", " . $Subtopic;
    }
    if (!empty($Theswords)){
    $match1 .= ", " . $Subtopic;
    }
    
    if(substr($match1, 0, 1) == ",") $match1 = substr($match1, 2);
    

     

    In the first, I have switched it around so the comma gets added at the start in the second and third cases, but only if the string is not empty. In the second, I have again added the comma at the start and then checked to see if the string has a comma at the start and if so, take the string from the third character onwards thus removing the comma and space.

  8. Not the answer I was looking for. Of course there is a point making it into a dynamic page! If you read my post you will see that the site owner needs the urls to remain the same whilst having the pages generated dynamically, because some of the pages will be bookmarked already by surfers and will already be indexed by the search engines. I don't need a lesson on how to dynamically generate html pages, I need advice on how to write the mod rewrite rules as that's where my knowledge is lacking.

  9. I know nothing of mod rewrite, never had to use it before.

     

    I have a project which is a directory consisting of many html pages, one for each entry in the directory. Each page is named after the person the directory entry is for, e.g. some-one.html, someone-else.html etc. Things are complicated slightly by the fact that some pages are in another directory so the relative url is e.g. 2/an-other.html

     

    There are also pages such as index.html, search.html, etc.

     

    I have written the php to output each page dynamically and it takes the form page.php?url=some-one.html or page.php?url=2/an-other.html and outputs the page accordingly regardless of which directory the original html page was in.

     

    The site owner wants to ensure all the urls stay the same so he doesn't lose bookmarks or serps.

     

    So I need a set of mod rewrite rules that give me:

     

    index.html => index.html

    search.html => search.html

    etc.

     

    some-one.html => page.php?url=some-one.html

    2/an-other.html => page.php?url=2/an-other.html

    etc.

     

    Can anyone help?

  10. As for security there are things here that baffle me like from this article above

     

    I don't get wh the ask for the password again. Is this on every page that uses sessions ?

     

    session_start();

     

    if (isset($_SESSION['HTTP_USER_AGENT']))

    {

    if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT']))

    {

    /* Prompt for password */

    exit;

    }

    }

    else

    {

    $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);

    }

     

    What this is doing is checking that the user agent currently using this session is the same as the one that previously used it - i.e. it is attempting to prevent session hijacking. If the session ID is propagated in the URL instead of being stored in a cookie, that session could be hijacked by someone accessing the site with the same session ID in the URL. But the chances are their user agent would be different, so the above code would lock them out.

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