get

Way to get and edit GET variables in order to make hyperlinks

萝らか妹 提交于 2019-12-09 12:41:26
问题 Let's say that I have URL like somefile.php?sort=id&way=desc . I want to write a function (or use already made one) that would let me add next variables to URL and set which I want to delete. I thought about something like function editGetVar("$add","$leave") where $add would be array with new variables to add to URL and $leave would be array with variables that must stay in URL. Example: somefile.php?sort=id&way=desc&buyer=retailer and I want to delete "buyer" and add "action", then the a

yii get post cookie session

我怕爱的太早我们不能终老 提交于 2019-12-09 11:38:37
获取GET/POST过来的数据 Yii::app()->request->getParam('id'); # $_GET['id'] or $_POST['id'] session/cookie $_SESSION 等价于 Yii::app()->session; //启动session $session=new CHttpSession; $session->open(); 写入session Yii::app()->session['key'] = 'value'; 读取session Yii::app()->session['key'] 获取sessionid Yii::app()->session->sessionID 销毁session Yii::app()->session->clear(); Yii::app->session->destory(); 2.2.1 设置cookie $cookie = new CHttpCookie(‘mycookie’,'this is my cookie’); $cookie->expire = time()+60*60*24*30; //有限期30天 Yii::app()->request->cookies['mycookie']=$cookie; 2.2.2 读取cookie $cookie = Yii::app()-

PHP $_REQUEST $_GET or $_POST

狂风中的少年 提交于 2019-12-09 10:57:59
问题 Say I have a form: <form action="form.php?redirect=false" method="post"> <input type="hidden" name="redirect" value="true" /> <input type="submit" /> </form> On form.php: var_dump($_GET['redirect']) // false var_dump($_POST['redirect']) // true var_dump($_REQUEST['redirect']) // true How do I get the injected query string parameter to override the $_POST value so $_REQUEST['redirect'] will = false ? 回答1: If you want to change precedence of $_GET over $_POST in the $_REQUEST array, change the

How to encrypt the $_GET data in php?

懵懂的女人 提交于 2019-12-09 08:02:36
问题 As in php we use $_GET to pass variables in the url , i want to pass variables which include the id of the user which i want to be anonymous, so can something be done which can encrypt the variable before passing it and the the variable once taken on the page can be decrypted to get the original variable value. for eg: Before passing variable $id=10; Passed in the url as $id=dasfgjg; when taken from the url and decrypted $id=10; How can this be achieved? 回答1: You can use an RC4 cipher if you

How to access android MMS resources such as video/audio etc?

假装没事ソ 提交于 2019-12-09 07:08:58
问题 I started developing an android app that have to interact with MMS attachements, in particular, get attachements such as text, bitmaps, audio, video etc. and store them on the phone in a specific folder. So i started reading some books and some post on the web but it isn't a very common argument, and i didn't find an official way to do what i want to do. I found a fairly good article here on stack-overflow here: How to Read MMS Data in Android?... it works very well for me, but there are 2

Synapse Delphi HTTPS SSL GET Request

拟墨画扇 提交于 2019-12-09 06:59:54
问题 Only a GET request to a HTTP url works. If i try to request a HTTPS url then it doesn't return anything. I pretty much tried everything. Appreciate any help. Here's my code: SynHttp.Sock.CreateWithSSL(TSSLOpenSSL); SynHttp.Sock.SSLDoConnect; SynHttp.HTTPMethod('GET', 'https://www.google.com/'); Resp.LoadFromStream(SynHttp.Document); HtmlResponse := Resp.Text; SynHTTP is a THTTPSend object. 回答1: Make sure: your exe application can access ssleay32.dll and libeay32.dll - the easiest way is to

Android GET and POST Request

天大地大妈咪最大 提交于 2019-12-09 04:08:35
问题 Can anyone point me to a good implementation of a way to send GET and POST Requests. They are alot of ways to do these, and i am looking for the best implementation. Secondly is there a generic way to send both these methods rather then using two different ways. After all the GET method merely has the params in the Query Strings, whereas the POST method uses the headers for the Params. Thanks. 回答1: You can use the HttpURLConnection class (in java.net) to send a POST or GET HTTP request. It is

HttpGet 401 status code followed by 200 status code

痴心易碎 提交于 2019-12-09 03:52:43
问题 I am facing a strange behaviour using the Apachage HttpComponent to access a webservice. I have access to the server log and when I am trying to connect to the server and execute the httpGet command I can see in the log at first a 401 status (http Unauthorized) and then a 200 (http OK). The 2 attempts take place during the "httpClient.execute(httpGet)" So I am searching how to avoid this behaviour. Any ideas ? Here is the following code I am currently using : HttpGet httpGet = new HttpGet

JavaScript's equivalent to PHP's __get() magic method [duplicate]

余生颓废 提交于 2019-12-09 02:35:00
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: JavaScript getter for all properties Does JavaScript provide a method to access undefined object properties? In PHP the solution is to declare and implement __get() method in class. Solutions using try { .. } catch { .. } are not sufficient for me, because I already have very large amount of code which actually needs to stay as-is. 回答1: You may choose to write a similar functionality and check existing

How to send securely passwords via GET/POST?

我怕爱的太早我们不能终老 提交于 2019-12-09 02:16:27
I want to send HTTPS request in Java and send password in GET or POST data. Is it secure? Can I just put password in POST/GET field as a plain text and that will be secured when I use https? Or should I do something more? The usual practice is to send your authentication username+password as the Base64 encoded Authorization header. Base64 encoding is not encryption. You still have to ensure it goes thro SSL/https. Base64 codec is a means to ensure that endianess and other idiosyncrasies of routers, switches, and other network intermediaries do not transform the password or any binary data to