get

php object : get value of attribute by computed name

hi simple question - How do I access an attribute of an object by name, if i compute the name at runtime? Ie. i loop over keys and want to get each value of the attributes "field_".$key In python there is getattribute(myobject, attrname) It works, of course, with eval("$val=$myobject->".$myattr.";"); but IMO this is ugly!! TIA fl...

jQuery and AJAX what should I use?

Hello, I've decided to go with jQuery for all my AJAX related client side needs. But jQuery has way too many functions for the same task: $.post, $.get, $.ajax, $.getJSON... My question is what should I use? EDIT: I'm going to use POST and JSON to connect to CodeIgniter PHP framework. Thank you. ...

Double-byte characters in querystring using PHP

I'm trying to figure out how to create personalized urls for double-byte languages. For example, this url from Amazon Japan has Japanese characters within the querystring (specifically, the path): http://www.amazon.co.jp/風の谷のナウシカ-DVD-宮崎駿/dp/B00005R5J3/ref=sr_1_3?ie=UTF8&s=dvd&qid=1269891925&sr=8-3 What I would like to do ...

keep params and add another from a form

Hey Guys, I have the following 3 urls: http://www.test.com?a=1 http://www.test.com?a=1&amp;b=3 http://www.test.com?a=1&amp;b=2&amp;c=99 Now in a form i have a drop down menu like so: <select name="b"> <option value="1">1</option> ... </select> Now i want to either add that param to the list of existing params or edit th...

PHP: passing GET between multiple pages

I'm building a set of pages where I have a number of GET variables and it is often valuable to keep passing it along to the next page. This leads to ugly code where I have to have "if this $_GET variable is set, dynamically add it to this hyperlink". This is, in many senses, not a problem; but I had the thought "there must be a better wa...

How to create PHP post\get API (EAZY LAZY and PROTECTED way)?

How to create PHP post\get API? So tooday I have crapy mix of PHP and HTML and JS. I need to open some of functions I use in my site to Developers so thay will be able to use my site data in their APP's. What is the EAZY LAZY and PROTECTED at the same time way to do such thing? ...

get GET parameters in JSF's managed bean

Hello! Can someone tell me how to catch parameters passed from URI in JSF's managed bean? I have a navigation menu all nodes of which link to some navigation case. And i have two similar items there: Acquiring products and Issuing products. They have the same page but one different parameter: productType. I try to set it just by adding...

Getting two variables in the URL with htaccess

What way it is to be to get two GET methods in the URL by htaccess? RewriteRule ^adm/(.*)$ adm.php?mode=$1 I've used that for the example URL: http://www.domain.com/adm/thismode Now I want to get two methods like: http://www.domain.com/adm/thismode/othermode I've tried this: RewriteRule ^adm/(.*)$/(.*)$ adm.php?mode=$1&othermod...

Having trouble setting up API call using array of parameters

I am building a class to send API calls to Rapidshare and return the results of said call. Here's how I want the call to be done: $rs = new rs(); $params = array( 'sub' => 'listfiles_v1', 'type' => 'prem', 'login' => '10347455', 'password' => 'not_real_pass', 'realfolder' => '0', 'fields' => 'filen...

How to get a cell value in JQGrid?

How to get a cell value in JQGrid? If I use the following syntax – var ret = jQuery("#MyGrid").jqGrid('getRowData', id); ret = ret.ProductId; it returns the following HTML. 'input class="editable" name=" ProductId " id="0_ ProductId " style="width: 98%;" type="text"' I actually need the value of the cell. Thanks. Dev ...

PHP - ftp_get only works once

I'm connecting to an ftp server that I have no control over, and I'm pretty sure is using something old and outdated due to other issues I've run into. I'm simply using this code in a loop to get all the files in a directory. ftp_get($this->conn_id, $remote, $local, FTP_ASCII); The first time all goes well, but after that I get this ...

.htaccess add hidden php get variable for language selection

I have a multiple language website, and I use a php get variable to set the cookie for the language setting. I have multiple subfolders (http://www.site.com/es and http://www.site.com/de) that each have a respective .htaccess file. When accessing these folders, the .htaccess file does this to "silently" redirect the user and add the ap...

Question about a http form GET method, using query arguments

I am looking at a bug in WebSVN where when I get into a file log and click on compare, it looses the repository name as part of the request. The details are unimportant. However, I've tracked down the bug to a http form that looks like this: <form method="get" action="comp.php?repname=Binaries&amp;" id="compare"> .... <input type="...

PHP: How to check if query string or POST vars contain same var twice

It may sound strange, but in my PHP application I need to check if the same variable name has been declared more than once in the query string or POST variables, and return an error value if this is the case. If my application doesn't return an error in this case, it fails a compliance check. When accessing vars using $_GET, $_POST, et...

Storing Data from both POST variables and GET parameters

I want my python script to simultaneously accept POST variables and query string variables from the web address. The script has code : form = cgi.FieldStorage() print form However, this only captures the post variables and no query variables from the web address. Is there a way to do this? Thanks, Ali ...

Submit HTML form with GET method with full action path

Hello. I am trying to submit a form with method GET and action "index.php?id=3". The problem is that it jumps to the url specified but it cuts off "?id=3" part. I need that so I can identify an user. Any ideas on how I could submit the whole url ? I don't want to change this method, by design is much complex than I told you here. It's a ...

Fast, easy, and secure method to perform DB actions with GET

Hey All, Sort of a methods/best practices question here that I am sure has been addressed, yet I can't find a solution based on the vague search terms I enter. I know starting off the question with "Fast and easy" will probably draw out a few sighs, so my apologies. Here is the deal. I have a logged in area where an ADMIN can do a wh...

Keep username in username field when incorrect password (php)

How do many of the websites that have logins keep the username in the username field when the password is entered incorrectly. The form's action (it is on index.php) is another php file, which if the password is incorrect uses Header() to go back to the index and passes the error to it using GET. I could use GET to pass the username back...

Jquery.get cannot retrieve XML from RESTful Service

I'm trying to get an XML document from a REST service using the Jquery get method, but it doesn't seem to be able to download. After only about 11 seconds, the connection dies and I receive a blank document. I've tested out the URL by accessing it through the browser, and it works (even though it takes 4 minutes to load). $(document).re...

How do I prevent the GET method from encoding HTML special characters in the URI?

I have a form using the GET method. If values are submitted with special characters, they appear in the URI as: ?value=fudge%20and%20stuff How do I make it clean? I don't want to use the header function because this is happening within a page in drupal. ...