Search query in url [duplicate] - javascript

This question already has answers here:
Reference: mod_rewrite, URL rewriting and "pretty links" explained
(5 answers)
How can I get parameters from a URL string?
(12 answers)
Closed 4 years ago.
I'm currently working on a project almost like steamrep.com but for another game and more features.
I know basic php js etc but there is 1 thing i can't seem to understand.
And that is when you for ex search for
yourdomain.com/profiles/ (any id / username)
I can't seem to figure out how to make it so it takes the givin id / username puts it as a variable and display it on a page.
If anyone could give me a lead that would be verry much appreciated!
EDIT: To clear up the question. I want to take the id or username from the url and display it the page as a variable.

Related

protecting selenium from detection [duplicate]

This question already has answers here:
Can a website detect when you are using Selenium with chromedriver?
(25 answers)
Chrome browser initiated through ChromeDriver gets detected
(2 answers)
Closed 4 years ago.
I am trying to crawl a couple of website pages to use their information and I can only use things like selenium that has chromium to do that
Now I am trying to hide it from the website owners because I don't want to get banned. some people are talking about changing some variable names called cdc_ inside of chromdriver and I can't understand how to do it
Also I am using python for this
EDIT : My problem is that I can't change the variable of cdc_ or any other variables in chrome driver because I don't know how
any method so I can hide the fact that I am using selenium!
Please help me here
Thank you for your time

How to check if string contain the "url or link" and retrieve it [duplicate]

This question already has an answer here:
Match all URLs in string and return in array in JavaScript
(1 answer)
Closed 8 years ago.
I have comment section of page where user can post the comments on uploaded content, I want to check if user has shared any url links in his comment.
for Example -
var comment = "To search more on this question you can look to http://stackoverflow.com/ "
Now How do I find out that it is URL link and retrieve that link?I would be great if I can find a way to do this in Jquery and Java Script but PHP is also acceptable.
Thanks in advance.
Try to use this REGEX
((http:\/\/|https:\/\/)?(www.)?(([a-zA-Z0-9-]){2,}\.){1,4}([a-zA-Z]){2,6}(\/([a-zA-Z-_\/\.0-9#:?=&;,]*)?)?)

url question mark (javascript sample, how to do it) [duplicate]

This question already has answers here:
How can I get query string values in JavaScript?
(73 answers)
Closed 8 years ago.
Sorry but English is not my mother language. I need a sample on how to make something like this:
I have category and URL is like:
/category
and I want to parse url in javascript to be like this
/category?group=myFirstGroup
I don't know how to express myself, I hope you will understand me. Another example would be like this:
There is a website e.g. www.abc.com with /help section with frequently asked questions for doctors and patients.
I want to give url to people with just questions for doctors or patients, not all questions in one place. Example:
www.abc.com/help?type=doctors (contain just questions for doctors)
www.abc.com/help?type=patients (contain just questions for patients)
I don't think this is a JavaScript specific question. If I understand you right you are talking about query parameters in the context of RESTful Web Services. Is this what you are looking for?

PHP $_GET in plain html/javascript [duplicate]

This question already has answers here:
How can I get query string values in JavaScript?
(73 answers)
Closed 8 years ago.
I am trying to figure out how to get the parts of a URL I am going to be receiving from a third-party website. The URL I am expecting is something like: index.html?lob=company&ZipCode=22407
All of my pages are coded in .html rather than PHP due to my client's needs/desires, so my question is how can I get the "ZipCode" value.
In PHP this would be super simple, however I cannot do that.
Use Javascript instead.
var value_of_zipcode = "index.html?lob=company&ZipCode=22407".match("ZipCode=([0-9]{5})")[1];
now the value_of_zipcode is 22407

Javascript Login [duplicate]

This question already has an answer here:
JS Simple but Safe Login? [closed]
(1 answer)
Closed 6 years ago.
I am trying to create a login page using JavaScript. It's really just a redirect page with a couple of usernames and passwords. I know how insecure it is, but its simple; plus no confidential information will be on the target pages.
I got my script from this source: http://www.javascriptkit.com/script/script2/loginpass2.shtml
Im trying to have certain usernames redirect to a particular page and I want to do that with the code given..I just don't know how.
Sorry for not being clear.
For example, when someone logs in as user 1 I want them to be redirected to a different page as user 2.
Thanks in advance. :)
Why not just do
window.location.replace(url);
Where you get url from matching a username with a url. An associated array would fit the bill

Categories

Resources