473,388 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

sending form post data

How can I have a php script send data to a URL as form post data from
within the script without creating an actual form in a web page.

I am working with an affiliate program (from Affiliateshop) and the
instructions are 'have your script send a form post with the name of the
form fields "AID" and "BID" and their values to the following URL string...'

Thanks

james
Jul 17 '05 #1
3 4582
james <jd@venus.com> wrote:
How can I have a php script send data to a URL as form post data from
within the script without creating an actual form in a web page.


You are the first person to ask that question here... But not really:
http://groups.google.co.uk/groups?as...=comp.lang.php

:)

Jul 17 '05 #2
and you might want to see if a GET works..
instructions could have been written by a bonehead

Jul 17 '05 #3
You need PEAR class (http://pear.php.net/package/HTTP_Request)

require_once "Request/Request.php";
$req =& new HTTP_Request("{URL}/");
$req->addHeader("Content-Type", "application/x-www-form-urlencoded");
$req->addPostData("{vaiable}", "{value}");
....
if (!PEAR::isError($req->sendRequest())) {
$response1 = $req->getResponseBody();
} else {
$response1 = "";
}

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Jochen Daum | last post by:
Hi! I have a function in a lot of pages, which redirects to a new page, if a form has been submitted: if (!(defined("DEBUG_INSERT") && DEBUG_INSERT) && !(defined("DEBUG_UPDATE") &&...
3
by: Ot?vio | last post by:
Hi! I'm havin a problem about sending a binary file with fsockopen. My problem is solved when i do: -------------------->8------CODE----------------------------- <form...
2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
5
by: fochie | last post by:
Greetings, I'm trying to send data to my server using xmlhttp POST. The data being sent is actually an HTML page that is built with javascript in the browser. The HTML code contains a small...
1
by: JoeB | last post by:
hi, Im trying to send data (raw bytes) to a web server. I cannot figure out how to do it. I need the data to be read by PHP which i have already written. The data must be post data. I also...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
0
by: Ricardo Magalhaes | last post by:
Hi, I have an ASPX page and I need to call an ASP page sending parameters like Name, Adress, ie. using POST method. This next ASP page show payment informations.. If was from an ASP to...
1
by: R.A.M. | last post by:
Hello, I have written an .aspx page which calls Calendar.aspx page to select birth date which should be assign to some text box control on first page. Here's the code of first page: Birthdate:...
10
by: James | last post by:
Hello, as this falls under both VB and PHP I have posted this into two newsgroups (this is the first time I've done this so if it is mucked up then I'm sorry). Anyway I want to make some simple...
0
by: sanjaygupta11 | last post by:
I am using httpwebrequest and httpwebresponse objects for sending data to remote appication by post and receiving the response from there. I am using this code in my windows application which will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.