get

htaccess mod rewrite $_GET to variables with slashes

…衆ロ難τιáo~ 提交于 2019-11-29 14:55:24
问题 I would like to rewrite URL's with htaccess to better readable URL's and use the $_GET variable in PHP I sometimes make use of a subdomain so it has to work with and without. Also are the variables not necessary in the url. I take a maximum of 3 variables in the URL the URL sub.mydomain.com/page/a/1/b/2/c/3 should lead to sub.mydomain.com/page.php?a=1&b=2&c=3 and the url sub.mydomain.com/a/1/b/2/c/3 should lead to sub.mydomain.com/index.php?a=1&b=2&c=3 where $_GET['a'] = 1 I came up with this

How to handle a get request with node.js (express)

给你一囗甜甜゛ 提交于 2019-11-29 14:52:09
I'm a node.js newbie and I'm creating my first big app with it (I'm using express). I need to have my webpage perform some javascript canvas-drawing when the user loads an id with a get request, e.g. www.mywebsite.com/page?id=22 I know I can handle this with a simple var express = require("express"); var app = express(); app.get('handle',function(request,response){ //request.id }); but I don't know how to start my webpage with the asked drawing for that id. Every tutorial on the internet on express and get explains how to handle get requests... well this question is about "what happens next?"

$_GET is empty when the url has variables

一笑奈何 提交于 2019-11-29 14:47:57
I have a url that look like this reg.php?lang=no_NO&passkey=test and im trying to get the passkey variable, but it keeps showing up blank. When I try print_r($_GET); it prints Array ( ) ?! How can this happen? The site look something like this <?php print_r($_GET); include('..\libs\Smarty.class.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Activate account</title> (...html code.. )

Setting authorization header in axios

隐身守侯 提交于 2019-11-29 14:44:09
I have been trying to make a GET request to the National Park Service API with axios and have tried several ways to set my API key in the request header to no avail. Any assistance will be greatly appreciated. I have tried: axios.defaults.headers.common['Authorization'] = "MY-API-KEY"; axios.get('https://developer.nps.gov/api/v0/parks?parkCode=yell') .then((resp) => { console.dir(resp); }); and let config = {'Authorization': 'MY-API-KEY'}; axios.get('https://developer.nps.gov/api/v0/parks?parkCode=yell', config) .then((resp) => { console.dir(resp); }); and both return a 401. It works when I

StackOverflow Exception from get and set

本秂侑毒 提交于 2019-11-29 14:43:18
I have the following code: namespace QuantStrats { class Program { static void Main(string[] args) { string FilePath = "C:\\Users\\files\\DJ.csv"; StreamReader streamReader = new StreamReader(FilePath); string line; List<Data> Data = new List<Data>(); while ((line = streamReader.ReadLine()) != null) { Data Tick = new Data(); string [] values = line.Split(','); Tick.SetFields(values[1], values[2]); Data.Add(Tick); } for (int ii = 0; ii < Data.Count; ii++) { Data TickDataValues = new Data(); TickDataValues = Data[ii]; Console.Write("TIME :" + TickDataValues.time + " Price : " + TickDataValues

Property 'data' does not exist on type 'HttpEvent<Customer>'

流过昼夜 提交于 2019-11-29 14:26:45
I have a setup like this api.service (wraps the httpClient Module) customer.service the api service get looks like this: get<T>(url: string, options?) { return this.httpClient.get<T>(this.apiUrl + url, this.getOptions(options));} in my customer.service I have: private fetchCustomer(access_token: String): Observable<Customer> { const options = { headers: new HttpHeaders({ Authorization: 'Bearer ' + access_token }) }; return this.http .get<Customer>('customers/me', options) .map(res => { const customer = res.data; customer.access_token = access_token; return customer; }) .catch(this.handleError

Difference between two approaches to pass parameters to web server?

本秂侑毒 提交于 2019-11-29 12:38:49
I am writing my web server and suddenly this question came into my mind. There are two ways to pass parameters via a GET method. First is to user get parameters, such as url/?para=var or so. But I can also hard write this parameter in URL as long as my backend parser knows it, like url/<parameter>/ . What's the difference between those methods and which is better? Path parameters Use path parameters when the parameter identifies a specific entity. For example, consider a blog. The URL /blog/posts returns a collection with all posts available in the blog. To find the blog post with the

Dynamically filter ListView CBV in Django 1.7

半腔热情 提交于 2019-11-29 12:37:37
问题 I've read the official documentation on dynamically filtering ListView, but am still confused about how to actually use it. I currently have a simple model, let's call it Scholarship : class Scholarship(models.Model): title = models.CharField(max_length=255) submitted_date = models.DateField(auto_now=True, verbose_name='Date Submitted') EXPERIENCE_LEVEL_CHOICES = ( ('A', 'Any'), ('S', 'Student'), ('G', 'Graduate') ) experience_level = models.CharField(max_length=1, choices=EXPERIENCE_LEVEL

Load mysqli php data via ajax call

被刻印的时光 ゝ 提交于 2019-11-29 12:34:01
What I'm trying to do is calling some database data via ajax and php. But the ajax call doesn't work, and I can't find out a solution on the web. So here is my code: test.php <?php include_once 'db_class.php'; $cat = $_GET['cat']; $dbconn = new dbconn('localhost', 'root', 'somepsw', 'blog'); $dbconn->set_query("select * from posts where category = '".$cat."'"); echo '<br/>'.$dbconn->query.'<br/>'; $result = $dbconn->result; $num = $dbconn->num_results; $array = mysqli_fetch_assoc($result); echo json_encode($array); ?> If i type that url on browser: http://127.0.0.1:82/blog/ws/test.php?cat=css

How can I do <form method=“get”> in ASP.Net for a search form?

陌路散爱 提交于 2019-11-29 12:06:58
问题 I have a search form in an app I'm currently developing, and I would like for it to be the equivalent of method="GET" . Thus, when clicking the search button, the user goes to search.aspx?q=the+query+he+entered The reason I want this is simply bookmarkable URLs, plus it feels cleaner to do it this way. I also don't want the viewstate hidden field value appended to the URL either. The best I could come up with for this is: Capture the server-side click event of the button and Response.Redirect