madmike3 Posted August 20, 2014 Share Posted August 20, 2014 (edited) Hello, iam almost done with my project .. except there is one more thing left which somehow i cant manage to figure it out....... i manged to make a proxy array which rotates proxies randomly on every try..... but i want for my users to be able to add them manually via the textarea... so they put their proxies andas much as they want...... so then i guess explode should be used to fetch the proxies that were added by the user from the textarea and put them in an array like u see down and then with the curl array_rand it randomises them on evry try The real problem is i dnt know how to indetidy the explode cause iam not adding them manually they will be added via textare by users....... so when they add the ips they need to be fetched from the textare.THNX IN ADVACE $proxies = array( '000.000.000.00:000', <----------------- should i keep this ? cause ips will be added from textarea by users ? '000.000.000.00:000', '000.000.000.00:000', '000.000.000.00:000', ); curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]); <----- AFTER and array is made using exploit this will call it <textarea cols='22' class='area' rows='14' name='proxies'>PROXIES</textarea><br><input type='submit' value='Test'><br></p><p align='center' dir='ltr'><b> Edited August 20, 2014 by madmike3 Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 20, 2014 Share Posted August 20, 2014 Sorry, I'm not sure what you're asking. Are you just trying to figure out how to get the value from the textarea? If so, you use $_GET['proxies'] or $_POST['proxies'] depending on what the method attribute for your form is set to. Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 Yes thats what iam trying to achive iam trying to get values from textarea and convert them into array since it needs to be randomised using the curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]) do u understand me ? Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 21, 2014 Share Posted August 21, 2014 Get the textarea's value depending on what the method attribute for your form is set to as @cyber already mentioned and store it in your database. then fetch all proxy strings from this database into an array, as for to randomise them you could use the mysql rand() function and finally set them to CURLOPT_PROXY method, function or whatever is that. http://php.net/manual/en/faq.html.php Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 But i dnt have dabase it is a script i made single php file Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 21, 2014 Share Posted August 21, 2014 (edited) Just in case you're still looking for help, here's a quick example of a working form: <?php //IF THE FORM WAS SUBMITTED if(isset($_POST['submit'])) { //GET USER-SUGGESTED PROXIES $proxies = trim($_POST['proxies']); var_dump($proxies); //<-- this line just shows that a value was passed; it isn't needed for your final code //...do whatever you need to do with the proxies here... } ?> <form method="post" action=""> <textarea cols='22' class='area' rows='14' name='proxies' placeholder="PROXIES"></textarea><br> <input type='submit' name="submit" value='Test'> </form> Edited August 21, 2014 by cyberRobot Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 (edited) Bro, LOOKS PROMOSING GONNA TEST AND LET U KNOW........ but, what do u mean do with this //...do whatever you need to do with the proxies here... if i post code like this want it work ? or u mean i add this there curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]) so it chooses random proxy on evry try ? Edited August 21, 2014 by madmike3 Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 do it do it like this ? //IF THE FORM WAS SUBMITTED if(isset($_POST['submit'])) { //GET USER-SUGGESTED PROXIES $proxies = trim($_POST['proxies']); var_dump($proxies); //<-- this line just shows that a value was passed; it isn't needed for your final code //...do whatever you need to do with the proxies here... $ch = curl_init('https://www.website.com'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,15); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTP_VERSION,'CURL_HTTP_VERSION_1_1' ); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_ENCODING , "gzip,deflate"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXY, $proxy_ip); curl_setopt($ch, CURLOPT_REFERER, $refer); curl_setopt($ch, CURLOPT_USERAGENT,$agents[array_rand($agents)]); curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt'); } Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 21, 2014 Share Posted August 21, 2014 Bro, LOOKS PROMOSING GONNA TEST AND LET U KNOW........ but, what do u mean do with this //...do whatever you need to do with the proxies here... if i post code like this want it work ? or u mean i add this there curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]) so it chooses random proxy on evry try ? Yep, the "//...do whatever you need to do with the proxies here..." part would be whatever it takes to process the proxies. Note that you'll need to figure out how you're going to break up the proxies supplied by the user, assuming that you're allowing them to enter more than one. You could ask the user to separate multiple proxies with a delimiter or maybe have each listed on a new line. You could then use something like explode() to break the proxies apart to get the array to randomize. Quote Link to comment Share on other sites More sharing options...
Barand Posted August 21, 2014 Share Posted August 21, 2014 I wouldn't use a text area for input that relies on the user using the correct delimiter. You have no control whatsoever over the format. It would be better IMO to have several separate text inputs each named "proxies[]" <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> This way the individual proxies are separated and $_POST['proxies'] will already be your required array Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 I wouldn't use a text area for input that relies on the user using the correct delimiter. You have no control whatsoever over the format. It would be better IMO to have several separate text inputs each named "proxies[]" <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> <input type="text" name="proxies[]" size="25" /><br/> This way the individual proxies are separated and $_POST['proxies'] will already be your required array check my code pls Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 Yep, the "//...do whatever you need to do with the proxies here..." part would be whatever it takes to process the proxies. Note that you'll need to figure out how you're going to break up the proxies supplied by the user, assuming that you're allowing them to enter more than one. You could ask the user to separate multiple proxies with a delimiter or maybe have each listed on a new line. You could then use something like explode() to break the proxies apart to get the array to randomize. check my code pls Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 (edited) oK lets say i used as u said eventhough i prefer textarea can u tell me how to covert them into array and then randomised using @Barand curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]) Edited August 21, 2014 by madmike3 Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 (edited) i also made a version which user upload proxies.txt so......... how can i call proxies.txt to an array and then use them with curl_setopt($ch, CURLOPT_PROXY,$proxies[array_rand($proxies)]) according to my code. Best Regards THNX IN ADVANCE Edited August 21, 2014 by madmike3 Quote Link to comment Share on other sites More sharing options...
CroNiX Posted August 21, 2014 Share Posted August 21, 2014 This is starting to look like a hacking/malicious script. Quote Link to comment Share on other sites More sharing options...
madmike3 Posted August 21, 2014 Author Share Posted August 21, 2014 This is starting to look like a hacking/malicious script. not really, and not gonna be used for bad purposes..... if u can help pls do so Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted August 21, 2014 Share Posted August 21, 2014 I think you'll have to do your script kiddie password cracking bullshit somewhere else. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.