Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Hey everyone, Maybe this should be asked in the General forum but since my question basically deals with JavaScript, I thought I'd ask here. I made a little drag and drop app with JavaScript.. a friend of mine said it did not work on their iPad and another said it didn't work on their nook.. So are mouse related events completely incapable on such devices? I would assume yes since people are not using a mouse to use their device but then what can we do to make our code compatible with these kind of devices? It would be interesting to find out there will be elements with attributes like ontouch="", ontouchdown="", etc. Thanks.
  2. Don E

    different behavior

    Did you get any errors at all on your home PC server? Usually having a session_start() and then somewhere later in your code you send a header causes the error "Headers already sent". Even echoing before calling the header() function can cause this error. I don't know if this is your case/problem but from the looks of your code, you have a session_start() and then in the else clause you are sending a header. If it finds a user(if num_rows is not equal to 0), it will execute the else clause resulting in the header being sent and getting the "headers already sent" error because of the session_start(). As a side note, for the '$userid' in the query, try removing the single quotes. If it's an integer, you don't need quotes. But first convert $_POST['userid'] to an integer since from my understanding, values in the POST array are treated as strings. So to convert it, you can use the intval() function: $userid = intval($_POST['userid']);
  3. With MySQL you can use the left() function to get/return the left most certain amount of characters you specify.. So for example: $query = "SELECT LEFT('description', 50) as 'description' FROM 'product_listing' WHERE 'id' = 5"; This would select the left most 50 characters from the column 'description' from the row of an id of 5. There's also a right() function as well. http://dev.mysql.com...-functions.html Then once you do that, on the page that will display the results... just have (....) after. The (....) can be a link too where when the user clicks on it, it takes them to a page fully displaying the result(s), meaning the rest of the characters/words.
  4. There is... go to: http://php.net/manual/en/book.image.php
  5. Don E

    A humble request.

    You can purchase it here: http://www.w3schools.com/books/books_css.asp
  6. It seems you have two paragraph tags in that area and both of those paragraph tags contain two <br/> within each. So in other words, it looks something like this:<p> <br/> <br/></p> <p> <br/> <br/></p>
  7. I believe it is because there you're passing an array basically. Try setting $_FILES["file"]["name"] to a variable like the following and see if it works: $fileName = $_FILES["file"]["name"];$extention = end(explode(".", $fileName)); This error maybe because of the time when the PHP tutorials were written at w3schools, it was written for earlier/older versions of PHP and you're probably using an up-to-date version of PHP or latest version... or maybe its something else all together..
  8. To answer question 2... no there is no difference really because basically everything that you can do with OOP mysqli, you can do with the procedural style mysqli. The PHP developers made it where mysqli can be implemented procedural or OO.
  9. Don E

    Pc cleaner?

    My personal favorite: http://www.piriform.com/CCLEANER
  10. Don E

    session path

    ...thus why sessions are more safer than regular cookies for sensitive information... I see.. Thanks JSG and boen.
  11. Don E

    session path

    So if I understand correctly.. when we create a session, the server automatically creates a cookie on the clients'(users) computer and that cookie has information about the session that is stored on the server?
  12. This probably would of been a better idea to post in the JavaScript forum.. What the above is doing is... var y is set to 5.var x is set to y, which is 5 then added 2 to it resulting in x being set to 7.var demoP is set to the element with the id of "demo".demoP.innerHTML = "x = " + x; sets the 'content' of that element to be/display "x = 7". "x = " is a string, then the plus sign/operator concatenates the value of variable x which is 7 resulting in saying "x = 7" So if the element is a div container with an id of "demo", it will look like this basically: <div id="demo">x = 7</div>
  13. Just a quick question... is getUrlVars() a user-defined function or of some library? Thanks.
  14. Don E

    section or aside?

    Elements(tags) like <header>, <footer>, <section>, <aside>, etc are known as Semantic Elements. From my understanding they are to help with certain browsers, like screen readers etc for disable people for example in describing the content/page to the user(s). I still use divs mostly for everything as well since HTML5 elements are not fully supported in most/all browsers yet.
  15. Try saving your screen shot with an image file type of .png or jpeg and then try uploading it.
  16. Don E

    Is it possible to...

    At this link: http://davidwalsh.name/prevent-cache I basically did what's shown but it's shown for CSS files and JavaScript to prevent cache. When trying the following by removing 'd=', it still doesn't display the image: echo '<img id="image" src="../uploads/' . $_SESSION['picName'] . '?' . time() . '" alt="Image" />';
  17. Don E

    Is it possible to...

    Thanks JSG. When I try the following in the ajax call to the image modifying script: echo '<img id="image" src="../uploads/' . $_SESSION['picName'] . '?d=' . time() . '" alt="Image" />'; .. it doesn't append to the file and no image is displayed. Maybe I'm not appending correctly? (Note: $_SESSION['picName'] is just contains the name of the image, like: mypic.jpg) Thanks again.
  18. Don E

    Is it possible to...

    Hello everyone, I was wondering if it's possible to update an image on a webpage without having to refresh the page so that the updated image can be displayed? I know that ajax will be involved and I have tried it but when echoing the new image in the PHP that process/makes changes to the image, it doesn't display the new updated image. I did a bit of searching and some have said the update may not be taking place because the 'cached' version of the image is being displayed? I'm not sure. The only way I was able to get this to work is when after processing the image, I have the browser refresh using: window.location.reload(); Any input is greatly appreciated, thanks!
  19. I use this: RewriteRule ^([a-zA-Z]+)$ $1.php [nc,l] If a link on a page looks like this for example: <a href="services" title="Services">Services</a>, when clicked on, it will go to services.php but what's being displayed is: www.site.com/services
  20. Try adding: + "px"; to x and y: obj.style.left = x + "px"; obj.style.top = y+10 + "px";
  21. Thanks for the interesting responses.
  22. Hey everyone, I was wondering why is JavaScript not mandatory in browsers but allowed for users to disable it? I know the vendors like to give the users the option to disable to give them "control" but in today's time, shouldn't JavaScript be mandatory since a lot of websites require it for the website to function properly etc? From my understanding, you cannot harm a persons computer with it or something of the like.. So then it would it accurate to say that the reason why it's allowed to be disabled is to give the user control? Thanks.
  23. Don E

    syntax error

    The while loop($row = mysql_fetch_array($result, MYSQL_ASSOC);) or/and this if: if (isset($_POST['phour'])) { is not... or does not have closing braces from the looks of it.
  24. Using single quotes or double is the same thing basically with the above; no difference. Undefined index means there is nothing in the super global $_POST array with an index named username which could be from the username input name attribute of the form that is submitting to the above script is not identical to: $_POST['username']; So for example, if you have this in your form: Username:<input type"text" name"usrname" /> and then have this: $_POST['username']; in your PHP script, you're going to get the Undefined index error. That is why I asked what your HTML form looks like.
×
×
  • Create New...