I have php code written in test.inc file but dreamweaver is showing no color highlighting.
Is there any way to make them same color code as .php extension
I am trying to figure out how to get the parameters from a Restlet request object.
my request comes in as /customer?userId=1 and I want to grab the parameter to pass to my DAO for the query.
@Get("xml")
public Representation toXml() throws ResourceException, Exception
{
try
{
//get param from request
//call DAO with parameter
}
catch(Exception e)
{
throw e;
}
}
I've got a site built on top of Kohana 2.3 which I now have to make all links https.
I set this in application/config/config.php.
$config['site_protocol'] = 'https';
This makes all links on the site use the https protocol.
Except, when I first enter the site via http, it will not automatically forward to https.
Is there a way to make Kohana do this, or do I just need to do some custom coding?
I've found this .htaccess rule too, will it be fine to just drop this in?
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://yourdomain.tld%{REQUEST_URI} [NS,R,L]
Thanks.
I am trying to write a program that will verify that all cookies sent out from the machine are in fact going to the domain they came from. This is part of a larger security project to detect cookie based malicious attacks (such as XSS). The main snag for this project is actually detecting the out-going cookies. Can someone point me in the right direction for monitoring out-going HTTP traffic for cookie information? Other information about the project: This is a windows application written in C and numerous scripting languages. Thanks so much for the help.
I've got a tcsh shell script that I would like to stop with an error on nonzero status most of the time, but in some cases I want to ignore it. For example:
#!/bin/tcsh -vxef
cp file/that/might/not/exist . #Want to ignore this status
cp file/that/might/not/exist . ; echo "this doesn't work"
cp file/that/must/exist . #Want to stop if this status is nonzero
I've been using the Semaphore class to create semaphores. However, the examples use managed code (requires /clr), and I need to use unmanaged code because it seems FreeType doesn't like working with managed code.
How can I create two simple threads which use a semaphore in unmanaged code?
I have a simple html service, developed in django.
You enter your name - it posts this, and returns a value (male/female).
I need to ofer this as a web service. I have no idea where to start.
I want to accept a xml request, and provide an xml response - thats it.
Can anyone give ma any pointers - Googling it is difficult when you dont know what your searching for.
If memory serves me correctly, google does this for the maps site. I know google's mobile maps app can determine the rough location (I assume using some kind of cell tower lookup), yet I seem to remember the site getting somewhat close to the current location when viewing on a mobile browser.
Anyone know how/if that's possible? Does the IP address change based on the tower or area (seems like they'd be using some kind of gateway common to the carrier)?
Hello According to RFC, in multipart/form-data content-disposition header
filename field receives as parameter HTTP quoted string - string between quites where
character '\' can escape any other ascii character.
Problem web browsers don't do it.
IE6 sends:
Content-Disposition: form-data; name="file"; filename="z:\tmp\test.txt"
Instead of expected
Content-Disposition: form-data; name="file"; filename="z:\\tmp\\test.txt"
Which should be parsed as z:tmptest.txt according to rules instead of z:\tmp\test.txt.
Firefox, Konqueror and Chrome don't escape " characters for example:
Content-Disposition: form-data; name="file"; filename=""test".txt"
Instead of expected
Content-Disposition: form-data; name="file"; filename="\"test\".txt"
So... how would you suggest to deal with this issue?
I'm trying to send an image to a server, using HTTP Post Multipart. Everything else is fine, I have all the boundrys set and stuff.
But what do I have to do to the image before hand? Do I have to convert it to binary? Here is the header data from the header (using Fiddler). This is what I need to upload:
-----------------------------7daea2aa40c80
Content-Disposition: form-data; name="pict"; filename="pic.jpeg"
Content-Type: image/pjpeg
<Binary here ... or at least I think it is> ..
?????JFIF?????????C? (lots more of this I removed)
Any advice?
What are the location detecting tecniques for IP adresses?
I know to look at the
$_SERVER['HTTP_ACCEPT_LANGUAGE'] (not accurate but mostly useful to detect location, for example if an IP range's users set French to their browser then it means that this range belongs to France
gethostbyaddr($_SERVER['REMOTE_ADDR'])
then may be to whois gethostbyaddr($_SERVER['REMOTE_ADDR'])
sometimes
$HTTP_USER_AGENT (Firefox's user agent string has language code, not accurate but mostly can be used to detect the location)
But what about cities?
I generate a dynamic assembly with CSharpCodeProvider, from a C# source saved into a string.
I can run the synamic code at runtime, but if I pause the execution Visual Studio doesn't show me the dinamic source code in the call stack. It says "External code" and I can't step into that source code.
I think VS can't find PDB or other debug info. Can you help me?
Hello
I need to test my web server, but i need to measure it with lot of files with different size. I got about 500-1000 that kind of files. Can You please tell me how to do it in jmeter ? Maybe there is an option where i can put file with my files to retrive list ??
thx in advance
We are deploying web applications in java using tomcat on client machines across the country.
Once they are installed, we want to allow a remote access to these web applications through a central server, but we do not want our clients to have to open ports on their routers.
Is there a way to tunnel the http traffic in a way that the central server can access the web application that is behind the firewall ?
The central server has a static ip address and we have full control over it.
We don't need to access the filesystem, we only want to access the web application itself through a browser.
if i modify a source file in a piece of mit licensed code does that mean i need to open source it too or can i keep it closed source?
Basically if i distribute my program which uses a piece of modified mit licensed code and somebody asks for the mit code, do i just point him the original piece of code or do i have him my modifications too?
In all the forums web pages the download links are given inside the [code] braces that looks like text area with white background.
When the download links are in large numbers then there are scroll bars.
I find it difficult to scroll up and then select and then drag down to select all links.
Is there any way to select all , when I click on select all on right click then it usually selects the text from whole page not from that code segment
I'm writing a very simple web service, written in Python and run as CGI on an Apache server.
According to Python docs (somewhere... I forgot where), I can use sys.stdin to read the data POSTed by a random client, and this has been working fine. However, I would like to be able to read the HTTP header information as well - incoming IP, user agent, and so on. I'd also like to keep it very simple for now, by using only Python libraries (so no mod-python). How do I do this?
Form Based Authentication For Websites
Please help us create the definitive resource for this topic. We believe that stackoverflow should not just be a resource for very specific technical questions, but also for general guidelines on how to solve variations on common problems. "Form Based Authentication For Websites" should be a fine topic for such an experiment.
It should include topics such as:
how to log in
how to remain logged in
how to store passwords
using secret questions
forgotten password functionality
OpenID
"Remember me" checkbox
Browser autocompletion of usernames and passwords
secret urls (public urls protected by digest)
checking password strength
email validation
and much more
It should not include things like:
roles and authorization
http basic authentication
Please help us by
Suggesting subtopics
Submitting good articles about this subject
Editing the official answer (as soon as you have enough karma)
UPDATE: See the terrific 7-part series by Jens Roland below.
I need some code samples (and I also really curious about them) of Scala and Java code which show that Scala code is more simple and concise then code written in Java (of course both samples should solve the same problem).
If there is only Scala sample with comment like "this is abstract factory in Scala, in Java it will look much more cumbersome" then this is also acceptable.
Thanks!
I've got a shell script that I would like to stop with an error on nonzero status most of the time, but in some cases I want to ignore it. For example:
#!/bin/tcsh -vxef
cp file/that/might/not/exist . #Want to ignore this status
cp file/that/might/not/exist . ; echo "this doesn't work"
cp file/that/must/exist . #Want to stop if this status is nonzero
The system I'm developing is comprised of a jetty server (v6.1.2rc4) and a php frontend that sends http requests to jetty via curl_exec.
The server and the client are on the same machine.
The requests I send can be both POSTs and GETs, I get the same error for either which is:
Failed to connect to 127.0.0.1: Unknown error 99
This is rather cryptic.
It seems that after the first problematic request, some of the following (unrelated) requests also get corrupted.
It looks like jetty is simply refusing the connection, but I can't read more than that into the error message.
I thought it was a problem with the server's configuration, so I tried changing jetty's maxIdleTimeMs, but without success.
Any idea about what to do is welcome
thanks,
Silvio
I've set up a little script that should feed a client with html.
import socket
sock = socket.socket()
sock.bind(('', 8080))
sock.listen(5)
client, adress = sock.accept()
print "Incoming:", adress
print client.recv(1024)
print
client.send("Content-Type: text/html\n\n")
client.send('<html><body></body></html>')
print "Answering ..."
print "Finished."
import os
os.system("pause")
But it is shown as plain text in the browser. Can you please tell what I need to do ? I just can't find something in google that helps me..
Thanks.
Hi,
I'm building a download manager in python for fun, and sometimes the connection to the server is still on but the server doesn't send me data, so read method (of HTTPResponse) block me forever. This happens, for example, when I download from a server, which located outside of my country, that limit the bandwidth to other countries.
How can I set a timeout for the read method (2 minutes for example)?
Thanks, Nir.
I came across the following URL today:
http://www.sfgate.com/cgi-bin/blogs/inmarin/detail??blogid=122&entry_id=64497
Notice the doubled question mark at the beginning of the query string:
??blogid=122&entry_id=64497
My browser didn't seem to have any trouble with it, and running a quick bookmarklet:
javascript:alert(document.location.search);
just gave me the query string shown above.
Is this a valid URL? The reason I'm being so pedantic (assuming that I am) is because I need to parse URLs like this for query parameters, and supporting doubled question marks would require some changes to my code. Obviously if they're in the wild, I'll need to support them; I'm mainly curious if it's my fault for not adhering to URL standards exactly, or if it's in fact a non-standard URL.