/    Sign up×
Community /Pin to ProfileBookmark

sending form using php

Hi,

How do you send a form (where variables are already given) using php without using HTML or Javascript? Right now I use:

[CODE] $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $action);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt ($ch, CURLOPT_TIMEOUT, 20); // Default Timeout
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec ($ch);
curl_close ($ch);
header(‘Location:’ . $action);
[/CODE]

But unfortunately not every server supports curl……

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMar 23.2006 — Curl is what I would use, but I can't say unequivocally that there's no other way (maybe some convoluted sequence of header() commands?).
×

Success!

Help @jiser spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...