get

How to protect against input arrays

白昼怎懂夜的黑 提交于 2019-12-24 08:08:13
问题 I have a program. It accepts an input of a alphanumeric string (which I already do checks for). So a valid input would be www.example.com/myfile.php?input=John1 However, if someone were to type in www.example.com/myfile.php?input[] then it breaks my entire program's logic breaks because I don't accept input as an array. How can I unsure the thing a user enters is just a string. Not an array, or any other data types/structures? 回答1: There is the slow and tedious way of solving this problem,

How to get the Style.BackColor of a datagridview cell

假如想象 提交于 2019-12-24 07:39:13
问题 Using VS2010 VB.NET, I have a datagridview (dgv) where I set the background color of cells according to a certain value. This particular cell does not store any information and therefore I can not use the data in that cell to determine the background color. My current attempts are a complete failure and MSDN is only particular to "setting" and not "getting" the background color of a cell. Code I've tried" if dgvNotes.Rows(clickedCell.RowIndex).Cells(1).Style.BackColor.ToString = "Red" then if

JavaScript encode field without spoiling the display

坚强是说给别人听的谎言 提交于 2019-12-24 07:36:10
问题 I want to encode a specific search field before submitting as a $_GET request. What I am doing is to apply encodeURIComponent() function over that field before the form is submitted $('#frmMainSearch').submit(function() { var field = $(this).find('#searchinput'); field.val(encodeURIComponent(field.val())); }); the issue is that as soon as the text is encoded, the field displays the encoded text which looks a bit weird. Is there anything I can do to avoid it? Example: I type Hello & Hello .

PHP file not able to access $_GET variable after .htaccess rewrite rule

人走茶凉 提交于 2019-12-24 07:36:03
问题 I have a number of PHP pages with query strings in the URLs on my site. I'm trying to change the URLs for SEO, to do this I'm using an .htaccess file. I'm new to .htaccess so this is fairly basic and I'm not sure if I'm doing this right or if there is a better way to do it. My .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_URI} !/.css$ RewriteCond %{REQUEST_URI} !/.js$

call columns from inside a for loop in R

╄→尐↘猪︶ㄣ 提交于 2019-12-24 07:25:50
问题 I basically want to be capable to call columns from inside a for loop (in reality two nested for loops), using past() and i (j..) value of the loop to access my data frames columns wise in a flexible manner. #for the showcase I use the standard cars example r1 <- cars r2 <- cars # in case there are more data to consider I would want to add, ore remove further with out changing the rest # here I am entering the "dimension" of what I want to compare for the showcase its only one num_r <- 2

Passing sessions variables through an iframe, php

此生再无相见时 提交于 2019-12-24 06:58:33
问题 First timer to the site, not an overly experienced php programmer here :) I have a problem, i am using an iframe within a site which im attempting to use a session variable inside, firstly ive just been trying to display the session variable to make sure they are accessible from within the iframe: echo "session of productcheck ".$_SESSION['productcheck']." "; echo "session of productcheck1 ".$_SESSION['productcheck1']." "; echo "session of productcheck2 ".$_SESSION['productcheck2']." "; echo

Set/Get Web Cookies

这一生的挚爱 提交于 2019-12-24 06:37:18
问题 Assuming I am not running server side scripting of any kind, how can I set and get a cookie from within VBA code? 回答1: I saw a posting about this that might help for setting the cookie: link text Here is his code snippet: Sub test() Dim w As New WinHttp.WinHttpRequest Dim t As String, qs As String qs = "this=that&more=less" w.Open "POST", "http://www.comparity.net/perl/form.pl?a=b", False w.setRequestHeader "Cookie", "one=foo" w.setRequestHeader "Cookie", "two=bar" w.send qs t = w

Why does _GET in PHP wrongly decodes slash?

ε祈祈猫儿з 提交于 2019-12-24 03:36:06
问题 Today I run into some oddity with PHP, which I fail find a proper explanation for in the documentation. Consider the following code: <?php echo $_GET['t']. PHP_EOL; ?> The code is simple - it takes a single t parameter on the url and outputs it back. So if you call it with test.php?t=%5Ca (%5c is a '\'), I expected to see: \a However, this is what I got: $ curl http://localhost/~boaz/test.php?t=%5Ca \\a Notice the double slash. Can anyone explains what's going on and give recipe for

setTimeout not delaying function call in $.each

大兔子大兔子 提交于 2019-12-24 03:26:20
问题 I several divs on my site, I'd like to update one by one. In order not to spam the server with 200+ requests at once, I'd like to delay them by 1s each. What I tried: var $tourBox = $('.tour-box'); $tourBox.each(function () { var $box = $(this); setTimeout(function () { getUpdate($box); }, 1000); }); The update function: function getUpdate($box) { var $so = $box.attr('data-so'); var $url = $('#ajax-route-object-status').val(); $.get($url, { so: $so }).success(function (data) { var $bg = 'bg

$_GET, $_POST and $_REQUEST not being populated

假装没事ソ 提交于 2019-12-24 03:23:24
问题 I inherited an XP machine with xitami/pro server running on it and installed PHP 5.2.17 because I thought I might need the VC6 version. PHP works and the phpinfo shows as it should. When I do www.domain.com/test.php?x=y&z=test the $_GET is not being populated. The $_REQUEST variable is not being populated either. If I post it in a form and post it, the $_POST is empty as is the $_REQUEST . If I loop through the $_SERVER variables and display them on a get, the QUERY_STRING is populated with