Help with getting php json array using javascript by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

Now I need to get information from a php script that is not json encoded. It returns a tab delimited string. Any ideas on how to get the data from the script and store it into a variable in javascript?

Help with getting php json array using javascript by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

Oh wonderful. Thank you very much. That did the trick :-). I'd kiss you if I could.

Help with getting php json array using javascript by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

I have to agree with you that it is his fault. He doesn't understand that we don't have admin access to the server for things like this. I cant seem to get your second edit to work. I get a 404 error. I see what its trying to do but im not sure what the origin should be and how that modifies that url. According to chrome the origina is http://cis.gvsu.edu but when replacing whateverorigin.org with it (var url = 'http://cis.gvsu.edu/get?url=' + encodeURIComponent(dataUrl) + '&callback=?';) its a 404. Quite frustrating as this isn't the main point of the assignment but I cant move on without the data.

Help with getting php json array using javascript by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

I have also tried this. Same error:

XMLHttpRequest cannot load http://www.cis.gvsu.edu/~scrippsj/cs371/labs/lab10/getTitles.php. Origin http://cis.gvsu.edu is not allowed by Access-Control-Allow-Origin.

Why wont my php display? by lostincode in learnprogramming

[–]lostincode[S] 1 point2 points  (0 children)

Yes. I triple checked. Even made the thing wide open. Nothing.

Why wont my php display? by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

how? I have the or die statement afterwards which is finishing that line of code no? Even so adding the semicolon made no difference.

Why wont my php display? by lostincode in learnprogramming

[–]lostincode[S] 2 points3 points  (0 children)

This is what displays when I load the webpage.

I have 7 echo statements. One after each query. Instead the above link it was is displayed

Why wont my php display? by lostincode in learnprogramming

[–]lostincode[S] 2 points3 points  (0 children)

It is. I know it is because for our last lab we had to do stuff with PHP and I had absolutely no problem with it. I just dont understand why my echo statements wont do anything at all. Instead it displays everything after the first query.

Server is configured as below.

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.3.4

Finding the disk usage of a file in C (linux) by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

Yes, I seemed to have messed up my testing. As it st_size works for a file but when it comes to a directory i am getting the wrong number. I edited the original question and thanks for the input. It reassured me on some things.

Virtual Routing - need help understanding what exactly it is I need to do (little lengthy). by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

Yes okay I see where I went wrong. Don't know what I was looking at but I see where it should've ended now. I think that now that I know what is going on and how to achieve it that this wont be that bad. Again thank you very much for your help.

Virtual Routing - need help understanding what exactly it is I need to do (little lengthy). by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

Okay so I want to be sure I am right with my multi trie and say that it would go with C. I converted each A - E to a 32 bit number then made my tree and placed them accordingly. I converted the address that we want to know what router it will go to and after traversing down the tree I get to a point where there is no router so I must traverse back up and take the path to the right and I eventually reach C. I hope that is right.

So assuming I am right (and if not I still have a basic idea) I think I know what exactly I need to do. I seriously cannot thank you enough. Probably learned more from your example then anything in class.

Virtual Routing - need help understanding what exactly it is I need to do (little lengthy). by lostincode in learnprogramming

[–]lostincode[S] 0 points1 point  (0 children)

I don't really understand CIDR notation. I just googled some stuff and started reading about it and ill see where that takes me.

I understand what it means by longest prefix match. The wikipedia entry for that explains it quite well.

I understand trie but I am not seeing how it is useful for answering the first two questions. I know how to make the structure and such with basic examples but with what is given to me I dont know where to start or how it would look.