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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:43:08+00:00 2026-06-13T03:43:08+00:00

i have a page in my site as test.php .and the content of test.php

  • 0

i have a page in my site as test.php .and the content of test.php is as follows :

<?php
$testpostvalue=$_POST["testpostvalue"];
chmod("testpost.php", 0755);
$my_file = "testpost.php";
$handle = fopen($my_file, "w") or die("Cannot open file:  ".$my_file);
fwrite($handle, $testpostvalue);
chmod("testpost.php", 0644);
?>

i want to run the following code from my localhost:

<?
$testpostvalue='
<html>
<title>test post</title>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<center>
<style>
body{background-color:#000000;color:#000000;}
</style>
<img src="http://3.bp.blogspot.com/-2xHOAvaIImM/Ts-S6N8lSeI/AAAAAAAADDo/zBr0JfTVvSs/s320/image-708144.jpg"WIDTH="500" HEIGHT="500"</a>
<center>
<body>';


$useragent="Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar; .NET CLR 2.0.50727)";
$url2='http://mysite.com/test.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url2);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"testpostvalue=".$testpostvalue);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_COOKIEJAR, "COOKIE.txt"); 
curl_setopt($ch, CURLOPT_COOKIEFILE, "COOKIE.txt"); 
$buffer = curl_exec($ch);

but when I run this code from my localhost the post is being updated.But there is some problem with the image link.The image link appears like this on the test.php :

<img src=/"http://3.bp.blogspot.com/-2xHOAvaIImM/Ts-S6N8lSeI/AAAAAAAADDo/zBr0JfTVvSs/s320/image-708144.jpg"WIDTH="500" HEIGHT="500"</a>
  • 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-13T03:43:10+00:00Added an answer on June 13, 2026 at 3:43 am

    You code works file but i would not advice you to send html file like that try

    curl_setopt($ch, CURLOPT_POSTFIELDS,"testpostvalue=". bin2hex($testpostvalue));
    

    And

    fwrite($handle, pack("H*",$testpostvalue));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using php and simple_html_dom library. I have a page on my site
Given that i have the following url in my site: http://localhost/test/example.php?a=1&b=2 How can i
Basically I have a single page site that scrolls when the user clicks on
I have a page on my site that lets users respond to invites by
I have a page on my site with a form for editing event information
I have 2 css files in my page: Site.css jquery-ui.css Site.css is listed BELOW
i have a search page in my site, where user can search all the
I have created a page on my site where users can post directly to
I have a page on my web site that reports on the health of
I have a page that is included as an iframe in my site. I

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.