Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6183911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:26:47+00:00 2026-05-24T01:26:47+00:00

I am trying to get the html code of a protected page. I am

  • 0

I am trying to get the html code of a protected page. I am aiming to restyle this page with css, so I need tho get the html code first !!!

I have a valid username and password.

I have tried to use cURL, but I always end up with this message: “the stub received bad data”

the url of the page is: http://student.guc.edu.eg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:26:48+00:00Added an answer on May 24, 2026 at 1:26 am

    Do you have any code already? You need to use code such as this, utilising CURLOPT_HTTPAUTH and CURLOPT_USERPWD specifically.

    $username = 'studentid';
    $password = 'studentpassword';
    
    $ch = curl_init("http://student.guc.edu.eg/");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
    $html = curl_exec($ch);
    curl_close($ch);
    

    CURLOPT_HTTPAUTH

    The HTTP authentication method(s) to use. The options are: CURLAUTH_BASIC, CURLAUTH_DIGEST, CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLAUTH_ANY, and CURLAUTH_ANYSAFE.

    The bitwise | (or) operator can be used to combine more than one method. If this is done, cURL will poll the server to see what methods it supports and pick the best one.

    CURLAUTH_ANY is an alias for CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.

    CURLAUTH_ANYSAFE is an alias for CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.

    CURLOPT_USERPWD

    A username and password formatted as “[username]:[password]” to use for the connection.


    Looking at the headers returned from the site http://student.guc.edu.eg/, it’s as follows:

    > curl -I http://student.guc.edu.eg/
    HTTP/1.1 401 Access Denied
    Server: Microsoft-IIS/5.0
    Date: Thu, 21 Jul 2011 08:18:34 GMT
    WWW-Authenticate: NTLM
    WWW-Authenticate: Basic realm="student.guc.edu.eg"
    Connection: close
    Content-Length: 4431
    Content-Type: text/html
    

    This means that rather than using CURLAUTH_BASIC, you should try CURLAUTH_NTLM, and see if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application in which I need to get the HTML code
I'm trying to get a webstageview to load a local html file....this code works
I have the following html code from an url, and i'm trying to get
I am trying to get a working regular expression to convert standard HTML code
I'm trying to get a HTML source of a website through C# code. When
I'm trying to get an html page to display an XML file formatted with
I'm trying to get the height of a html window's content. This is the
I'm trying to get html content. Everything works in AsyncTask thread. This is my
I'm trying to get the HTML of a selected object with jQuery. I am
I am trying to get the html value of a linked clicked. The links

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.