Spent some time troubleshooting a problem whereby a PHP/MySQL web application was having problems connecting to the database. The database could be accessed from the shell and phpMyAdmin with the exact same credentials and it didn't make sense.
Turns out the password had a $ sign in it:
$_DB["password"] = "mypas$word";
The password b...
So I've got some Java code that uses Jakarta HttpClient like this:
URI aURI = new URI( "http://host/index.php?title=" + title + "&action=edit" );
GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery());
The problem is that if title includes any ampersands (&), they're considered parameter delimiters and the request goes screwy...
Hello everyone,
I have a file called 34.php?session=2534464a39a2c97cb7113689726a4e52 in my /var/www/html folder but I can't view this file in the browser. I want my browser to execute this code via PHP from the browser but It doesn't :(
Thanks..
...
I'm trying to get Velocity to output the following Javascript code:
if ((whichOne+1) <= numCallouts ) {
whichOne = whichOne + 1; } else {
whichOne = 1;
}
Whenever I try to get Velocity to print a > or a <, it represents it as a & gt; or & lt;, which doesn't help me since I'm trying to get it to produce Javascript. I've tried:
#s...
I'm populating an XElement with information and writing it to an xml file using the XElement.Save(path) method. At some point, certain characters in the resulting file are being escaped - for example, > becomes >.
This behaviour is unacceptable, since I need to store information in the XML that includes the > character as part of a ...
Hi,
If I do a redirect in action as normal:
$this->redirect('@mypage?apple=1&banana=2&orange=3');
... Symfony produces the correct URL:
/something/something?apple=1&banana=2&orange=3
However, the following gets escaped for some bizarre reason:
$string = 'apple=1&banana=2&orange=3';
$this->redirect('@mypage?'.$string);
... and t...
Hi all,
I'm quite new to PHP so sorry if sounds such an easy problem... :)
I'm having an error message when inserting content which contains quotes into my db.
here's what I tried trying to escape the quotes but didn't work:
$con = mysql_connect("localhost","xxxx","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
...
I have a bunch of string with special escape codes that I want to store unescaped- eg, the interpreter shows
"\\014\"\\000\"\\016smoothing\"\\011mean\"\\022color\"\\011zero@\\016"
but I want it to show (when inspected) as
"\014\"\000\"\016smoothing\"\011mean\"\022color\"\011zero@\016"
What's the method to unescape them? I imagine that ...
Hi,
I'm using pyodbc to talk to a legacy Access 2000 .mdb file.
I've got a cursor, and am trying to execute this:
c.execute("INSERT INTO [Accounts] ([Name], [TypeID], [StatusID], [AccountCat], [id]) VALUES (?, ?, ?, ?, ?)", [u'test', 20, 10, 4, 2])
However, doing so results in
pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC Mic...
I want to do what's described in question 724043, namely encode the path components of a URI. The class recommended to do that is URIUtil from Commons HttpClient 3.1. Unfortunately, that class seems to have disappeared from the most recent version of HttpClient. A similarly named class from HttpClient 4.1, URIUtils, doesn't provide the s...
I have some text area field in my grails application. I got the following errors:
.PatternSyntaxException: Unmatched closing ')' near index 36 Name: note: 1) data listing ....
how could i escape the regular expressions in the text area field?
thanks.
...
Hi,
On many occasions I have dealt with passing batch files arguments with spaces, quotes, percents, and slashes and all sorts of combinations of them. Usually I managed to figure out how to accomplish what I want, but this time I am stuck. I have tried a couple of hundred combinations now and my head is starting to hurt.
I’ve reduced ...
I'm in the process of building a site with CodeIgniter. This is the 1st site that I've built myself that interacts with a database. I'm using MySQL for this project. How can I tell if data needs to be escaped before saving it to the database?
...
I'm using a DocumentBuilder to parse XML files. However, the specification for the project requires that within text nodes, strings like " and < be returned literally, and not decoded as characters (" and <).
A previous similar question, http://stackoverflow.com/questions/1979785/read-escaped-quote-as-escaped-quote-from-xml, rec...
Ok, so I'm having a problem with a simple textarea. I'm using a kind of hidden page to easily encode some data using JSON. However, all of my text input is automatically being escaped somewhere and I don't know where. All of my $_POST variables are automatically run through the htmlentities() function when the script starts up, as seen b...
I cannot make system calls with spaces in the names and parameters. For example:
system("c:\\program files\\something\\example.exe c:\\my files\\example.txt");
I have tried escaping in every way I know how, and NOTHING works. I have tried:
system("\"c:\\program files\\something\\example.exe\" \"c:\\my files\\example.txt\"");
and
s...
Hello colleagues!
Googling today I couldn't found sample or mentioning of best practice: how to escape user input in Struts2.
Of course I can manually convert characters on validate() method, but it looks too obvious. So may be exists some automation to avoid code/script injection?
...
For some strange reason, the \n and \r escape sequences do not seem to be working in my code. I want to write each NSString on a new line of the file, but it just appends it the last string on one line. Here's the code:
for (Entry *entry in self.entries) {
NSString *path = @"/Users/me/File.txt";
NSString *string = (@"%@\r\n", ...
<asp:Button ID="myButton" runat="server"
OnClientClick='confirm("How do you escape this apos'trophe?")' />
...
My knowledge of commandline bash is missing on a particular area: I constantly forget how to properly escape characters. Today I wanted to echo this string into a file:
#!/bin/env bash
python -m SimpleHTTPServer
echo "#!/bin/env bash\npython -m SimpleHTTPServer" > server.sh && chmod +x server.sh
-bash: !/bin/env: event not found
That...