|
Ha! Sounds similar to what we had to do in the adult telephony content delivery space when I was doing that!
I'm sure it can be done, but probably not cheap.
|
|
|
|
|
This is not for adult industry;) we re not looking for a cheap solution but for a good solution.
|
|
|
|
|
Hello all. This is my 1st time using this so apologies if I haven't got this in the right posting category or if my wording is horrible.
Anyways, what I wanted to query: so I'm trying to send an array from a javascript page to another PHP page. Separate files. Here's the javascript:
var purchase, sendDB;
purchase = {"Boots":"100","Phone":"800","AK":"600"};
sendDB = JSON.stringify(purchase);
$.post("http://localhost/POS_Proj/POS_DB.php", sendDB, function(){
alert("sending purchase data to php.");
});
So in the $.post part of the code the callback does its thing and gives the alert. So in theory there's nothing wrong with that part of the code.
Here's what I currently have for the php side:
header("Content-Type: application/json; charset=UTF-8");
$recData = json_decode($_GET['http://localhost/POS_Proj/testFront.php'], false);
I'm just trying to get the php to actually accept/handle the data sent from the javascript. If anyone can point me in the right direction or any sort of advice would be much appreciated
Thanks
|
|
|
|
|
$_GET is for retrieving variables from the query-string; and the parameter is the name of the variable to retrieve, not the URL of the page that sent the data.
You would normally use $_POST to retrieve values from a posted form. But in this case, you're submitting a JSON string instead of a form.
This StackOverflow answer should help: rest - How to get body of a POST in php? - Stack Overflow[^]
$sendDB = file_get_contents('php://input');
$purchase = json_decode($sendDB);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks. Does it matter that I'm using this in Xampp. I try to print $purchase but nothing happens. Am I just being special. I understand that file_get_contents returns a string then json_decode returns an object.
|
|
|
|
|
I don't know - I don't use PHP or Xampp.
You could try echoing the raw request data to see if the JSON is being passed correctly:
echo file_get_contents( 'php://input' );
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sorry. It's because you said you don't use PHP so I thought it would be better to get someone who does.
I have echoed the raw request but it doesn't give anything, but the Javascript does return the callback function in the $.post. Yes I am using the file_get_contents('php://input'); that is actually returning nothing.
|
|
|
|
|
can anyone explain that how to define service interval why this needed for transfer in USB3 and above version?
|
|
|
|
|
|
That thread. 
|
|
|
|
|
Hi Everyone,
I have a application which needs to read a file of size 113MB and stores each row data into a class object which is in turn stored in a std::map<int, cmyclassobject="">. Running it in 32-bit 4 GB RAM , the "Out of Memory" error triggered. After a observation , I felt that the RAM is not sufficient, so now I tried it in 64-bit 8GB RAM system but still the same exception is thrown. Can anyone help me in finding what exactly might be problem and how it can be overcome?
Thanks in Advance!!
|
|
|
|
|
You should have posted this at C / C++ / MFC Discussion Boards[^] because it is C++ related.
What is the size of your CMyClassObject and how many items will be stored in the map?
I guess that the size of your object is quite large resulting in the out of memory error.
You might repost in the C++ forum and edit the post I'm replying to by adding a note that it has been reposted in the C++ forum.
When reposting please add the above information (number of items and object size).
|
|
|
|
|
Have you ever tried to open an mp3 song file in a Notepad? We couldn't understand song played through Notepad. We will have to use a different interface such mp3 player.
Similarly, to understand communication between 2 Artificial Intelligence Robots (the project closed by Facebook) we might need a new Interface. Could we create this new interface to understand the communication? Or may we simply ask them?
|
|
|
|
|
1. Notepad deals with simple text files. MP3 music files have a specific format and most of the content is in binary. Google for mp3 and you will find lots of information.
2. Ask them.
|
|
|
|
|
Thanks for accepting and replying
My question suggests to create a new interface. Doesn't it?
When this topic would be deleted?
|
|
|
|
|
INDtanay wrote: My question suggests Your question is not clear. Please explain exactly what problem you are trying to solve.
|
|
|
|
|
Facebook closed the project of 2 AI Bots communicating in a language the researchers couldn't understand. The researchers might be doing the wrong way. They might be using a technology that would be incompatible to the advanced AI technique (Or say, using a notepad to understand mp3). Need for new interface.
|
|
|
|
|
|
So I'm optimizing this apps network usage. The json return looks like this:
"prop":{
"Status":"Success"
...
}
My manager insists on:
"prop": "Success"
he saw it on vs2017's package catalog.
Anybody knows anything about this?
____________________________________________________________________________________________________
"The only way of discovering the limits of the possible is to venture a little way past them into the impossible" Arthur C. Clarke
|
|
|
|
|
Please don't post in this forum. If you've posted in this forum it's because you've selected the first forum on the list without thinking through which forum would be best. All messages in this forum are periodically removed.
|
|
|
|
|
Graeme_Grant wrote: All messages in this forum are periodically removed.
Are you sure about that? There are messages here going back to 2012.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: Are you sure about that? There are messages here going back to 2012
Someone forgot to flip the "on" switch... 
|
|
|
|
|
how to insert a computed values in a table? please help me
|
|
|
|
|
There is a LAMP forum, please use that in future to ask questions related to PHP and MySQL.
Finally, the PHP framework uses MySQL majorly (but not always), and you would need to check how to integrate PHP and MySQL both and execute an INSERT INTO query to add the content to the table. So basically, there are 3 things that you need to learn.
1) PHP, for the scripting part.
2) MySQL, how would that work, how it supports everything.
3) SQL language, for queries and commands on MySQL.
Now, please read any good article on CodeProject to get started with PHP + MySQL and they will actually teach you all of it, otherwise, get started with snippets of code and work your own by reading some documentations.
How to Insert Data Into MySQL Database Table Using PHP - Tutorial Republic
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
dear expert,
I have been using Eclipse debugger very well until a few days ago it is not debugging anymore.
I have been able to use Eclipse debug until I tried out certain debugging features like using breakpoint on a class method.
Now, when I right click, debug as, debug on Server, eclipse is not debugging anymore.
Normally, if Eclipse works properly, in debug mode, execution may be suspended and resumed, variables may be inspected, and expressions may be evaluated.
But, now my Eclipse is not able to do it anymore.
I have tried refresh, clean project etc but it is just not helping.
I also tried removed all the breakpoints and then put the breakpoint on the lines I want to check, but still nothing works.
My recent attempt is uninstall Eclipse Mars and even with the new Eclipse Mars 2 it is still the same problem
Hope someone let me know how can I make Eclipse debug my java web app again. Tks.
|
|
|
|