get

hide variables passed in URL

梦想的初衷 提交于 2019-11-30 20:08:43
We've been working on a web application and we've just about got it finished up, but there's one thing that bothering us (although by no means is it going to stop production.) When we call one of the pages (index.html), we sometimes have to pass it a variable in the URL (searchid). So we get a page like http://domain.com/index.html?searchid=string . We'd ideally like to not show the ?searchid=string , but I'm not sure how we'd do that. My group doesn't own the index.html page (but we are working with the group that does), so I don't know how much we'd be able to do with anything like .htaccess

MYSQLI query to get one single result [duplicate]

我与影子孤独终老i 提交于 2019-11-30 20:07:27
问题 This question already has answers here : Single Value Mysqli (8 answers) Closed last year . I need to get only the id of member who's username is X from the mysql database. Can this only be done with a while loop or is there any other way around this? What I'm thinking of is something like: $id = mysqli_query($con,'SELECT id FROM membrs WHERE username = '$username' LIMIT 1) Thanks, 回答1: You can use: mysqli_fetch_array(); // For Instance $id_get = mysqli_query($con, "SELECT id FROM membrs

jquery $.GET parameters passing in the url

青春壹個敷衍的年華 提交于 2019-11-30 20:06:58
this is a general-purpose way to make GET requests with Jquery: var loadUrl="mypage.php"; $("#get").click(function(){ $("#result").html(ajax_load); $.get( loadUrl, {language: "php", version: 5}, function(responseText){ $("#result").html(responseText); }, "html" ); }); I was wondering if I could pass parameters (Ex.language and version) directly in the Url(after urlencoding them): var loadUrl="mypage.php?language=php&version=5"; $("#get").click(function(){ $("#result").html(ajax_load); $.get( loadUrl, function(responseText){ $("#result").html(responseText); }, "html" ); }); Is that possible?

Encapsulation C# newbie

巧了我就是萌 提交于 2019-11-30 18:56:42
问题 New to C#, and I understand that encapsulation is just a way of "protecting data". But I am still unclear. I thought that the point of get and set accessors were to add tests within those methods to check to see if parameters meet certain criteria, before allowing an external function to get and set anything, like this: private string myName; public string MyName;// this is a property, speical to c#, which sets the backing field. private string myName = "mary";// the backing field. public

GET request with Basic Auth working from Postman but not from the browser

元气小坏坏 提交于 2019-11-30 18:46:15
问题 I'm working with an odata api, and when I'm using postman to do a GET request, works perfect and I get the response as I was expecting. But when I use a fetch request from my React app, the request throws a 401, using the same headers as I previously used in Postman. and it says that Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The

Curl : * Violate RFC 2616/10.3.2 and switch from POST to GET

杀马特。学长 韩版系。学妹 提交于 2019-11-30 18:45:38
问题 I'm using curl to post to a script. curl_setopt ($ch, CURLOPT_POST, true); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0); But there's 301 redirect involved which casues curl to switch from POST to GET. HTTP/1.1 301 Moved Permanently < Location:

Passing multiple variables in URL using codeigniter

僤鯓⒐⒋嵵緔 提交于 2019-11-30 18:20:47
sorry to bother but I was hoping someone could help me out with a quite mundane issue that I am having within CI. I am able to send a variable via the URL using CI's examples eg: http://localhost/project/main/getproduct/24 within the getproduct() method of my main controller I can get the variable sent 24, without an issue. however I now want to pass two variables via the URL, but I have no idea how to do this or whether CodeIgniter will allow me to do this. could someone please show me how to pass 2 variables in CI and a method that can retrieve them I have tried: http://localhost/project

std::get using enum class as template argument

南笙酒味 提交于 2019-11-30 18:06:21
I'm using a std::tuple and defined a class enum to somehow "naming" each of the tuple's fields, forgetting about their actual indexes. So instead of doing this: std::tuple<A,B> tup; /* ... */ std::get<0>(tup) = bleh; // was it 0, or 1? I did this: enum class Something { MY_INDEX_NAME = 0, OTHER_INDEX_NAME }; std::tuple<A,B> tup; /* ... */ std::get<Something::MY_INDEX_NAME> = 0; // I don't mind the actual index... The problem is that, as this compiled using gcc 4.5.2, I've now installed the 4.6.1 version, and my project failed to compile. This snippet reproduces the error: #include <tuple>

Why should I POST data rather than GET?

ε祈祈猫儿з 提交于 2019-11-30 17:58:28
I know you don't want to POST a form with a username and password where anyone could use the history to see or situations where repeat actions may not be desired (refreshing a page = adding an item to a cart may not be desired). So I have an understanding when I may want to use one over the other. But I could always have the server redirect the URL after a GET to get around the cart problem and maybe most of my forms will work perfectly fine with GET. Why should I use POST over GET? I don't understand the benefits of one over the other. I do notice POST doesn't add data to the history/URL and

Express.js: how to make app.get('/[:userId]i'..) in req.param?

扶醉桌前 提交于 2019-11-30 17:43:35
问题 I m using nodejs 0.8.21 and express 3.1.0 I need to read userId from url like http://mysite.com/39i . It means userId=39 . How to do? Thank you. Sample: app.get('/:userId_i', function(req, res) { }); app.param('userId', function(req, res, next, id){ }); 回答1: Assuming you have a numerical id followed by an i and you want the id coming back as just the numerical. app.get("/:id([0-9]+)i", function (req, res) {...}); This will match a numeric followed by an i and will give you just the numeric in