Jump to content

scorpioserve

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

scorpioserve's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. After many hours of playing and help from here and other places I have managed to figure out how to login to a particular website, then submit a form that you have to be logged in to get to using cURL. The reason behind me doing this is because my client needs to submit about 40 forms a day per website, there are 3 sites, so that is 120 forms. I am hoping that I can reduce this to only 40 forms, and once they complete one they can just submit it to the other 2 without retyping or copy pasting every field. This is what I have so far, a problem is that I can not give the website username and password as it is a paid for site that my client has entrusted me with. I can tell you that the site is careerjunction.co.za and within the recruiters section. Now this site works a little different, first off there is no remember me on the login area, and it uses cookies to let me get around. If I login, it gives me a cookie, if I try login again from another computer, it gives an error and tells me I have to logout first, with a click here to logout of the other session. If I login and then click logout, a javascript window asks me if I am sure and then logs me out after pressing yes. Every month they make you change your password, and have a form come up saying old pass, new pass, repeat new pass. The script below works only if I am logged out, so this logs in then shows the form, problem is I can not do this a second time 2 days later because I have to logout first, and I can not use it if the account is already logged in. I would like to adjust the script to logout first, then login and show the form. //create a file called cookie.txt and place in site root with perms at 777 first. //logout page is "http://v1.careerjunction.co.za/usr/mltses.asp?" curl_login("http://v1.careerjunction.co.za/rec/acc/logfrmupd.asp", "Username=example&Password=example", "", "false"); echo curl_grab_page("http://v1.careerjunction.co.za/rec/my/job/jobfrm.asp?recno=-1&p=1&HideTemp=1", "", "false"); function curl_login($url,$data,$proxy,$proxydata){ $fp = fopen("cookie.txt", "w"); fclose($fp); $login = curl_init(); curl_setopt($login, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($login, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($login, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($login, CURLOPT_TIMEOUT, 40); curl_setopt($login, CURLOPT_RETURNTRANSFER, TRUE); if ($proxystatus == 'true') { curl_setopt($login, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($login, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt($login, CURLOPT_PROXY, $proxy); } curl_setopt($login, CURLOPT_URL, $url); curl_setopt($login, CURLOPT_HEADER, TRUE); curl_setopt($login, CURLOPT_USERAGENT, $SERVER['HTTP_USER_AGENT']); curl_setopt($login, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($login, CURLOPT_POST, TRUE); curl_setopt($login, CURLOPT_POSTFIELDS, $data); ob_start(); //prevent any output return curl_exec ($login); //execute the curl command ob_end_clean(); //stop preventing output curl_close ($login); unset($login); } function curl_grab_page($site,$proxy,$proxystatus){ $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); if ($proxystatus == 'true') { curl_setopt($login, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($login, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt($login, CURLOPT_PROXY, $proxy); } curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_URL, $site); ob_start(); //prevent any output return curl_exec ($ch); //execute the curl command ob_end_clean(); //stop preventing output curl_close ($ch); } The end result I would like to have is this My customer needs to have a form on their own website that once completed needs to go onto their website database, this seems simple enough for me to achieve. Then they need to be able to complete a very similar form on three other websites without logging into each and filling out the form all over again. So I would like it that once they have their own form completed, they could click a button and that would submit all the data to the relative site, therefore they would have 3 buttons one for each site they want to submit data to. I am only dealing with the first site at the moment so I have a very long way to go, and this does not even account for if they want to edit an existing form or anything like that. Whew I think I have bitten off a little more than I bargained for. Maybe a curl / php expert from here would like to PM me and we can work out some form of remuneration to help me complete this project, I have the entire site designed already and this is just part of the backend of the site. Let me know what sort of $$dolars you think it would cost to help please.
×
×
  • 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.