473,385 Members | 1,630 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,385 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 4581
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.