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?
$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);
Add an extra post field for 'submit'
Well actually, the question that would solve this program is, "How does Coppermine's register.php recognize which part of the code to execute?"
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.
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.
Never Mind All That I got it Working. Thanks for the help!