Jump to content

JamesB

Members
  • Posts

    425
  • Joined

  • Last visited

Posts posted by JamesB

  1. yes, as you see:$mysql = new mysqli('localhost', 'root', '', 'testebase');

    When i said to escape the apostrophes, this excludes the first and last per string, as shown in my example:

     

    'my'pass'word'

     

     

     

    @Ingolmethe server has no any error indicate before the line 5

    Sometimes the error line is off by 1 line, can you post your previous line of code.

  2. do you have an apostrophe in your password? if so you need to escape all apostrophes used by putting a backslash before them, eg.

     

    $mysql = new mysqli('localhost', 'root', 'my'pass'word', 'testebase');
  3. You need quotes around $tab in this line:

     

    $menu_res = query("SELECT * FROM menu WHERE menu_file_url = ".$tab);

    so:

     

    $menu_res = query("SELECT * FROM menu WHERE menu_file_url = '".$tab."'");

     

    You could have added this line and seen the output was 0.

     

    echo mysql_num_rows($menu_res);
  4. I managed to get it working using a timer, I'm not sure which data needs to be updated to avoid using a timer, but it works with an interval of 1 millisecond.

     

    change

     

    maxHeight.expand.call(maxHeight);

    to

     

    setTimeout(function() { maxHeight.expand.call(maxHeight); }, 1);
    • Like 1
  5. Try changing

     

    <body onload="new ElementMaxHeight();">

    to:

     

    <body onload="maxHeight = new ElementMaxHeight();">

     

    and add:

     

    maxHeight.expand.call(maxHeight);

    under:

     

    directionsDisplay.setDirections(response);

     

    If that doesn't work can you post a link to your site.

  6. Are you trying to send data from a html form to php? or from a html form to php then to another php page?

     

    if the latter, you can store the data into a database in the first php page, then in the second php page you can retrieve the data from the database.

    sessions might be more applicable though, despite you not wanting to use them.

     

    you can only use 1 action attribute in a html <form> tag.

    • Like 1
  7. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

     

    15.1.2.4 isNaN (number)Returns true if the argument coerces to NaN, and otherwise returns false.1. If ToNumber(number) is NaN, return true.2. Otherwise, return false.

     

    9.3.1 ToNumber Applied to the String TypeToNumber applied to Strings applies the following grammar to the input String. If the grammar cannot interpret the String as an expansion of StringNumericLiteral, then the result of ToNumber is NaN.

  8. Hi! Is it possible to have a htaccess file check if the filename in the URL, exists in a certain folder on the server? I have this URL:http://127.0.0.1/mywebsite/directions Which should check if this file exists:<root>/mywebsite/Templates/Pages/directions.php If it doesn't exist, a 404 should be given. I have this code:

    <IfModule mod_rewrite.c> RewriteEngine On RewriteCond /Templates/Pages/%{REQUEST_FILENAME}.php !-fRewriteRule (.*) - [L,R=404] </IfModule>

    But it's currently giving a 404 on all pages. Edit:The .htaccess file is at:<root>/mywebsite/.htaccess

  9. I don't understand what, if anything, connects the datetime field to the displayed value
    i'm not 100% sure, but i think the displayed time is only taken from the <time> element's value, <time>here</time>,whereas the non-displayed machine-readable time is taken from 1 of 2 places, the datetime attribute, or the <time> element's value, with the datetime attribute taking priority. http://www.w3.org/TR...me-element.html To set/get the datetime attribute as a string, you can use setAttribute/getAttribute (i'm not sure if theres a better way)eg.
    console.log( document.getElementById('time1').getAttribute('datetime') );document.getElementById('time1').setAttribute('datetime', d.toISOString());

    The toISOString() method seems to give the same date/time format as the datetime attribute.http://www.w3schools...toisostring.asp

  10. are you sure imageData is a property of the context object? you might need getImageData() instead.i'm not sure how to use indexOf on an ArrayBuffer, but the loop might be worth a try:

    var canvas = document.getElementById("canvas");var ctx = canvas.getContext("2d");var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); var data = imageData.data;var dataLength = data.length; var alphaFound = false;for (var i=0; i<dataLength; i+=4){if (data[i] == 255){alphaFound = true;break;}}

×
×
  • Create New...