Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. You can't really detetct - you can however record whether the file download has been attempted when the link is clicked but that is all really...
  2. The text is actually inside the first span so try this $newstring = preg_replace("/<span(.)*?>(.)*?<span(.)*?>(.)*?<\/span>(.)*?<\/span>/","<span$1>$2$5</span>", $originalstring);
  3. you need to be able to assign another session variable and set its value to the area(s) that they have access to. This could be one directory in your site or an array of values that could be checked against the the database to help control access to pages.
  4. regular expressions will allow you to strip out the relevant bits of html that you want to place into your database. I can see it being fairly detailed but essentially quite straight forward. I susgest you get php/mysql/apache installed on your own machine and write a script, test it on say 10 pages and see what the out come is - once you are satisfied then run it on your big server as a cron (so it won't time out) and before removing all you old static files make sure the new dynamic version is tip top. Good luck - this is a great project one I think that many would liek to perform. It would be nice to see you use the opportunity to move away from table layouts - if you get the script right this will be quite easy. (when you have finished you may wish to sell it to the BBC so that they can adapt it to help move their (wonderful but table layout) site towards what they woudl really like.
  5. IE7 has taken some massive steps... But I have to say that I have not used a css hack in a very long time. xhtml1.1 dtd makes ie6 behave much better and I try to avoid using css that ie just doesn't play ball with (like position: fixed). The result being that sites tend to have a very consistent look and feel cross-browser so I am happy
  6. Personally I think that is a great idea. Some will argue however that it is a personal choice as to what method you use in your site design. Table layouts will porbably be around for ever (unfortunately) and many will not have the inclination to learn the alternative method (even if it provides too many benefits to mention.) The only thing I can say (and I have said it before) is that spending a couple of days learing some basic css techniques for site layout will be the most productive you will ever spend in web development - the knowledge you will gain in that short time will save you years in the long run on updating sites and fixing html bugs...
  7. looks fine to me... have they cleared their cache???? P.S. maybe their version of FF hates table layouts as much as me ;)
  8. yep float all the images within the div. [code[ <div id="imgcont"> <img> <img> ... ... <img> </div> div#imgcont img { float: left; clear: none; margin: 0; }
  9. margin-left: 0 auto; - can only have one value; float: left and position: absolute - choose one or the other... screen resolution is on of the reasons you should uss a css layout. either choose a fixed width site or (my preference) choose a fluid layout with %'s for widths. This is a learning curve for you - go and play with it; you will learn far more by trial and error than you will simply getting answers to questions - ask only when you are really stuck... Good luck and god bless ya for leaving table-layouts forever
  10. try this <?php foreach ($errmsg as $key => $val) { echo $key . " = " . $val . "<br>\n"; } ?>
  11. mcrypt_generic_init() - yes... trailing spaces??? no the string is trimed before going to the encrypter... charset is teh same on bothe pages <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
  12. you have given the first element and id so give the other 2 id's as well then in your css... td#leftnav { background: #f00; } td#middle { background: #0f0; } td#right { background: #00f; }
  13. you would probably need to use an imagemap to get what you want... Have a look at this article http://www.alistapart.com/articles/sandbags/ there may be a way you could modify that to acheive your goal.
  14. have you given the parent container of that div position:relative (or any other value than static)?
  15. Thansk for the response obsidian. just tried it a couple of ways with and with the htmlentities and html_entity_decode but to no avail. there are still some [pre][/pre] chars in the string that I can't get to identify and the decrypion is failing miserably....
  16. GGGGGGGGGGGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR another rant on the way!!!! Sorry Andy but I have had no where near enough coffee today............ Tables are for eating you dinner off (and displaying tabular data). Divs and CSS are what you need for layout... I need a hug.....................
  17. HUMBUG! There is a correct solution - not using tables. There is also an incorrect solution - using tables. Both would give the desired VISUAL ouput. but they would differ greatly in how a screen reader would tell you what was on the page. The fact that profile information is not really tabular data (unless you say two columns - column 1 is 'field' and filled with things like name, email etc. and column 2 is 'values' filled with John Smith, john.smith@beer.com etc) should help you decide to use the correct solution. The other issue is bandwidth - a table layout will (in every case I have seen) invovle much more extraneous html to achieve the same effect; making the page load much more slowly. There are too many reasons to not use tables for layout and anyone still insisting that it has its place in the world of professional/good design practice smells of poo!
  18. hello, I am sure I had doen this before but I have hit a liit snag... I have to pass the encrypted string one one page to the next - either in a session or a hidden field. The probelm being the special characters in the string. I have used a regular expression to replace line feeds etc... like so. <?php $this->find = array ( "/\\r/" , "/\\n/" , "/\\t/" ); $this->replace = array ( 'linefeedchar' , 'newlinechar' , 'tabchar' ); $this->rfind = array ( "\r" , "\n" , "\t" ); $this->rreplace = array ( '/linefeedchar/' , '/newlinechar/' , '/tabchar/' ); // encrypting. $encrypted = mcrypt_generic($this->td, $str); return preg_replace($this->find, $this->replace,htmlentities($encrypted)); // decrypting $str = html_entity_decode(preg_replace($this->rreplace, $this->rfind,$str)); return mdecrypt_generic($this->td, $str); ?> obviously this is all in class methods - that is not the problem. The problem lies with the characters of the encryption and converting them to ones that can be passed via post/session/url and then converted backonce more. If you can spot where I am going wrong please put me right. any thanks....
  19. you can read the contents of a file into a string or array (using fread) and then use htmlentities to convert all the tags that would be picked up by a browser to echo them out.
  20. tables will always be around - and so they should... BUT they should be used for what they were intended - displaying tabulated data (this may be worth a quick read http://www.cs.tut.fi/~jkorpela/html/tables.html) I f it is purely for presentational purposes - you should refrain from using tables.
  21. google 'position fixed' - there are a few fixes for ie6 (unfortunately you will need a bit of javascript to achieve this cross browser)
  22. I just have!!!!!!!! that code creates a multi dimensional cookie after that you can call the elements of the cookie as normal
  23. you can like this. if you know its a 2-d array... <?php foreach($_POST[index1] as $outerkey => $arr) { foreach($arr as $innnerkey => $val) { setcookie('cookie[' . $outerkey . '][' . $innerkey . ']', $val); } } ?>
  24. thats why I said they can BE arrays... array.split() is the js equivalent of explode. My personal opinion is not use javascript for setting cookies - let the server do it - you don't need to worry if js is activated or not then.
×
×
  • 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.