get

how to loop through a set of GET values in php

大城市里の小女人 提交于 2019-12-02 07:44:06
I'm making a simple online store like program. What can you suggest that I would do so that I can loop through the inputs I've made in my program. I'm still using get so that I could see how the data looks like, I'll change it to post later. This is what the url looks like, when I commit the buying of all the products added in the cart: http://localhost/pos/php/checkout.php?ids=2;&qoh=12;&qbuys=&ids=6;&qoh=2304;&qbuys=304&ids=4;&qoh=699;&qbuys=99 This is the code that I'm using to commit only one product, it doesn't work when I had something like in the above url: <?php $id=$_GET['ids'];

How to get posts that user's friend posted on the wall of user on his birthday through Facebook Graph Api?

ⅰ亾dé卋堺 提交于 2019-12-02 07:35:39
I am trying to build a Chrome extension and I want to get all the posts that people posted on the user's wall specifically on his birthday. I tried to call through Facebook Javascript SDK, but it is not returning the posts that are posted by my friends on the birthday. FB.api( '/me/feed', 'GET', {}, function(response) { // Insert your code here } ); Rather, it is returning all the birthday posts in one post like this: { "message": "Belated happy birthday bhaiii.....", "created_time": "2015-10-19T00:02:02+0000", "id": "578828115566706_848912165224965" }, { "story": "Ritwik Jain and 40 others

Encode Base64 in JavaScript, send with GET, decode in PHP

北城以北 提交于 2019-12-02 07:25:58
问题 I thought this will be an easy Google-search, but it seems that my technique is not as common as I thought. How can I encode a Base64 string in JavaScript, in order to put it safely on the line with a GET parameter (my Base64 string contains a lot of / , + and = , and decode the exact same string in PHP, in order to store it in a database? When I post the Base64 string without encoding, my PHP script does not accept it. I found a solution for encoding and decoding the Base64 string in

Shorten URL by removing empty GET variables and simplifying variable names

余生长醉 提交于 2019-12-02 07:22:46
I am working on a website where an URL is composed after submitting a GET form . The form values are passed as an array of variables of which at least one must be defined for the search on the database to work. I would like to shorten the URL by removing the empty form elements and to make it more user-friendly by simplifying the variable names . At the moment, the URL looks like this (just with a lot more variables): http://localhost/example/search?FormName[name]=lorem+ipsum&FormName[id]=&FormName[age]=&yt0=Search I aim to make it look like this: http://localhost/example/search?name=lorem

How to properly pass form data in php?

纵饮孤独 提交于 2019-12-02 07:21:32
I'm using php to build a small form that requires passing 2 variables for processing. I got the example off w3schools and although the info gets passed in the URL, the php form doesn't process it in any way (let alone extract it). I'm just wondering if there might be anything wrong with my WAMP server. <html> <body> welcome Welcome <?php echo $_GET["fname"]; ?>.<br /> You are <?php echo $_GET["age"]; ?> years old! </body> </html> HTML form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org

Node JS Express Handling multiple requests

China☆狼群 提交于 2019-12-02 07:14:29
问题 What I Have: I have a nodejs express server get endpoint that in turn calls other APIs that are time consuming(say about 2 seconds). I have called this function with a callback such that the res.send is triggered as a part of the call back. The res.send object packs an object that will be created after the results from these time consuming API calls is performed. So my res.send can only be sent when I have the entire information from the API call. Some representative code. someFunctionCall

is response.redirect always an http GET response?

本秂侑毒 提交于 2019-12-02 07:14:07
is response.redirect always an http GET response? or it could be POST?.... In most API's the standard redirect implementation does a 302 which is indeed per definition GET. As per your question history you're familiar with ASP.NET, I'll however add examples for Java Servlets as well. ASP.NET: Response.Redirect("http://google.com"); Servlet: response.sendRedirect("http://google.com"); It implicitly sets the response status to 302 and the Location header to the given URL. When the current request is a POST request and you want to redirect with POST, then you need a 307 redirect. This is not

Form input array $_GET comma separated in URL

旧街凉风 提交于 2019-12-02 07:11:41
I have a form: <form action="results.php" method="get"> <select name="genres[]"> <option value="jazz"></option> <option value="blues"></option> <option value="rock"></option> </select> </form> After submitting the form, in the URL the input becomes example.com/?genres%5B%5D=jazz&genres%5B%5D=blues&genres%5B%5D=rock Next to that it doesn't look very nice, I have multiple inputs in my form (and around 18 genres) so if a user selects a lot, the URL becomes very long. I'd like it to become /?genres=jazz,blues,rock Now I've read this post , but it doesn't state how to make the cleaner URL. Next to

Shorten URL by removing empty GET variables and simplifying variable names

不羁岁月 提交于 2019-12-02 06:54:12
问题 I am working on a website where an URL is composed after submitting a GET form . The form values are passed as an array of variables of which at least one must be defined for the search on the database to work. I would like to shorten the URL by removing the empty form elements and to make it more user-friendly by simplifying the variable names . At the moment, the URL looks like this (just with a lot more variables): http://localhost/example/search?FormName[name]=lorem+ipsum&FormName[id]=

not getting integer value from SharedPreference

空扰寡人 提交于 2019-12-02 06:40:27
问题 I am trying to store user id in SharedPreference in one activity and want to get this integer id in any activity. To put this value in Shared Preference i use following code. SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_WORLD_READABLE); SharedPreferences.Editor prefsEditor = myPrefs.edit(); prefsEditor.putInt("userId", varaible); prefsEditor.commit(); Then i am trying to get this value, i use following code for this SharedPreferences myPrefs = getSharedPreferences("myPrefs