Jump to content

phdphd

Members
  • Posts

    248
  • Joined

  • Last visited

Everything posted by phdphd

  1. Hi All, So far the following line works. RewriteRule go-and-fetch([.*]) search.php$1 [L] What I want to is refining the variable because its contents is not user friendly enough. For example it might look like ?options=del&cat=tech&code=teinte_id_005 So I tried this line, which does not work RewriteRule go-and-fetch-tech-([.*]) search.php?options=del&cat=tech&code=$1 [L] Note that the following line would work : RewriteRule go-and-fetch-tech-teinte_id_005 search.php?options=del&cat=tech&code=teinte_id_005 [L] Thanks !
  2. Well, now, using absolute URLs for the external js file, both custom pages display correctly. There is another point : Does the fact of using absolute URLs for css & js requires also the use of absolute URLs for the "action" attribute in HTML forms ? The page contains a form and it seemed to me that leaving a relative URL in the "action" attribute would lead to the reload of the page instead of loading the page pointed by the action attribute.
  3. Entering myself /path/403.html loads the 403.html file and displays its contents. I was wrong in saying that the CSS gets lost. It is not the CSS (in fact it is inline CSS) but the JS code, which does some formatting and is stored in a separate JS file. Sorry about that, but I guess what you said is also valid for JS too.
  4. Adding "/" (trailing slash) causes 403 to happen. Adding "/blablabla" causes a page reload with loss of css styling.
  5. I made nothing special to neither grant nor deny access. Since 404.html page is accessible (its contents shows), and it is in the same folder as 403.html, I guess that 403.html should be accessible too. Am I wrong?
  6. Hi All, In an .htaccess file, I am trying to implement a 404 and a 403 ErrorDocument directives, like this : ErrorDocument 403 /path/403.html ErrorDocument 404 /path/404.html While the 404 directive works correctly by displaying the content of the 404.html file, the 403 one still leads to the display of the generic "403 Forbidden You don't have permission to access....". Did I miss something? Thanks!
  7. Thanks for your explanation. Now it works correctly again. I just put the JS staff that was initially inserted in the PHP file in a separate JS file that now contains the updated "var addressPoints" line.
  8. Just solved by using : var addressPoints = JSON.parse("[" + myDataCoord+ "]"); Question : why was this not necessary in the initial PHP file ?
  9. Hi All, I have a php file with some JS that implements a map with markers on it. It works. However to make my php file cleaner, I want to move the JS that builds the map and markers to a seperate js file. In the initial PHP file, the JS code has a line like this for the coordinates, that I need to adapt for a standalone JS file. var addressPoints = [<?php echo implode(",", $coordinates); ?>]; So I created a hidden div to echo the coordinates before storing them into a JS variable. I did the following : <div id="dom-target-coord" style="display: none;"> <?php $outputcoord = implode(",", $coordinates); echo htmlspecialchars($outputcoord); ?> </div> <script> var div = document.getElementById("dom-target-coord"); var myDataCoord = div.textContent; </script> <script src="../js/map.js"></script> And the first line of the map.js file is var addressPoints = [myDataCoord]; This does not work. In there something wrong in the syntax of this line ? Thanks!
  10. Thanks for your answer. For example, my website allows the user to upload jpeg files. Before storing the files, in addition to doing some checks, it renames the files in such a way that there will never be two files bearing the same name. Later, when the website displays those images, it first checks whether the corresponding files exist (if (file_exists(…))). Is this approach at risk as far as unserialization attacks are concerned ?
  11. Hi All, In a recent paper about unserialization attacks ("File Operation Induced Unserialization via the “phar://”StreamWrapper") that can be found here the recommended defence is : "To prevent the exploitation of this issue it is imperative to prevent attacker-controlled data being used in the beginning of a file name used in any of the file operations which can trigger stream wrappers." Is there a way to implement this protection ? Could a regex on the filename do the job ? Thanks !
  12. Hi All, I found an alternative to google map markers through Leaflet extra markers. http://coryasilva.github.io/Leaflet.ExtraMarkers/ I am using the white on black numbered icon. The icon displays on the map, but it does not print. Does anyone have any clues of how to fix this issue ? Thanks!
  13. markers.on('clusterclick', function(e) .... seems to do the job.
  14. Hi All, Based on the page https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html, I am building an alternative to Google maps using Leaflet. I need to get the coordinates of the point the user clicks on the map, whether that point corresponds to a cluster or not. For points that are not clusters the following works : map.on('click', function(e) { console.log("Lat, Lon : " + e.latlng.lat + ", " + e.latlng.lng) }) For points that are clusters the following works, but only if the cluster contains no more than one marker : markers.on('click', function(e) { console.log("Lat, Lon : " + e.latlng.lat + ", " + e.latlng.lng) }) What should I use to make it work for clusters containing more than one markers ? Thanks!
  15. Well, I think I found a solution with clearQueue(). Any comments welcome! https://jsfiddle.net/6sempeav/
  16. I've just posted a jsfiddle about this issue https://jsfiddle.net/949bm7vq/
  17. Hi All, I made some jQuery that successfully scrolls the viewport to the top border of a scrollable div when the user scrolls the contents of that div. The issue is that after that I cannot scroll the whole page (the div itself remains scrollable). Here is what my jQuery looks like : $("#scrollable_div").on( 'scroll', function(){ //here goes some code to calculate the distance to move $('html, body').animate({scrollTop: distance},'slow'); }); Thanks for your help!
  18. Hi All, I am not sure this is the right section to post to, sorry... I would like to know if there is a tool that is able to parse a php file and to extract the echoed strings from it. Thanks!
  19. Thanks for always being so quick at answering - at least my questions ;-). Much appreciated! I've just tried a workaround close to b). if(window.location.hash) { var newurl= window.location.href.substr(0, window.location.href.indexOf('#')); window.location = newurl; } else { // Fragment doesn't exist }
  20. Hi All, My home page uses tabs and is based on the following html, JS and CSS. The first tab contains an anchor to another paragraph in the same tab. <body onload="init()"> <div id="tabTitles"> <ul id="tabs"> <li><a href="#tab1">tab1</a></li> <li><a href="#tab2">tab2</a></li> <li><a href="#tab3">tab3</a></li> <li><a href="#tab4">tab4</a></li> </ul> </div> <div class="tabContent" id="tab1"> <a href="#other_paragraph">go to other paragraph</a> <p>tab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content tab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 </p> <p id="other_paragraph">tab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contencontent -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 contenttab1 content - tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content -tab1 content </p> </div> <div class="tabContent" id="tab2"> tab2 content - tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content -tab2 content </div> <div class="tabContent" id="tab3"> tab3 content - tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content -tab3 content </div> <div class="tabContent" id="tab4" > tab4 content - tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content -tab4 content </div> </body> var tabLinks = new Array(); var contentDivs = new Array(); function init() { //Grab the tab links and content divs from the page var tabListItems = document.getElementById('tabs').childNodes; for ( var i = 0; i < tabListItems.length; i++ ) { if (tabListItems[i].nodeName == "LI") { var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' ); var id = getHash( tabLink.getAttribute('href') ); tabLinks[id] = tabLink; contentDivs[id] = document.getElementById( id ); } } //Assign onclick events to the tab links, and //highlight the first tab var i = 0; for( var id in tabLinks ) { tabLinks[id].onclick = showTab; tabLinks[id].onfocus = function() { this.blur()}; if (i == 0 ) tabLinks[id].className = 'selected'; i++; } //Hide all content divs except the first var i = 0; for( var id in contentDivs ) { if ( i !=0 ) contentDivs[id].className='tabContent hide'; i++; } //Show linked tab if ( document.location.hash ) showTab( document.location.hash.substring(1) ); } // end of init function // ShowTab Function function showTab(selectedId) { if ( typeof selectedId != 'string' ) var selectedId = getHash(this.getAttribute('href') ); //Highlight the selected tab, and dim all others. //Also show the selected content div, and hide all others. for ( var id in contentDivs ) { if ( id == selectedId ) { tabLinks[id].className = 'selected'; contentDivs[id].className = 'tabContent'; } else { tabLinks[id].className =''; contentDivs[id].className = 'tabContent hide'; } } //Stop the Browser following the link. return false; } //end of showTab function function getFirstChildWithTagName( element, tagName ) { for ( var i = 0; i < element.childNodes.length; i++ ) { if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i]; } } function getHash(url) { var hashPos = url.lastIndexOf( '#' ); return url.substring(hashPos + 1); } ul#tabs { list-style-type: none; margin: 1em 0 0 0; padding: 0 0 0.3em 0; } ul#tabs li { display: inline-block; margin: 0.3em 0; padding: 0.3em 0 0 0; } ul#tabs li a { color: #000000; background-color: #f1f0ee; border: 1px solid #c9c3ba; padding: 0.3em; text-decoration: none; border-radius:0.2em; } ul#tabs li a:hover { background-color: #dedbde; } ul#tabs li a.selected { color: #FFFFFF; background-color: #000000; font-weight: bold; border: 1px solid #000000; } div.tabContent { border: 1px solid #c9c3ba; padding: 0 0.1em 0 0.5em; background-color: #FFFFFF; margin-top:0.21em; border-radius: 0.2em; padding-bottom:0.7em; overflow:hidden } div.tabContent.hide { display: none; } I noticed that if I click the anchor, then refresh the page, the home page displays only the tab titles. I also noticed that if I disable the JS, the full page displays (except that it is not tab-organized, of course). I guess that the anchor in the link causes the JS to fail. Is it possible to fix this ? Thanks !
  21. Hi All, Sorry if the title is not explicit enough. I have made a fiddle about my issue. http://jsfiddle.net/pggkfdkw/1/ I would like to adjust the div width (red rectangle) to its contents, while still keeping the text centered. Thanks !
  22. Results of mysqlcheck : all tables in all databases are ok, except for the tables of database performance_schema, for which it says "The storage engine for the table doesn't support check". Is this an issue or a normal result for that table ? Anyway, thank you very much for your help!
×
×
  • 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.