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 7751265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:30:12+00:00 2026-06-01T11:30:12+00:00

I have used the cURL solution to solve XSS but there is an issue

  • 0

I have used the cURL solution to solve XSS but there is an issue with it.
My proxy.php file contents are:-

<?php
    $url = "http://www.yahoo.com";
    $ch = curl_init();
    $timeout = 5;
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $file_contents = curl_exec($ch);
    curl_close($ch);
    echo $file_contents;
?>

And this is how i am trying to execute php script

$("#tempButton").click(function(){
    $("#pageContent").load('http://localhost:8080/proof/proxy.php',function() {
        var t = $("#pageContent").html();
        alert(t);
    });
});

But variable t is showing the contents of proxy.php file while it is expected to show contents of yahoo.com which was set in proxy.php file. Am i doing something silly. #FirstTimePHP

  • 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-06-01T11:30:13+00:00Added an answer on June 1, 2026 at 11:30 am

    As variable t is showing the content of the file the server software must not be recognising thee script as PHP.

    There are several reasons that this may happen. Not having opening tags would be 1 but you of course have these.

    Another potential reason is that php has not been loaded as a module in the server software.

    Another potential reason is that the server does not parse files with the extension of php (this is configurable).

    You should start from basics. Ignore the javascript, instead call the url manually and see what you get. The chances are you will see the code.

    If this does happen ensure that server software (usually apache) is set to recognise the extension php is associated with the php module. Lastly ensure that PHP is actually properly installed.

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

Sidebar

Related Questions

In PHP curl there are two functions used to ignore all SSL errors (invalid
I have used curl to upload an image file Penguins.jpg . For example: C:\curl>curl
Good day, I have a script in PHP that gets contents from a URL.
I have have problem while using the cURL in my php script. Wheni used
I have a small question; In PHP I have used curl to get data
I have used getopt in Python and was hoping there would be something similar
I made a script to post comments on a page. I have used PHP
I'm trying to figure out why a cURL process (written in PHP) that used
I need to determine if a remote file exists or not. I have used
Let's assume I have the following file - template.php : <?php $string = 'Hello

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.