Jump to content

king arthur

Members
  • Posts

    335
  • Joined

  • Last visited

    Never

Everything posted by king arthur

  1. You will need the ftp details for the site you are uploading to. Then upload the files via ftp using an ftp client. I actually use IE for ftp without any problems.
  2. Usually when stuff like that happens it means you've got a missing closing tag somewhere, but I wouldn't like to say where.
  3. Put a die statement after your queries, e.g. $query3 = mysql_query($querysql3) or die(mysql_error()); and see if it is getting an error there.
  4. 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... }
  5. You can also just do $tNum = mysql_result($techMatch, 0);
  6. 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.
  7. 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.
  8. 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.
  9. king arthur

    Opacity

    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.
  10. Not sure that you're quite understanding how an if statement works. The only results you can get from an if are true or false. E.g. if(this statement is true) { run this block of code } else { run this block of code instead }
  11. Try doing print_r($_SESSION); after the session_start() on your search page to see what is actually getting set.
  12. Just add $id = $_GET["id"] at the start of your php.
  13. BTW your code as it stands, appears to produce six variables $match1 - $match6 all the same.
  14. The only way that can be happening is if the second or third if statements are executing in each case. So there must be something going wrong with if(!empty($Subtopic)) or if(!empty(Theswords)). I.e. the strings are not empty but contain a space perhaps. Or maybe the comma is already appended to the string $Topic?
  15. 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.
  16. Well for some reason it didn't like the $ So I have rewritten it as RewriteRule ^(.*)\.html page.php?url=$1.html which seems to work. I'd still like to know why the previous one didn't work. And what the best way would be to exclude certain html page urls from being rewritten.
  17. Well that should work on a simple level. But it doesn't - all I get is the url page.php?url=page.php I can't see how it is doing this. Any ideas anyone?
  18. 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.
  19. 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?
  20. 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.
  21. I take it you are doing session_start() at the top of every page? Have a look at your session.save_path setting and make sure it points to somewhere valid.
  22. Sorry guys, just discovered that it does work, it's just that the strings were full of tabs and newline characters not extra spaces.
  23. Anyone have a quick simple way of getting rid of white space in the middle of a string? I've tried str_replace(" ", " ", $string) but doesn't seem to do it, I guess it doesn't work with spaces?
  24. You may need to put backticks around the username and password column names, as they are reserved words in MySQL. $sql = "SELECT * FROM $table_name WHERE `username` = \"$username\" AND `password` = \"$password\" ";
  25. Locking a user out after three failed attempts may work. Logging the IP address won't achieve much though. What you ought to do is create a database table that records the username used in the failed attempt, plus the time of the attempt. Insert a new row on every failed attempt. Count up all attempts with the same username in the past hour or however long you want, if there are three or more, disallow access regardless of the password. Delete any rows older than one hour. The reason recording the IP is not much good is, there are brute force password hacking programs out there that can hide themselves behind proxies. So each time they attempt a username/password combination, the IP address appears to be different. If your server can cope with the login page being hit once per second for several hours, using the above method may be good enough to foil these programs.
×
×
  • 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.