Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: CuRL Registration  (Read 3272 times)

0 Members and 1 Guest are viewing this topic.

buddybuddha

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
CuRL Registration
« on: August 15, 2005, 02:22:42 am »

For my site I am doing my registrations through CuRL so that I can have all my various services integrated.  When I run the following script with input from an html form, however, instead of a registration I get a view of the agreement.  How do I stop this from happening?

Code: [Select]
$ch = curl_init("http://www.buddybuddha.net/Version3/PhotoGall/register.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=' . $user . '&password=' . $pass . '&password_verification=' . $pass . '&email=' . $mail);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.buddybuddha.net/Version3/PhotoGall/register.php");
curl_exec($ch);
curl_close($ch);
Logged

Nibbler

  • Guest
Re: CuRL Registration
« Reply #1 on: August 15, 2005, 02:34:37 am »

Add an extra post field for 'submit'
Logged

buddybuddha

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: CuRL Registration
« Reply #2 on: August 15, 2005, 02:38:19 am »

Well actually, the question that would solve this program is, "How does Coppermine's register.php recognize which part of the code to execute?"
« Last Edit: August 15, 2005, 02:44:54 am by buddybuddha »
Logged

Nibbler

  • Guest
Re: CuRL Registration
« Reply #3 on: August 15, 2005, 02:50:35 am »

If the request includes a 'submit' POST field then it processes the data, if it does not it will show the disclaimer. There's also code to take care of activation but that is irrelevent. Take a look at the source code, it's fairly straightforward.
Logged

buddybuddha

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: CuRL Registration
« Reply #4 on: August 15, 2005, 02:59:23 am »

Ive been looking at the source code and I just noticed that at the bottom.  So are you saying to change

curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=' . $user . '&password=' . $pass . '&password_verification=' . $pass . '&email=' . $mail);

to

curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=' . $user . '&password=' . $pass . '&password_verification=' . $pass . '&email=' . $mail . '&submit');

?

I apologize for being so novice with this.  My native language is Perl and I do very liitle work with postfields, headers, etc.
Logged

buddybuddha

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: CuRL Registration
« Reply #5 on: August 15, 2005, 03:06:02 am »

Never Mind All That I got it Working.  Thanks for the help!
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 16 queries.