get

Replacing backslash with another symbol in PHP

余生颓废 提交于 2019-12-01 21:35:42
Been struggling with replacing a backslash by another symbol such as '.-.' just to indicate the position of backslashes as I could not send a string such as 'C\xampp\etc.' through url as GET variable so I thought I'd first replace the backslashes in that string by another symbol, then send through url, and then replace them back to backslashes in the PHP file that handles it. Though would there be a better way to send such strings through url? Because when I try a script such as: $tmp_name = preg_replace("\", ".-.", $_FILES['uploadfile']['tmp_name']); It turns out into a php error as \ is also

Flex 3: Getting variables from URL

别说谁变了你拦得住时间么 提交于 2019-12-01 21:11:37
If I have an application located at http://sitename.com/myapp/ and i want to pass in a variable via the url (i.e. - http://sitename.com/myapp/?name=Joe ), how can I get that name variable into a string var? I use the class Adobe provided in this article . package { import flash.external.*; import flash.utils.*; public class QueryString { private var _queryString:String; private var _all:String; private var _params:Object; public function get queryString():String { return _queryString; } public function get url():String { return _all; } public function get parameters():Object { return _params;

How do i make $_GET more secure.?

主宰稳场 提交于 2019-12-01 21:06:41
I am using the get method to perform some operation like, approve, markasspam, delete, for commenting system. i know it is highly insecure to go this way but i cannot help it out. because the reason for using $_GET method is to perform the operation within the page itself using PHP_SELF, and FYI i am using the post method using checkbox to perform the operation too. now for making it bit secure i want to randomize the number or generate the hash or something and then compare it, get the id and perform the operation my current code is somewhat like this. <?php if($approve == 1 ) { ?> <a href="<

Can you use $_GET variables when including a file in PHP? Is it possible, even from an AJAX call?

陌路散爱 提交于 2019-12-01 20:54:44
I have a PHP file that handles sending out confirmation emails. I also have a calendar that I use AJAX to do various updates. When AJAX calls the update file, it updates the database with the new information, and I want confirmation emails to be sent out. So from inside the php file that the AJAX calls, I figured I should include("email-sender.php?stage=confirm2a&job={$slot->job_id} which calls the email php page, with the $_GET variables that tell it which emails to send and to who. But for some reason, I can't get the include to work when you use ?key=value $_GET pairs attached to the string

get full html source code of page through ajax request through javascript

雨燕双飞 提交于 2019-12-01 20:30:54
The javascript code will be launched from www.example.com through the url bar in google chrome so i cannot make use of jquery. My goal is to pass the full html source code of www.example.com/page.html to a variable in javascript when i launch the code in www.example.com. Is this possible? If so how? I know to get the current page source it's just document.documentElement.outerHTML but i'm not sure how i'd do this. I think it's possible by using responseText somewhere in the following code: http.send(params); var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","http://www.example.com/page

How to read $_GET variables with (mod rewrite powered) nice URLs

不打扰是莪最后的温柔 提交于 2019-12-01 20:08:29
Hello fellow programmers, I'm using nice URLs the first time and I can't quite find out why I can't read my oAuth responses from my script. So this is my setup: .htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] I have a script that uses googles oAuth system to log in a user. This script sends the user to the google api page where they can allow my website to read their email adress and then send the user right back to my site with lots of $_GET variables. I tell google to send it to http://mywebsite/login/google

Sending a large parametrized data set as a GET request

一个人想着一个人 提交于 2019-12-01 19:59:42
What's the best way to send a large data set via a GET request. I cannot use POST because of some design limitations. I can use jQuery or any other library, sizzle is preferable. I have a complex data set that has nestings within it, and json fits the bill well. Thanks for your help. GET requests shouldn't exceed 1-4 kilobytes in size due to browser and server limitations. You would have to split your request in chunks to do this. If the data comes from a form, you could, for example utilize jQuery's .serialize() function to put the data into one string. Then split the string into kilobyte

Mod_rewrite and $_GET variables

本秂侑毒 提交于 2019-12-01 19:55:59
If I am mod_rewriting a URL from: http://www.mysite.com/blog/this-is-my-title/1/ to http://www.mysite.com/blog.php?title=this-is-my-title&id=1 ...is it possible then to arbitrarily attach a get value on to the URL later, or does the mod_rewrite throw it off? MY REWRITE RULE: RewriteRule ^blog/([A-Za-z]+)/(0-9]+)/? blog?title=$1&id=$2 [L] EXAMPLE: can i go http://www.mysite.com/blog/this-is-my-title/1/?first=Johnnie&last=Wiggles which would essentially mean http://www.mysite.com/blog.php?title=this-is-my-title&id=1&first=Johnnie&last=Wiggles I would think that should work, but for some reason

jQuery add class to object with .get() method

巧了我就是萌 提交于 2019-12-01 17:57:14
running into a weird thing and I'm not sure what's going on. I've grabbed the index of a DOM element via .index() , found a matching element via .get() and I'm trying to add a class to it via .addClass() . My console is returning the error: " Uncaught TypeError: Object #<HTMLLIElement> has no method 'addClass' "... which is especially odd because my Log shows the HTML element just fine (http://cloud.dhut.ch/image/2W3S0R3k2h2U) Am I missing something? It's not returning in an array or anything. Confused. Thanks! JavaScript: nFLi.get(active).addClass('active') ; You need to wrap it into a jquery

What's wrong with putting spaces in $_GET variables

不问归期 提交于 2019-12-01 17:52:05
If I for example have my url looking like index.php?category=IT%20&%20Soft. Then i try to print "$_GET[category]" i only get "IT" and not "IT & Soft". What is wrong here? It's frustrating me. The problem is not the spaces, but the ampersand. Use %26 instead, like this: index.php?category=IT%20%26%20Soft The ampersand indicates that you are beginning another field (like category=IT&subcategory=somethingelse ). You can see a list of reserved characters on Wikipedia . Spaces and ampersands (&) aren't valid and need to be encoded for use in parameter values. Run your arguments through 'urlencode'