Jump to content

fix3r

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fix3r's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a php form for changing a password for my users in the database, and I am trying to do this with ajax so it looks cleaner and doesn't have to wait on the load time, ect..anyways I just want to learn how to do this with ajax .. but I don't really know how exactly? Usually I would just do this: function submit(blah, blah2) { request.open('GET', '/blah.php?blah=' + escape(blah) + '&blah2=' + escape(blah2)); request.onreadystatechange = SubmitHandle; request.send(null); } then the handle ect.. But here is my question. I have 3 fields (current password, new password, confirm password) After submitting (perferably without a button(rather a hyper link) .. don't really know how because using document.change_password.submit(); is not really doing something, I need to check the "current password" field to check with the database. Of course I could do this through the GET command I posted above but I don't really want the info going plain text through headers is what I am getting at. Then, if the password is wrong, it would say its wrong, maybe with document.getElementById('submit').innerHTML = "wrong password" .. ect .. and if it's right then go onto another function to submit check the new password and confirm password and later say if its wrong or then send it through the database with another function.. What I am trying to get at is, I don't really want this sensitive data to be sent through the way I am sending it now and I need a way to check with the database first to see if your current password is right or not without it sending the way i am sending it now and how you normally would check it with a basic php page. I know, I am really bad at explaining but if anyone understanded the gibberish I just wrote here I would be very pleased to hear what you had to say.
  2. Maybe make all of them a link, and put make it redirect to this: http://www.barriemenshockey.com/statform.php?player=# Then the variable that you clicked will be stored into $_GET['player']; so when you are submitting your form to be entered, you just check to make sure you actually clicked a player, and if you did enter that info into that players spot or w/e
  3. I want to be able to search for text in a text file. For example if there was this in a text file: php1:mysql1 php2:mysql2 php3:mysql3 php4:mysql4 apple:orange php5:mysql5 php6:mysql6 php7:mysql7 php8:mysql8 php9:mysql9 I want to be able to search for the word "apple" and then echo what is next to it, which would be "orange". How would I go about doing this? Also, if I were to search through these files in php daily with a lot of people searching through them, would my text files become corrupt? Thank you!
  4. I have 3 curls in a row. It logins, then it logs out(first 2 curls) .. but then for some reason it doesn't log back in. Does anyone know why that would be? <?php $headers = array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0. Gecko/20061025 Firefox/1.5.0.8"); //login to the site $url="THE WEBSITE/login.php"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies1.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "THE FIELDS"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); print($store); //logout of the site $url="THE WEBSITE/logout.php"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies1.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); print($store); //log back into the site but gives me an error $url="THE WEBSITE/login.php"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies1.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "THE FIELDS"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); print($store); ?>
  5. Sorry, maybe you misunderstood. I really have no clue how to actually get the last character of ANY string. That's what I am asking for. Thank you for responding though. Hopefully you understand my question more clearly now. That was my fault.
  6. i need to find the last digit of a string. for example $pos = 1287120; I need to check if the last digit is "0". The number could be any length but I am positive it will be a number. How would I do this?
  7. Okay, sorry for spam. It seems that this code still outputs the html of the site. How do I make it not output the site at all? $url="WEBSITE"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies1.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "ALL MY FIELDS"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); //print($store);
  8. <?php $headers = array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0. Gecko/20061025 Firefox/1.5.0.8"); $url="THE WEBSITE"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "email=email&pass=pass"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); print_r($store); ?> Okay, I got the login to work. Now, how would I make it go to an existing page with the login information and then submit a whole new form? That I am a little confused about.
  9. I want to use php to login to another site and then go to that site using the screen name I was logged into and view a webpage on that site and submit a form and searching for text mostly, i need help logging into that site through a php script.. how would I go about doing this
  10. I don't really know the difference. The form processing page is the same as the form page :|
  11. This doesn't seem to work. What else would I have to do?
  12. Would it matter if the page that has the form is lets say a ".psp"?
  13. Lets say I have a website, that has a form on it. How would I go about using php to insert things into the form and push submit and see what it outputs. The website I want to submit to isn't on my server it would be a different designated site. It doesn't involve cookies or anything like that I just need to search for some text on the submitted page. How would I do this in curl? I'm very clueless because all the tutorials I see has to do with cookies and such and I don't need that.
  14. [b]With Quotes:[/b] [img]http://img267.imageshack.us/img267/6448/withquotesrl7.png[/img] [b]Without Quotes: [/b] [img]http://img201.imageshack.us/img201/6801/withoutquotesvi0.png[/img] Ugh, now my whole bbcode is getting messed up. If anyone has any bbcode for colors, ect, that they would like to share that replaces the WHOLE code, not just if you type in [color="red"] it will replace it and then if you don't do the other thing right it won't replace that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.