Jump to content

Robert Heist

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://unlockthemind.com

Profile Information

  • Gender
    Not Telling

Robert Heist's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. I am using phpBB 3.0.8 and I've asked my question on the phpBB forum (http://www.phpbb.com/community/viewtopic.php?f=46&t=2122055) and got some feedback but I need more. I wish to add a quiz that potential registrants must pass before they can register to use the forum. The quiz will be 3-5 multiple choice questions chosen at random from a pool of 50 or so. The intent is not to block spammers, but to actually test potential registrants to see if they qualify to register (if they have read a book). I believe there are 2 potential approaches I could take. One would be to edit the "registration" page which is actually a multi purpose file called ucp.php. The other is redirecting all the registration links to the quiz and emailing them an "invitation" to register if they pass the quiz which would contain the link to the actual registration page. I have looked at the code of ucp.php and I understand that it is using a switch to detect when someone arrives with the url variable "register" but I don't quite understand what is happening with: $module->load('ucp', 'register'); $module->display($user->lang['REGISTER']); For the second option I read some of the registration questions on the phpBB forum. It might be easier (better?) to change all the registration links to connect to my quiz (http://www.phpbb.com/community/viewtopic.php?f=46&t=2110354) and if they pass the quiz send them a registration code to replace the CAPCHA code (http://www.phpbb.com/community/viewtopic.php?f=46&t=2111999). It was also suggested that I might try using custom registration fields but this solution wouldn't allow for the questions to be randomly pulled from a pool or 50.
  2. Well, hand coded a simple AJAX call to set the hidden field KeyWords value to the result of a php soapclient call to the web service. I am getting a proper key and it is set but unfortunately the destination script still isn't accepting my submission though using AJAX rather than cURL has solved the broken links due to the wrong url issue. Thanks for your assistance schilly. Obviously there is something still missing. Now I guess I need to attempt to get support from the booking engine's coder. Lot of chance of that. *sigh*
  3. Yeah, I see how that would be a simpler solution. Any suggestions on a sample AJAX script to work with? I've not done an XMLHttpRequest() before and from what I just tried I am having problems because the form submits before the php script delivers the access key.
  4. I am integrating an airline ticket booking engine with a site. The booking engine provider has set up a search form that we can link to but I want to integrate the search form into our index page. In order to be able to submit to their results page I have to call their web service and get a 9 digit KeyWords access key to include in the $_POST data but this key expires virtually immediately so it can’t be generated when the index page loads, it has to be generated and appended to the $_POST data when the form is submitted. In order to accomplish this I have the form submit to a .php page on our server which queries the web service for the key, appends it to the $_POST data and then uses cURL to send it on to their ASP.NET results page. I am including the code of the .php page for your review. My question is 2 fold. The ASP.NET results page is redirecting me to a blank search form as if the proper key or fields weren’t included, but they are because when use cURL to send to a test page on my server I can output all the proper $_POST data. Is there some cross-domain issue that might cause this? Second, when cURL redirects, the url remains that of the .php page on my server rather than that of the server hosting the ASP.NET page and this causes problems with links to image files throughout the page. Is there a way with cURL to make the displayed url change too? You can see the test work at http://laosparadisetravel.com/test/test1.php but it doesn’t work when submitted to the search engine providers page. <?php /* Connect to the web service to get the KeyWords authorization string. This 9 character string authroizes the submission of the form so must be added to $_POST variables coming from the original form. Then the new set of $_POST variables are sent to the results page on the service provider's host server. */ $params->id="XXXXX"; $params->pwd="XXXXX"; $client = new SoapClient("http://www.bookingenginehost.com/IBEWS.ASMX?WSDL"); $result=$client->CheckAndGetKeyWords($params); $KeyWords=$result->CheckAndGetKeyWordsResult; $postData=""; while (list($key,$value) = each($_POST)){$postData .= $key . "=" . $value . "&";} $len=strlen($postData); $postData=substr($postData,0,($len-1)); $postData = "KeyWords=" . $KeyWords . "&" . $postData; $Curl_Session = curl_init('http://laosparadisetravel. bookingenginehost.com/Page/Common/ExternalSearcher.aspx'); // this is the test page that shows that the proper $_POST data is being passed //$Curl_Session = curl_init('http://www.laosparadisetravel.com/test/test3.php'); curl_setopt ($Curl_Session, CURLOPT_POST, 1); curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, $postData); curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); curl_exec ($Curl_Session); curl_close ($Curl_Session); ?>
×
×
  • 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.