drayarms's Profile User Rating: -----

Reputation: 4 Apprentice
Active Members
Active Posts:
197 (0.11 per day)
18-May 11
Profile Views:
Last Active:
User is offline Apr 19 2016 10:59 AM

Previous Fields

Dream Kudos:
Icon   drayarms has not set their status

Posts I've Made

  1. In Topic: What's the best way to save user generated files in the server?

    Posted 24 Dec 2015

    So in your opinion it's less costly to save tons of data in database fields than it is on the server? I've always heard the opposite, particularly with images and sound files. I will check out the .htaccess rewrites though
  2. In Topic: unable to include css file from external folder

    Posted 22 Aug 2015

    No it's just pure css. No html tags. I'm just going to investigate the error

    That's possible but I wouldn't know. Here's the contents of my .htacess file

    php_value memory_limit 32M
    errorDocument 404 /index.php
  3. In Topic: unable to include css file from external folder

    Posted 21 Aug 2015

    View Postandrewsw, on 21 August 2015 - 03:02 PM, said:

    What error appears in your browser's console?

    Is the CSS loaded and working for another file/directory?

    Well I checked the error console and lo and behold, here's what I had

    "Resource interpreted as Stylesheet but transferred with MIME type text/html:" This refers to the stylesheet

    View Postmax67412, on 21 August 2015 - 07:25 PM, said:

    Although this might not be preferable or efficient, you could use:
    <link rel="stylesheet" type="text/css"  href="http://mydomain.com/style.css"/>

    Okay that worked but why would an absolute path to the url work and not a relative path?
  4. In Topic: How to convert javascript integer into PHP integer?

    Posted 27 Jul 2015

    View PostArtificialSoldier, on 27 July 2015 - 09:00 AM, said:

    I told you why it works, because your browser sees the Javascript code in the string and executes it. That's why the length of the string is off. If you don't believe me, open your browser so you see the query printed with the 1, and then right-click and view the HTML source. You will not see PHP printing a number 1, you will see Javascript code that your browser is executing and printing 1. That's also why there is an extra "space" after the 1 - because you used document.writeln (the space is the line break at the end from writeln).

    In short, when you print $number you are printing Javascript code that your browser is executing, you are not printing the number 1 from PHP.

    Makes sense. Thank you for the explanation. I've abandoned this approach in favor of some other less convoluted approach involving Ajax.
  5. In Topic: How to convert javascript integer into PHP integer?

    Posted 25 Jul 2015

    View PostMartyr2, on 24 July 2015 - 12:16 PM, said:

    Well first you can't do that. Javascript here is client side and PHP is server side. Meaning that your number JS variable is not available at the time that the PHP on page B is being executed. Second of all, let's take a look at this code here...

    $number = "<script>document.writeln(localStorage.getItem('number'));</script>";
    	//And run the query
    	$query = "SELECT * FROM table WHERE number = '$number' ";

    Here $number is a string of JS, nothing else. That JS is not executed or anything so when you put it in the query I am not even sure how you are even getting a number at all. Your query should be reading...

    $query = "SELECT * FROM table WHERE number = '<script>document.writeln(localStorage.getItem('number'));</script>' ";

    Which is obviously not going to work. PHP can render JS, JS can pass values to other PHP pages via AJAX requests and read in through post parameters, but how you are mixing them here is not making sense. Read my blog about this topic...


    Are you perhaps leaving out some steps?

    I understand the difference between server and client side scripting. But notice in this case that I'm adding a piece of javascript code to the document on the server side, just as I can any html element, assigning the output of that code to a PHP variable, then sending it to the client. I didn't expect it to work at first, but when I tried it, it seemed to work. How else would I get '1 ' in the var dump? I even tried
    echo $number
    just to make sure and sure enough, I got a '1' printed on the page.

My Information

Member Title:
D.I.C Head
Age Unknown
Birthday Unknown

Contact Information

Click here to e-mail me


drayarms hasn't added any friends yet.


drayarms has no profile comments yet. Why not say hello?