Jump to content

JamesB

Members
  • Posts

    425
  • Joined

  • Last visited

Everything posted by JamesB

  1. Check the first example on the manual for pathinfo(): http://php.net/manual/en/function.pathinfo.php PATHINFO_BASENAME
  2. You can either set $listproduit to false before it is conditionally set to true, or use if(!isset($listproduit))
  3. When i said to escape the apostrophes, this excludes the first and last per string, as shown in my example: 'my'pass'word' Sometimes the error line is off by 1 line, can you post your previous line of code.
  4. 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');
  5. you need apostrophes around the value to indicate a MySQL string: $result = $mysql->query("SELECT * FROM trybase WHERE name= '".$_POST['name']."'");
  6. 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);
  7. http://stackoverflow.com/questions/426258/how-do-i-check-a-checkbox-with-jquery for (var i = 0; i < myArray1.length; i++) { var row = myArray1[i]; $("#"+row).prop('checked', true);}
  8. Can you post your HTML code for the form?
  9. 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);
  10. 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.
  11. Well you do need to use either the search or match method. http://www.w3schools.com/jsref/jsref_search.asp http://www.w3schools.com/jsref/jsref_match.asp http://www.w3schools.com/jsref/jsref_obj_regexp.asp
  12. a general rule for forms is: validate input if(input is valid) { execute some code, eg. include page2.php to show the confirmation form} else{ execute some code, eg. include page1.php to show the first form}
  13. 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.
  14. You would be better off modifying the server-side code to not output the rn.
  15. Do you have a new line (with indentation) or any spacing before the </textarea> closing tag? Also you forgot an equals sign for the value attribute.
  16. Back End = Server-side = Code running on the server. eg. PHP, ASP, SQL Front End = Client-side = Code running on the client. eg. JavaScript, HTML, CSS http://en.wikipedia.org/wiki/Backbone.js http://en.wikipedia.org/wiki/Bootstrap_(front-end_framework) https://www.google.co.uk/?gws_rd=ssl#q=define+bootstrap
  17. Java and JavaScript are 2 completely different languages. You will need server-side data validation (in PHP). Client side data validation (in JavaScript) is optional. Make sure all your form values are being validated in PHP.
  18. can you upload the file containing that code?
  19. Try adding a space before the } in this: <?php}
  20. JamesB

    Apostrophe wtf

    That line takes the $color parameter, and sets the "color" property on the object. $this refers to the object. $car = new Car("red"); echo $car->color;
  21. 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.
  22. Try removing the single quotes from the select query, and adding a set of () brackets around it instead.It's probably being treated as a string.
  23. 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
  24. 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
  25. 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...