Jump to content

drillbitt

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

drillbitt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. YES!! - Aaron You Are A Total Diamond!! Thankyou so much!
  2. I tried adding the code as specified and uploaded as .htaccess file When I completed the form it subscribed me to the old version of the script and seemed to ignore the new one completely. Thanks again for your help on this one!
  3. Hey Aaron, Do I save that as the same .htaccess type file? Sorry if thats a daft question, my learning curve on this subject is almost vertical, so thanx for your patience!
  4. It directs to the new script, but the error message appears: Incorrect form Sorry but an error has occured. Please use the correct form to subscribe. It seems strange, because all the details of the form submission are the same, including all the identifiers...
  5. COOL!! I think i'm almost there! The error has gone, and the .htaccess file is certainly redirecting the user to the new signup page as I wanted... I am however receiving an error message regarding the signup process (But at least this time its coming from the correct script!!) Heres the old code, along with the new, apart from the URL, I can't see any difference, but when i test it I receive an error message saying I'm using the wrong form to subscribe: Old Code: <script language="JavaScript"> function checkSub(){ if (document.signup.email.value.indexOf('@', 0) == -1) { alert("Please fill in your valid Email address.\nYour email should be in the following format: email@address.com") document.signup.email.focus() return false} if (document.signup.fname.value == "") { alert("Please fill in your First name.") document.signup.fname.focus() return false} }</script><form action="http://mysite.com/cgi-bin/ent/optin.cgi" method="post" name="signup" onsubmit="return checkSub()"><input type=hidden name="action" value="addlead"><input type=hidden name="member" value="1"><input type=hidden name="auto" value="1"><input type=hidden name="thankyou" value=""><table border=0 cellspacing=0 cellpadding=2><tr><td><font size="2" face="arial, verdana">First Name:</font></td><td><input type=text size=20 name="fname"></td></tr><tr><td><font size="2" face="arial, verdana">Email Address:</font></td><td><input type=text size=20 name="email"></td></tr><tr><td></td><td align=center><input type="submit" value="Subscribe"></td></tr></table></form> And the code generated by the new script is: <script language="JavaScript"> function checkSub(){ if (document.signup.email.value.indexOf('@', 0) == -1) { alert("Please fill in your valid Email address.\nYour email should be in the following format: email@address.com") document.signup.email.focus() return false} if (document.signup.fname.value == "") { alert("Please fill in your First name.") document.signup.fname.focus() return false} }</script><form action="http://mysite.com/v2/ar/optin.php" method="post" name="signup" onsubmit="return checkSub()"><input type=hidden name="action" value="addlead"><input type=hidden name="member" value="1"><input type=hidden name="auto" value="1"><input type=hidden name="thankyou" value=""><table border=0 cellspacing=0 cellpadding=2><tr><td><font size="2" face="arial, verdana">First Name:</font></td><td><input type=text size=20 name="fname"></td></tr><tr><td><font size="2" face="arial, verdana">Email Address:</font></td><td><input type=text size=20 name="email"></td></tr><tr><td></td><td align=center><input type="submit" value="Subscribe"></td></tr></table></form> I can't see any difference. Any idea what might be causing it? It feels like I'm SO close now!
  6. I tried this : Redirect /home/username/public_html/cgi-bin/optin.cgi http://sitename.com/v2/ar/optin.php as the .htaccess file. based on the guidance given here: http://www.javascriptkit.com/howto/htaccess7.shtml I uploaded it to the root folder, but It didn't do anything at all, it allowed the cgi-bin/optin.cgi file to process the form. Did i miss something crucial?? EDIT: tried again and received a 500 error...any ideas??
  7. Hi rhodesa Thanks for the reply Unfortunately my knowledge of using Htaccess files is REALLY limited... Can anyone point me in the right direction where I could get some more detail on creating this type of thing?? Thanks!
  8. Hey Guys, I have just upgraded a script, which as well as many other things is now php based as opposed to it being previously CGI The issue I have is, the script features a subscription option, which of couse submits not only to a different locatation now, but also has changed to php. i have migrated all my script users over to the new version, and whilst i have told them about updating the form codes on their pages, I wondered how I set up a permanent form-redirect cgi page, for those few optin forms that slip through the update? Bottom line is I want any form thats submitted to http://mysite.com/cgi-bin/optin.cgi to be re-directed (Or re-posted, not sure which syntax is correct!) to http://mysite.com/newscript/optin.php (All other details of the form are identical) Is this at all possible?? Cheers!
  9. Cool...! So that gets rid of the error message... But now Im lost as to what I do next! I'm assuming logincurl.php has posted the data to the other script... I just don't understand how I get the user to go there now? Do I need to set up a redirect or something? Cheers
  10. Hi Guys, I'm trying to POST data to a login.php script, and am totally stuck! I have a members area which when logged in, I want my members to be able to be able to access another script within it. Unfortunately the 3rd party script is ioncube encoded, but uses a login.html template to submit the log on details. Ive managed to ##HASH## together a way that the users details match the details of my membership script, so I entered $Username & $password as the default values of the login.html, with the hope that by just creating a link to 3rdpartyscript/login.php it would replace the details and log the user in. This worked (in a fashion) but it seems to me It would be easier to use the cURL function... Which is where I become totally lost! I created logincurl.php as below: <?php //create array of data to be posted $post_data['email'] = '<?php echo $username; ?>'; $post_data['password'] = '<?php echo $password; ?>'; //create the final string to be posted using implode() $post_string = implode ('&', $post_items); //create cURL connection $curl_connection = curl_init('http://wizardresponder.com/v2/members/login.php'); //set options curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); //set data to be posted curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); //perform our request $result = curl_exec($curl_connection); //show information regarding the request print_r(curl_getinfo($curl_connection)); echo curl_errno($curl_connection) . '-' . curl_error($curl_connection); //close the connection curl_close($curl_connection); which I (presume) I then point the link in the members area to, and was sorta assuming that would log them on... but all I get is Warning: implode() [function.implode]: Invalid arguments passed in /home/randp/public_html/v2/logincurl.php on line 6 Array ( [url] => http://wizardresponder.com/v2/members/login.php [content_type] => text/html [http_code] => 200 [header_size] => 262 [request_size] => 211 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.014451 [namelookup_time] => 0.002115 [connect_time] => 0.002393 [pretransfer_time] => 0.00241 [size_upload] => 0 [size_download] => 4564 [speed_download] => 315825 [speed_upload] => 0 [download_content_length] => 4564 [upload_content_length] => 0 [starttransfer_time] => 0.014373 [redirect_time] => 0 ) 0- So that didn't work at all... Am I totally missing the point here?? I thought I'd then have a go at using cURL to create the account in the 3rdparty script, so I tried this: <?php //create array of data to be posted $post_data['package'] = 'Standard'; $post_data['packkey'] = '4fbb470fe39d70d3705e8447bd2223'; $post_data['email'] = '<?php echo $username; ?>'; $post_data['password'] = '<?php echo $password; ?>'; $post_data['fname'] = 'fname'; $post_data['lname'] = 'lname'; $post_data['address'] = 'address'; $post_data['city'] = 'city'; $post_data['state'] = 'state'; $post_data['zip'] = 'zip'; $post_data['country'] = 'country'; $post_data['website'] = 'website'; $post_data['weburl'] = 'weburl'; $post_data['action'] = 'Create Account'; //create the final string to be posted using implode() $post_string = implode ('&', $post_items); //create cURL connection $curl_connection = curl_init('http://wizardresponder.com/v2/newuser/index.php'); //set options curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); //set data to be posted curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); //perform our request $result = curl_exec($curl_connection); //show information regarding the request print_r(curl_getinfo($curl_connection)); echo curl_errno($curl_connection) . '-' . curl_error($curl_connection); //close the connection curl_close($curl_connection); ?> but just got back: Warning: implode() [function.implode]: Invalid arguments passed in /home/randp/public_html/v2/mycurl.php on line 18 Array ( [url] => http://wizardresponder.com/v2/newuser/index.php [content_type] => text/html [http_code] => 200 [header_size] => 262 [request_size] => 211 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.013726 [namelookup_time] => 0.006687 [connect_time] => 0.007158 [pretransfer_time] => 0.007169 [size_upload] => 0 [size_download] => 1548 [speed_download] => 112778 [speed_upload] => 0 [download_content_length] => 1548 [upload_content_length] => 0 [starttransfer_time] => 0.013641 [redirect_time] => 0 ) 0- All im tring to do is create a link from the members area that when clicked, automatically logs the user into the other script without them having to re-enter their details...And its driving me crazy!! If anyone could point me in the right direction, that't be so cool!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.