Jump to content

son

Members
  • Content Count

    1,024
  • Joined

  • Last visited

Everything posted by son

  1. Is it possible to style a parent element when the element is in hover state? Not sure if that only works with Javascript... Son
  2. son

    Mod Rewrite

    I can see now where I was going wrong. I created physical pages instead of having one file that has a second parameter for the relevant page. This makes it actually much easier also, so much preferred solution:-) I use now: Options +FollowSymlinksRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^([A-Za-z0-9_-]+)$ /folder/index.php?id=$1 [NC]RewriteRule ^([A-Za-z0-9_-]+)/$ /folder/index.php?id=$1 [NC]RewriteRule ^([A-Za-z0-9_-]+)/page([0-9])\.php /folder/index.php?id=$1&page=$2 [NC] The RewriteCond was necessary as it also rewrote files in root directory of website. I only
  3. son

    Mod Rewrite

    Hi Don,I see what you are saying, but I try to rewrite, so the folder name is replaced with the content from the query string. For this, your examples would not work...So, as for my task:RewriteRule ^([^/]*)$ /folder/index.php?id=$1 [L]works well to 'create' a folder name from querystring that is used instead of actual folder name. However, my issue is now that when then a user clicks onto any link to files within the folder (there are three, they are index.php, about.php and contact.php) the page cannot be found.Do you have any idea how I could make this work? Thanks,Son
  4. son

    Mod Rewrite

    I use the following RewriteRule ^([^/]*)$ /folder/index.php?id=$1 [L]RewriteRule ^([^/]*)/$ /folder/index.php?id=$1 [L] and it works well. Trying to apply it to the individual file names as RewriteEngine OnRewriteRule ^([^/]*)/index\.php$ /folder/index.php?id=$1 [L] crashes the server (500 error). I cannot see what is wrong. I escaped the dot and other than that it should follow the same syntax, shouldn't it? Son
  5. The quotes solved the issue. Many thanks. Did not think about this... Son
  6. I am trying to insert a string into db which is made of timestamp, dash as separator and unique id as$insertString = $timeNow . "-" . $ID; Problem is that is subtracts the id from the timestamp rather than treating the dash as a separator. What would be best to do? Son
  7. son

    Link Inside Text Area

    Used the entities version which is fine as I only want an easy way for users to grab code that can be inserted into their own pages... Cheers,Son
  8. son

    Link Inside Text Area

    I have placed links inside a textarea, so user can right-click and easily copy/paste code. It does not validate and complains there should not be <a /> element in textarea. What could I do instead? Son
  9. son

    Web Address Validation

    Thanks for your input:-) Will use a similar approach... Son
  10. son

    Web Address Validation

    I take it you do not check for anything else (like characters that are not allowed in domain and/or web pages etc)? Son
  11. son

    Web Address Validation

    Do you not validate at all for the rest of URL? As for 'stickly': I mean sticky. Sorry for spelling mistake. When user sumits form and one or several entries need to be entered/changed the rest does not need to be entered any more... Son
  12. son

    Web Address Validation

    Hi guys,I have been agonising about this for some time and would like to ask for advice. There is a large amount of samples to check for right pattern of web addresses and I am not sure how far I have to go... I simply want to make sure that the right syntax is used. If user forget http:// and/or www I am not so bothered. What do you guys usually do? Also, I learned never to make password fields stickly, but have come across stickly ones here and there. Am I too protective and should change my ways? Thanks,Son
  13. son

    Delete From Several Tables

    Thanks. Will give this a go... Son
  14. son

    Delete From Several Tables

    I am with you and will run all queries separately... Just as I always use if ($deleteResult = mysqli_query ($dbc, $deleteQuery)) {echo "Success"}else{echo "Did not work";} is there a way to check in one go if they all went fine without causing any issues? Or is this not a good idea? In any case, I like to dispay text to show all went ok (all queries)... Son
  15. son

    Timestamp Conversion Issue

    Thanks. Date is in good format and works well:-) Son
  16. son

    Timestamp Conversion Issue

    I used now strtotime() and it seems to do the trick fine. When you said 'You should keep $dateEcho as a timestamp form, and set the date to be printed in another variable.' I cannot see how I could achieve this. The timestamp value is coming from db, converted for user conveniece to date format to be displayed in form input field which can be updated by user. So, the value coming from the form field will be in any case in date format. Is this what you mean? And is there a problem with using strtotime? Many thanks,Son
  17. I display in form a timestamp as: $dateEcho=date("d.m.Y, G:i", $dateEcho); This field can be updated. To convert the date back into timestamp format I use: $dateEcho=mktime($dateEcho); Changing the displayed date always enters the current timestamp plus one hour... How can I enter the timestamp as displayed in input dateEcho? Son
  18. On click on a button data in db should be either totally removed or all table data other than one deleted. I am having trouble for the right way of running all those queries in one go. I post the code below: $deleteQuery = "DELETE FROM tab1 WHERE tabID= $tabID;"; $deleteQuery .= "DELETE FROM tab2 WHERE tabID= $tabID;"; if ($_GET['conf'] == '2') { $deleteQuery .= "DELETE FROM tab3 WHERE tabID= $tabID;"; $deleteQuery .= "DELETE FROM tab4 WHERE tabID= $tabID"; } else { $deleteQuery .= "DELETE FROM tab3 WHERE tabID= $tabID"; }if ($deleteResult = mysqli_query ($dbc, $deleteQuer
  19. son

    Hour Identifier In Date

    My word. GTM was the issue... I looked at this bit over and over again and did not spot the mistake|-) Cheers, appreciate your input:-) Son
  20. I am confused here about the hour value in displayed date from timestamp I retrieve from db. To display date I use the following date_default_timezone_set('GTM'); $rDate=date("d.m.Y, G:i", $rDate);echo $rDate; The hour is wrong, it is one hour too late. Why could that be? I used a date/time to timestamp converter for values in db, so this should be fine (also when I use converter the other way round works just fine)... Son
  21. Thanks everyone. I tried all and to be honest it is right: to reduce the items in nav seems the only way to do the trick. I sat for a while and created a very nice menu that was still a tiny notch too long as it was (had it all in columns). However, unfortunately the decision is not up to me and I have now suggested a simple drop-down that lists everything in one vertical line. It is also not very pretty, but it would not convey the message of a very elaborate navigation that somehow got messed up;-) Son
  22. If possible I would like to avoid it as it does not look that great. Or do you know a method now of styling this better than it worked in the past? Son
  23. I have a lovely horizontal nav where the sub-lists only show when user go over the li element. The code is: #topNav li {float:left; position:relative; margin:0 10px;}#topNav a {color:#000;}#topNav li ul {display: none;}#topNav li:hover ul {position: absolute; top:23px; left:0;display:block; padding:5px 0;}#topNav li:hover ul li {display:block;background:url(nbg.png) repeat;-width:230px; z-index:2; color:#000; border-bottom:#000 1px solid;} The problem now is that the nav items became so many that they do not all fit on computer screen and you cannot get to last items in nav if you see what
  24. son

    Jquery Scripting

    Again, many thanks for those great hints. Did print those also now and this will hopefully help me in the future. And am pleased that script does it's job now... This is really great:-) Son
  25. son

    Jquery Scripting

    I am actually logging as you suggested in previous post, only that I am using function log() { if (window.console && window.console.log) for (var i = 0, l = arguments.length; i < l; i++) console.log(arguments[i]);} It did not log anything for a while and just now I realised that there must have been a cache issue as things finally started logging. This is also the reason why I got a bit desperate. When you try and try and nothing works without the error log showing anything you think you are going crazy or something. Or so at least I do... I keep having issues like this and a
×
×
  • Create New...