This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!

Johnathon Anderson

Greenhorn
+ Follow
since Jan 31, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Johnathon Anderson

I am having a tough time trying to parse through this. I am more of a Java developer so I implemented this using arrays. How can I go about that in PHP?




This is the response from eBay in XML

I am setting the specifcsName and and specificsValue like so



Here is where I am trying to display it.



The above code is returning the follow:
Professional Grader
  Professional Sports (PSA)
Professional Grader
  Professional Sports (PSA)
Professional Grader
  Professional Sports (PSA)

It's not parsing EACH NameValueList.
1 year ago
PHP

Tim Holloway wrote:You didn't say what you are trying to execute when you get the error.



I said that console tells me that kick2 cant be found. That was the error.
Yes, I can do it without an array inside of an array I guess. I just perfer iterating through the array. saves on code.
1 year ago
On a side note...if I do...



It will print out:

[{"kick":"0.2"},{"kick2":"0.2"}]
[{"kick":"0.2"},{"kick2":"0.2"}]
1 year ago
I have the following JSON (its a much bigger file)... and I keep getting that kick2 cannot be found.

JSON


JAVA
The first System.out.println will print.


Thanks!
1 year ago

Rob Spoor wrote:Security through obscurity is no security at all. You need to properly shield the JSON file, and can't expect it to be safe just because nobody knows how to find it.



And that's what I'm getting at. Can you kindly point me in the direction on how to achieve that?
1 year ago
PHP
If you have the website, php is pretty much hidden and runs before the website loads. Is there anyway for anyone to know exactly where my json file is located without seeing my code?
1 year ago
PHP
Sorry for any confusion.

The main purpose of the web application is to update a JSON file.

That JSON file will be used in a Android and iOS application.
I may need to update the information on the JSON, and the purpose of making a web app is to allow myself (or the other developers on my team) to make changes on the JSON which will in return change the information on the Android/iOS game.

Think of this as Firebase, but the JSON is on MY web server, and not with Google. The JSON contains names/numbers/ids/etc, etc. Once they change within the JSON, they will change within the app on the device as soon as it gets refreshed. I plan to do this for a lot than just names.... so I need to make sure that only myself (or my devs) can access and change this information.

Lets think of the json file being stored here:

www.website.com/file.json. If this was a think, you can write a pretty simple PHP script to parse through the JSON like so:



I can then create this to go through the array of contents.



I dont need to upload the code to save this information back in the JSON, I think you get the idea. If you, being a PHP developer knew this exact code, you would be able to take my json file (www.website.com/file.json), write the same script, and change it from YOUR code on MY server. I am trying to make it so NO ONE can change this JSON other than the people logged in to the api backend.
1 year ago
PHP
If I create a php login with sql in front of the JSON editing web app, does that help?

Im not sure I understand what you mean by standard server security
1 year ago
PHP
I want to prevent anyone else to edit the json. If they have the json file, then they can edit it, no? For example, if the json is www.website.com/file.json, if wouldnt you be able to type in that same file and be able to edit the file like I could?

1 year ago
PHP
I created a website where I read in a JSON file from my web server. I use PHP to read it, update (edit/add) the JSON file. I was wondering what keeps other developer from reading that same JSON file and update it on their own and then change my file?

I guess I can put the JSON somewhere else on my web server, but would anyone be able to find it and do as I stated above?

If the JSON filename is stored in PHP, can someone read it?
1 year ago
PHP
OK, So I got it so everything will read from the file. Now, I need to set it up so I can add/update a list item....
Here is my updated Servlet



Here is my form in the addProduct.jsp (also will be update)


The problem I am facing is that it wants to goto /add and not add the items in ProductIO and then back to displayProduct
2 years ago
JSP

Dave Tolls wrote:But this is a webapp.
As soon as you have two people hitting the server at the same time you will hit issues (which is what I was eventually going to bring up).



Yeah. It's to get my feet wet with servlets, JSP, etc.
Thanks for the heads up though!
2 years ago
JSP

Junilu Lacar wrote:Do you anticipate having more than one concurrent user for this? Because if you do, then you're in for a world of hurt by writing your ProductIO class like that. You have mutable static fields and that's generally not a good idea, especially in a web application.



No. It's a basic crud system. Just need to write and read from the io class.

2 years ago
JSP
Thanks Dave.

I was able to get everything to be pulling through from the txt file inside of a table. But my table was messing up.

I'll repost when I get home unless I fix it after messing around.
2 years ago
JSP
I cant seem to edit my post.....



This is what I have, but what do I do with the data once I get it.... and I would imagine I need to store it somewehre as well....or, I can setParameter with that string....
2 years ago
JSP