get

PHP - get certain word from string

不想你离开。 提交于 2019-12-01 09:02:37
问题 If i have a string like this: $myString = "input/name/something"; How can i get the name to be echoed? Every string looks like that except that name and something could be different. 回答1: so the only thing you know is that : it starts after input it separated with forward slashes. > $strArray = explode('/',$myString); $name = $strArray[1]; $something = $strArray[2]; 回答2: If you only need "name" list(, $name, ) = explode('/', $myString); echo "name is '$name'"; If you want all, then list(

Multiple $_GET from a link parameters

北城以北 提交于 2019-12-01 08:48:53
I'm sending values to php file using js like that: validation.php?firstName=test?lastName=test?email=test?contactNumber=test?title=test?description=test And in validation.php I've created array with these values like that: $data[0] = $_GET['firstName']; $data[1] = $_GET['lastName']; $data[2] = $_GET['email']; $data[3] = $_GET['contactNumber']; $data[4] = $_GET['title']; $data[5] = $_GET['description']; unfortunately php returns me errors, why? Quentin ? indicates the start of a query string but key/value pairs within it are separated with & or (less commonly) ; . You need to separate them with

How to monitor an image source for fully loaded status

倖福魔咒の 提交于 2019-12-01 08:39:05
问题 I am loading a large number of images into a dynamic DIV and I am using a preloader to get the images. imageObj = new Image(); imageObj.src = imgpath + imgname; Each of these events creates a GET that I can see and monitor in Firebug. If I know the name and path of an image, can I watch the relevant XMLHttpRequest to see if the GET has completed? I do not want to rely on (or use) .onload events for this process. The pseudo would look something like this... if (imageObj.GET = 'complete') Has

Form Get Method: prevent empty fields from submittion in query string

北城余情 提交于 2019-12-01 08:15:54
问题 I am developing a search form. Search Form has 2 parts, First simple search with some select, input, and submit button. Second contains many select, check box, radio, input and submit button. I am using GET method as i want all fields in query string like. example.com/cars-parts/cars-for-sale/?country=205&city=19&cars_category=462 But the issue is if user don't select some fields(because he donot want to apply this criteria) a lot of empty fields and make query string too long. Problem: I

what is the benefit of get set for simple variables [duplicate]

落爺英雄遲暮 提交于 2019-12-01 08:07:46
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Public Fields versus Automatic Properties I figured this would be answered someplace, but I'm not finding it in the usual places. I was wondering, what is the benefit of doing this private int _foo; public int foo {get {return _foo;} set{_foo = value;}} or public int foo {get; set;} over just public int foo; I can see the benefit if more complex manipulation was required, but what is the benefit for a simple

Multiple $_GET from a link parameters

旧城冷巷雨未停 提交于 2019-12-01 07:49:02
问题 I'm sending values to php file using js like that: validation.php?firstName=test?lastName=test?email=test?contactNumber=test?title=test?description=test And in validation.php I've created array with these values like that: $data[0] = $_GET['firstName']; $data[1] = $_GET['lastName']; $data[2] = $_GET['email']; $data[3] = $_GET['contactNumber']; $data[4] = $_GET['title']; $data[5] = $_GET['description']; unfortunately php returns me errors, why? 回答1: ? indicates the start of a query string but

get a # from a url in php

那年仲夏 提交于 2019-12-01 06:40:40
问题 I'm trying to code with the facebook API here it says : http://developers.facebook.com/docs/authentication/javascript to get the access_token thing, but it's after a # and not a ? so how can I get it ? http://www.example.com/callback#access_token=...&expires_in=... 回答1: You won't be able to do it in PHP - you can only access it in javascript - the fragment/hash never reaches the server, it is processed by the browser in Javascript, you can access the fragment using window.location.hash 回答2:

PHP - include() file not working when variables are put in url?

冷暖自知 提交于 2019-12-01 06:30:41
In PHP I've build a webpage that uses include() for loading parts of the website. However, I now ran into something like a problem: When I use an url like: data-openov-storingen.php?type=actueel It gives me this error: Warning: include(data-storingen.php?type=actueel): failed to open stream: No such file or directory in blablabla Is it even possible to pass get variables in an include() url? The include() function does not access the file via HTTP, it accesses the file through the OS's own file system. So GET variables are not counted. (as they are not part of the file name). In layman's terms

Using htaccess rewrite/redirect so single PHP file can display data according to GET/POST variables

Deadly 提交于 2019-12-01 06:02:56
Bear with me as I try to learn more about .htaccess redirect rules - I'm a UI guy by profession and I'm doing my best to enhance my coding skills languages other than HTML/CSS/PHP, etc So, what I have is an index.php file that contains a menu - pretty simple. If Javascript is enabled on the users computer then forms are shown below the menu using simple jQuery goodies, with each link having a 'return false;' applied. What I am trying to do is make the page accessible with JS turned off, so instead of redirecting the user to a different page, I would like to use POST or GET variables from each

Https request, authentication in Android

淺唱寂寞╮ 提交于 2019-12-01 06:01:55
I am currently trying to authenticate with a server via a http Get call. The code provided below works when compiled in a java project. Returning the correct token to the program. However whenever I try to implement the same code in Android I do not get a token returned via the Get call. In Android I am returning inputLine in a function, however inputLine is always an empty string. The system.out.println() prints the returned token. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import javax.net.ssl