What does it mean? - web

string query = "SELECT *
FROM users
WHERE username = "'" + username + "'
AND password = '" + password + "'";
Since this query is constructed by concatenating an input string directly from the user, the query behaves correctly only if password does not contain a single-quote character. If the user enters
__"
joe
"
as the username and
"
example' OR
'a'='a
as the password, the resulting query
becomes__
I want to know what the single quote character means

Related

case sensitive compare password when found the id with dlookup

I want a code to lookup for a username and compare the password ( case sensitive ) using the dlookup
here is my code and it doenst care for the pass if it is capital letter nor not
If (IsNull(DLookup("UserName", "UserID", "UserName='" & Me.Userbox.Value & "'and [password] = '" & Me.Passbox & "'"))) Then
Thanks

VBA Replace() Function with Multiple Strings in Same Cell

I am writing a macro send multiple emails that are customized based on the data required.
For example:
Subject: <name>, Thank you for visiting <store>
At the moment, I can only pull , but I have no idea how to also add so 'Content' will both of them.
Content = Replace(msg.Subject, "<name>", first_name + " " + last_Name)
Replace(msg.Subject, "<store>", store_name)
^ essentially I want to combine both of these so the macro will pull both.
You can do it in multiple steps:
Content = Replace(msg.Subject, "<name>", first_name + " " + last_Name)
Content = Replace(Content, "<store>", store_name)
Or you could nest your Replace statements:
Content = Replace(Replace(msg.Subject, "<name>", first_name + " " + last_Name), "<store>", store_name)
If you ended up with a large number of tokens to replace (or an ever growing dynamic number of them) then you could get fancy and iterate through the string to identify tokens and swap them out inside the loop, but that would be overkill here.

Pass Values to Web Api URL in Query string C#

I am new to Web API and need to pass values dynamically from UI(Windows Application) in URL as posted below with value parameters in Bold.
URL:http://openbasket-quote.sit.svc/v3/allQuotes/**{number}**/version/**{version}**?format=OrderGroupXml&country=**{country}**&ignoreExpirationDate=true
i have done in this way.
string eQuoteURL = eTempQuoteURL + eQuoteNo + "/" + "version" + "/" + versionNo + "?" + "format=OrderGroupXml&country=" + country + "&ignoreExpirationDate=true";
Is there any other way to pass values to URL.
You can use a composite format string:
string eQuoteURL = string.Format("{0}{1}/version/{2}?
format=OrderGroupXml&country={3}&ignoreExpirationDate=true",
eTempQuoteURL,
eQuoteNo,
versionNo,
country);
In C# 6, you can use an interpolated string:
string eQuoteURL = $"{eTempQuoteURL}{eQuoteNo}/version/
{versionNo}?format=OrderGroupXml&country={country}&ignoreExpirationDate=true";
Or you could use a library like Flurl or RestSharp.

add quotes mark to string

I want to concatenate to a string another which contains the " ' " characters
the string look as wanted But when I create an Object with this string, I'm getting a "\" inside it:
I check in https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-ID285 how to deal with special character
EDIT:
I made a mistake in understanding the source of my problem...
When I try to build a URL with URLQueryItem , there Im getting
print(EventToUrl.name) // print John's Event
let name = URLQueryItem(name: "name", value: EventToUrl.name)
print(name.description) //print name=John's Event
print(name.value) // print Optional("John\'s Event")
deepLink.queryItems = [name]
print(deepLink.url) //print Optional(https://www.example.com/?id%3D-KZXZG2bcuKHNdYNcGTF%26name%3DJohn's%2520Event%26....)
And when i try to send this deep link Im getting an error because of the " ' " characters
I also try Eric Aya's answer here :
How to use special character in NSURL?
but that not working for me:
print(EventToUrl.name) //print "John's Event"
let name = URLQueryItem(name: "name", value: EventToUrl.name.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed))
print(name.description) //Print name=John's%20Event
print(name.value) //Print Optional("John\'s%20Event")
print(deepLink.url) //print
Optional(https://www.example.com/?id%3D-KZXWVbBolmso5DT4p2I%26name%3John's%252520Event%26.......)
Self contained code :
var urlTestComponents = URLComponents()
urlTestComponents.scheme = "https"
urlTestComponents.host = "www.example.com"
urlTestComponents.path = "/"
let nameTest = URLQueryItem(name: "name", value: "John's Event")
urlTestComponents.queryItems = [name]
print(urlTestComponents.url)
The last line prints "https://www.example.com/?name=jeremie's%20Event" and If I try to send that (with whatsApp) the url is cut at the middle because of the " ' "
:

How to get the substring from a String in ColdFusion

How can I get the Substring in Coldfusion?
ex:- following is the String "Update Tablename set value=something where value2=thisone"
I want to get the Table name from the Str
how is it possible?
Note:- Table name is dynamic(i.e may be any charecters).
Thanks
updated:
You can probably use result = ListToArray(sql , " ") and then use the result[2]
also i believe you can do ListGetAt(sql, 2, " ")

Resources