Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Automatyczne uzupełnianie forumlarza - pomoc!
Kicha
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 1.05.2010

Ostrzeżenie: (0%)
-----


Witam,

może najpierw przedstawię sytuację. Chcę, aby JS wypełnił mi dany formularz na stronie. Dokładniej na tej: http://symulator.lockerz-poland.eu/redeem.html

Ale to tylko symulator, i tu się pojawia problem... Każdego razu, gdy na jednej stronie jest dostępny ten formularz, Admini bawią się z Nami w kotka i myszkę - dodają w ID zamiast "FirstName", np. "__First_Name". Jeden "typek z branży" podobno znalazł na to rozwiązanie.... JS rozpoznaje zawsze, iż jest to FirstName, niezależnie od podłóg czy losowych ciągów cyfr i liter.

Mój skrypt wygląda tak:

Kod
var country = "Poland";
var countryCode = "PL";

var phoneOne = "000";
var phoneTwo = "000";
var phoneThree = "000";
var phoneWhole = "0048xxxxxxxxx";

var firstName = "imie";
var lastName = "nazwisko";

var address1 = "adres";
var address2 = "";

var city = "miasto";
var state = "PL";
var zip = "kod pocztowy";

document.getElementById("state").value = state;
document.getElementById("statesClicker").getElementsByTagName("SPAN")[0].innerHTML = state;
document.getElementById("stateDetails").value = state;

document.getElementById("country").value = country;
document.getElementById("countryClicker").getElementsByTagName("SPAN")[0].innerHTML = country;
document.getElementById("countryDetails").value = country;
window.location= "java script: manipulateForm('"+countryCode+"');";

document.getElementById("phoneOne").value = phoneOne;
document.getElementById("phoneTwo").value = phoneTwo;
document.getElementById("phoneThree").value = phoneThree;
document.getElementById("phoneWhole").value = phoneWhole;

document.getElementById("firstName").value = firstName;
document.getElementById("lastName").value = lastName;

document.getElementById("address1").value = address1;
document.getElementById("address2").value = address2;

document.getElementById("city").value = city;
document.getElementById("state").value = state;
document.getElementById("zip").value = zip;

document.getElementById('recaptcha_response_field' ).focus();



Jakieś sugestie względem tego, aby nie trzeba było zgadywać, co administracja zrobi? Niestety nie znam tak dobrze JS, dlatego pytam Was....
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
varez
post
Post #2





Grupa: Zarejestrowani
Postów: 275
Pomógł: 32
Dołączył: 17.06.2007

Ostrzeżenie: (0%)
-----


1.
nie wiem po co takiego bota piszesz w JS.. jak to ma dzialac?
nie lepiej PHP+curl i od razy POSTy słać?

2: regularne zamienianie
Kod
costam = "__FirstName".replace(/[^a-zA-Z0-9]+/,"");
alert(costam);


Ten post edytował varez 1.05.2010, 09:13:14
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.10.2025 - 11:03