get

Get redirected url in perl

人盡茶涼 提交于 2019-12-04 04:50:01
问题 I want to get last of redirect URL. like url_1 : http://on.fb.me/4VGeu url_2 : https://www.facebook.com/ I want to get url_2 by url_1 in perl. Previous source is below. sub get_redirect_location { my ($url) = @_; my $ua = LWP::UserAgent->new; $ua->proxy('http', 'SAMPLE_PROXY'); my $req = new HTTP::Request(GET => $url); my $res = $ua->request($req); return $res->headers_as_string; } Thanks in advance. 回答1: You can find the request that lead to a response using $response->request() You can get

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

亡梦爱人 提交于 2019-12-04 04:12:48
问题 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

Passing value to JS function through URL on window load

强颜欢笑 提交于 2019-12-04 04:03:38
问题 my page http://www.dinomuhic.com/2010/index.php loads the Showreel at the start of the page using an onLoad call in body like this: <body onLoad="sndReq('96')"> 96 is the ID of the showreel in the SQL Library. The JS function "sndReq" is an AJAX call using JQuery which opens the requested item and displays it in the main window. Now my question: What if I want to send a link to a client which opens a specific item directly so he does not have to navigate through the site? Something like http:

Mod_rewrite and $_GET variables

二次信任 提交于 2019-12-04 03:57:03
问题 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

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

北慕城南 提交于 2019-12-04 03:37:53
问题 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

jQuery add class to object with .get() method

扶醉桌前 提交于 2019-12-04 03:29:40
问题 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

Why is using a HTTP GET to update state on the server in a RESTful call incorrect?

霸气de小男生 提交于 2019-12-04 03:05:25
问题 OK, I know already all the reasons on paper why I should not use a HTTP GET when making a RESTful call to update the state of something on the server. Thus returning possibly different data each time. And I know this is wrong for the following 'on paper' reasons: HTTP GET calls should be idempotent N > 0 calls should always GET the same data back Violates HTTP spec HTTP GET call is typically read-only And I am sure there are more reasons. But I need a concrete simple example for justification

Facebook SDK doesn't load…all.js GET failing

為{幸葍}努か 提交于 2019-12-04 02:55:56
I'm using the same code provided in the here <div id="fb-root"></div> <script> window.fbAsyncInit = function() { console.log('got here'); FB.init({ appId : '197112467099018', // App ID channelUrl : '//WWW.MYDOMAIN.COM/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // Additional initialization code here }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d

“Error using get” using a 'addlistener' function in Matlab GUI

纵饮孤独 提交于 2019-12-04 02:44:45
问题 I have a problem in a Matlab GUI code. Let say for instance that I want to display in the console the value of a slider cursor in the GUI. But the fact is that I want to display it in real time, eg at each position of the cursor even if the click is still on, while moving it. For this, I read on internet that the 'addlistener' function could help me. I put it in the slider_CreateFcn function like this : function slider1_CreateFcn(hObject, eventdata, handles) h=addlistener(hObject,'Value',

Appending GET parameters to URL from <form> action

雨燕双飞 提交于 2019-12-04 02:13:44
问题 So say I'm currently on index.php or index.php?p=about within my current web build. I am trying to build a search form that will be displayed on most pages, but I want the form action to go to http://mywebsiteurl.com/?p=search&q=GETDATA, as my website's paging depends on the data passed to the 'p' attribute. How would I append the search parameter to the URL in a static fashion, upon submission? 回答1: Perhaps something like this: <form method="get" action="index.php"> <input type="hidden" name