get

How to pass URL in URL (as GET parameter) using PHP?

心不动则不痛 提交于 2019-11-28 12:12:23
I'm having some problems passing URL's as GET parameter. When I try to access: http://www.linkebuy.com.br/linkebuy/parceiro?url=http%3A%2F%2Fwww.google.com I get the following message: However, if I go for: http://www.linkebuy.com.br/linkebuy/parceiro?url=123 Everything works just fine (it redirects to an inexistent site - 123 -, of course, but it does the expected). By elimination I can say there's something wrong with the url parameter, but what is it? OBS: I'm using rawurlencode() to encode the URL. EDIT: Code you asked... In the first view, where the link is ( http://www.linkebuy.com.br

Mod Rewrite and Using PHP's GET for URL's When not Following the Rules

可紊 提交于 2019-11-28 11:57:01
问题 I couldn't think of a good title for this, it's hard to explain. Basically, I have mod_rewrite setup on my server. It turns each ?a=1&b=2&c=3 etc into /1/2/3/ I want to implement a feature where I can do something like this: /login/?return_url=/home/ The return_url would change depending on where the user was last. I know there are other methods of finding out the return url, but I would like to keep it in the URL. My issue is that the following does not work: /login/?return_url=/home/

How do I download a file using PHP and Mysql DB

不羁的心 提交于 2019-11-28 11:51:41
I am new to this and I am really stuck on how to download a file I have managed to upload on my local server. My uploaded script is - require_once ('dbcon.php'); if(isset($_POST['log'])){ foreach($_FILES['files']['tmp_name'] as $key => $name_tmp){ $file = $_FILES['files']['name'][$key]; $tmpnm = $_FILES['files']['tmp_name'][$key]; $type = $_FILES['files']['type'][$key]; $size = $_FILES['files']['size'][$key]; $dir = "file/".$file; $move = move_uploaded_file($tmpnm, $dir); if ($move){ $query = ("INSERT into dfile VALUES(null,'$file','$type','$size')"); $result = $dbLink->query($query); if(

Getting mod_rewrite to pass $_GET params?

人盡茶涼 提交于 2019-11-28 11:47:04
There's a couple other questions on this same topic on here that I've read, but mine is slightly different. I'm trying to do a very basic mod_rewrite: RewriteEngine on RewriteRule ^go/([^/\.]+)/?$ /go.php?page=$1 go.php looks like this: <?php ini_set('display_errors',1); if(isset($_GET['page'])){ echo 'page='.$_GET['page']; }else{ echo 'oh shnizzle!'; } ?> Now, when I go to /go/someword in my browser, the $_GET param "someword" IS NOT passed along, and I get the message "oh shnizzle!" every time. What are possible reasons I'm not able to pass any $_GET params through mod_rewrite? You probably

How to check whether a variable in $_GET Array is an integer?

丶灬走出姿态 提交于 2019-11-28 11:43:46
I have a page like so: http://sitename/gallery.php?page=2 It has pagination links at the bottom by which we can browse. Everytime the page numbers are clicked, it would send a GET request with parameters page=1 or page=2 and so on ... When I store these values to $page from teh $_GET variable, it is a string value. I can convert it to an integer using (int) like this: if(!empty($_GET['page'])){ $page = (int)$_GET['page']; echo "Page Number: ".$page; } But how can I make sure that the value passed is an integer only and not other crap? Using filters: if (null !== ($page = filter_input(INPUT_GET

Automatic Authentication using Grafana API

时光总嘲笑我的痴心妄想 提交于 2019-11-28 11:41:01
In my web application, I want to provide the ability to pass authenticated users from my dashboard across to Grafana . Once a user logged in my dashboard using credentials, a link to Grafana Dashboard will be displayed on my application. When user clicks that link, he/she will be redirected to Grafana page and automatically log in without displaying the Grafana login page. I don't want my users must encounter a second login screen, where they will be confused as to what username/password to enter. I've followed Automatic login to grafana from web application , Auto login to grafana dashboard ,

Get Property from a generic Object in C#

房东的猫 提交于 2019-11-28 11:40:14
have a look at this code please: public void BindElements<T>(IEnumerable<T> dataObjects) { Paragraph para = new Paragraph(); foreach (T item in dataObjects) { InlineUIContainer uiContainer = this.CreateElementContainer(item.FirstName ????? ) para.Inlines.Add(uiContainer); } FlowDocument flowDoc = new FlowDocument(para); this.Document = flowDoc; } When in write in Visual Studio "item.XXX" I should get the properties from my entitiy like .FirstName or .LastName. I do not know wether dataObjects is an IEnumerable or IOrder etc... it must be generic! How can I get the real properties form item ?

PHP protection of GET parameters

╄→尐↘猪︶ㄣ 提交于 2019-11-28 11:23:55
OK consider this url: example.com/single.php?id=21424 It's pretty obvious to you and i that the PHP is going to take the id and run it through a mysql query to retrieve 1 record to display it on the page. Is there anyway some malicious hacker could mess this url up and pose a security threat to my application/mysql DB? Thanks Intrepidd Of course, never ever ever consider a user entry (_GET, _POST, _COOKIE, etc) as safe. Use mysql_real_escape_string php function to sanitize your variables: http://php.net/manual/en/function.mysql-real-escape-string.php About SQL injections : http://en.wikipedia

Prevent browser waring when you hit the 'go back' button after form submit

夙愿已清 提交于 2019-11-28 11:13:30
问题 I have a little problem here. Actually, more of an annoyance. I have a form on my index page that has a small search form: <form action="search.php" method="post"> <input name="search" type="text" /> <input type="submit" name="submit"> now on the search.php file I just use the $_POST['search'] to retrieve the value that I'm searching. This file also displays the actual search results, which I can click on to go to that page.The search is actual done on the database. Also, because my search

Get hwnd by process id c++

穿精又带淫゛_ 提交于 2019-11-28 11:12:22
How can I get the HWND of application, if I know the process ID? Anyone could post a sample please? I'm using MSV C++ 2010. I found Process::MainWindowHandle but I don't know how to use it. HWND g_HWND=NULL; BOOL CALLBACK EnumWindowsProcMy(HWND hwnd,LPARAM lParam) { DWORD lpdwProcessId; GetWindowThreadProcessId(hwnd,&lpdwProcessId); if(lpdwProcessId==lParam) { g_HWND=hwnd; return FALSE; } return TRUE; } EnumWindows(EnumWindowsProcMy,m_ProcessId); You can use EnumWindows and GetWindowThreadProcessId() functions as mentioned in this MSDN article . A single PID (Process ID) can be associated with