Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

php

Status
Not open for further replies.
Try this

Code:
function check_input($data)
{
    $data = htmlspecialchars($data);
    return $data;
}
if(isset($_GET['name']))
{
$domain = check_input($_GET['name']);
}
 
If you know the domain then below, otherwise if domain.php is parsing the url and you know the query parameter then GET as above. parse_url very useful if the whole url changes or you're wading through a list of urls. Example assumes one name=domain parameter, more with & will need more work.

Code:
$url_data = parse_url($url);
$query_data = $url_data['query'];
$query_data = explode('=', $query_data);
$domain = $query_data['name'];
 
Thats Great! Thanks for your help guys, ill post the url when done in the website review section :)
 
I always add checks, on the lengths, and the nature, if your expecting a number, then check is_numeric, check it as much as possible before allowing it out into the open as it were.
 
Don't just get the data from URL and process it how you want. It could be anything whatsoever.

Anyone can go to your page www.sitename/domain.php?name=domainName
and change "domainName" to be any data they want.
Your script will then happily take that data and process it, which could be an attack attempt etc.

You need to check the data, ideally from a whitelist of data you know it can only be (ie a list of domain names) or at least check there are no bad chars which cannot be in a domain name.
I'd weed out " ' < and > for starters
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom