Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About phdphd

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. phdphd

    $.post with variable as field name

    Not really. But anyway thanks for the time spent on it. I think I was misleading you (and myself too) by using "field name". What is sent is not actually a field/value pair, but a value that will go in the WHERE clause of a MySQL query where fields are already set. I realized I need no JS parameter for this in fact...
  2. Hi All, I have a $.post query with a field/value pair as an input parameter $.post('query.php',{field_name:value},… This code is inside a function that is triggered by an onkeyup event onkeyup="myFunctionV()" As such it works. Now, is it possible to pass the "field_name" part of the query as a parameter ? The following triggers the function but fails with a "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data" error. onkeyup="myFunctionV('field_name')" function myFunctionV(hello) { … $.post('query.php',{hello:value},... Thanks!
  3. phdphd

    Variable Not Processed In .htaccess

    For those who might be interested RewriteCond %{QUERY_STRING} tech=(.*) RewriteRule go-and-fetch search.php?options=del&cat=tech&code=%1 [L]
  4. phdphd

    Variable Not Processed In .htaccess

    Yes. And to make the query string more user friendly, I removed the square brackets. RewriteRule go-and-fetch-tech-(.*) search.php?options=del&cat=tech&code=$1 [L]
  5. phdphd

    Variable Not Processed In .htaccess

    Hi Requinix, First of all, thanks a lot for coming again to my rescue. Much appreciated. What you wrote is very interesting & instructive. When I started to build my htaccess file I wrote a line that looks like.... RewriteRule go-and-fetch search.php [L] ... in order for the URL to look user friendly from the very first time the page would be loaded. It turned out that afterwards I made some updates to my page essentially by designing an area that gathers the criteria chosen by the user and where they can selectively click a specific criterion to delete it. That is where comes into play the "?options=xxxxx" part of the URL. So to keep the user-friendly URL also in the cases where the user deletes a criterion, I thought I needed to add the following line RewriteRule go-and-fetch([.*]) search.php$1 [L] Actually this line seems useless. I have just made some tests with just the other line enabled, and "go-and-fetch" always displays in the address bar either alone (like when first loading of the page) or followed by the "?options=xxxxx" part that corresponds to the criteria that the user clicked in order to delete it.
  6. 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 !
  7. phdphd

    ErrorDocument 403 Does Not Work

    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.
  8. phdphd

    ErrorDocument 403 Does Not Work

    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.
  9. phdphd

    ErrorDocument 403 Does Not Work

    Adding "/" (trailing slash) causes 403 to happen. Adding "/blablabla" causes a page reload with loss of css styling.
  10. phdphd

    ErrorDocument 403 Does Not Work

    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?
  11. 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!
  12. phdphd

    Map Markers Do Not Show

    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.
  13. phdphd

    Map Markers Do Not Show

    Just solved by using : var addressPoints = JSON.parse("[" + myDataCoord+ "]"); Question : why was this not necessary in the initial PHP file ?
  14. phdphd

    Map Markers Do Not Show

    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!

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.