Author Topic: logging into server - getting data (HTTPS protection)  (Read 165 times)

poscore

  • New Member
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
logging into server - getting data (HTTPS protection)
« on: May 26, 2012, 06:53:50 PM »
Hi guys,

i am new to PHP and a bit old to programming. I am trying to make a script that can loggin and pass via HTTPS get a page and return this page to a string. I have made somework but nothing is complete yet. My real problem is an error() that appear and dont know what to do. There is no error number its just an error and a message to contat with system admin. My code is the following:
Code: [Select]
<?php
        $access 
curl_init();
        
curl_setopt($accessCURLOPT_URL"https://cronos.cc.uoi.gr/unistudent/login.asp");
        
curl_setopt($accessCURLOPT_HEADERfalse);
        
curl_setopt($accessCURLOPT_SSL_VERIFYPEERfalse);
        
curl_setopt($accessCURLOPT_SSL_VERIFYHOSTfalse);
        
curl_setopt($accessCURLOPT_POSTtrue);
        
curl_setopt($accessCURLOPT_POSTFIELDS'userName=xxxx&pwd=xxxx&submit1=%C5%DF%F3%EF%E4%EF%F2&loginTrue=login');
        
curl_setopt($accessCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt($accessCURLOPT_USERAGENT"Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0");
        
curl_setopt($accessCURLOPT_FOLLOWLOCATIONtrue);
        
curl_setopt($accessCURLOPT_AUTOREFERER"https://cronos.cc.uoi.gr/unistudent/login.asp");
        
$httppage curl_exec($access);
        echo 
$httppage;
        
curl_close($access);
?>


richei

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 1130
  • Karma: 22
    • View Profile
Re: logging into server - getting data (HTTPS protection)
« Reply #1 on: May 28, 2012, 10:18:13 PM »
What's the error message?

poscore

  • New Member
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: logging into server - getting data (HTTPS protection)
« Reply #2 on: May 29, 2012, 04:41:34 AM »
It was a general error message that i couldnt connect "Please contact with admin.".

Nevermind i solved it!