如何为网站添加帐户检查器[关闭]

I am making a website for my friends that gives them accounts I have made that I don't use anymore (There are a lot). The way it works, you select the website you want the free account for, press submit, then it gives you the account details.

However, some of the accounts that I have added were created a while ago and have been deactivated.

There are a lot of accounts that I am providing and I do not want to go and check each account on the website to see if it logs in.

I want to write some code that I can put into my website that checks the account on the website before giving it out. (It should only give the account details if it logs in.)

Lets say the website is Netflix (just an example): The code will check the given account details work to log in with on Netflix. Then gives out the account details if it logs in.

Please help me as I am stuck :)

Here is the code:

HTML:

<div>
    <select id="optionList" size="3">
        <option value="option1">Account 1</option>
        <option value="option2">Account 2</option>
        <option value="option3">Account 3</option>
        <option value="option4">Account 4</option>
        <option value="option5">Account 5</option>
        <option value="option6">Account 6</option>
    </select>
</div>

<br><button type="button" onclick="submitForm();" style="height:70px;width=200px">Submit</button>

<div>
    <br><font size="5"><label>Account: </font></label>
    <font size="4.5"><font color="blue"><label id="pickedAnswer"></font></label>
</div>

<script type="text/javascript" src="./generator.js"></script></body>

JAVASCRIPT:

var answers = [];
function initailize(){
answers = [];
var answerSet1 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option1"] = answerSet1;
var answerSet2 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option2"] = answerSet2;
var answerSet3 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option3"] = answerSet3;
var answerSet4 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option4"] = answerSet4;
var answerSet5 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option5"] = answerSet5;
var answerSet6 = ["SECTION IS BEING UPDATED. Coming soon."];
answers["option6"] = answerSet6;
    document.getElementById("pickedAnswer").innerHTML = "";
}

initailize();

function submitForm(){

    var selectedOption = document.getElementById("optionList").value;
    var optionMaxIndex = answers[selectedOption].length;
    if(optionMaxIndex>0){
        //Generate random index
        var randomIndex = Math.floor(Math.random() * optionMaxIndex);
        var pickedAnswer = answers[selectedOption][randomIndex];
        //Remove picked answer from the selected answer set
        answers[selectedOption].splice(randomIndex, 1);
        //Show the answer
        document.getElementById("pickedAnswer").innerHTML = pickedAnswer;
    }else{
        alert("Please contact the owner to restock the websites");
    }
}


Send us some code, then we will know how to help you out.

emekamba I added the code :)