Jump to content

PSM

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PSM's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Page with form displays like attached. Form still removes the keyword. [attachment deleted by admin]
  2. Hi, I get an error on line 11: echo '$_POST['keyword'] Assigned Value = <table border="1"><tr><th> '.$_POST['keyword'].' </th></tr></table><br>';
  3. hi Muddy, Upon entering the search term and hitting submit, I get redirected to the external site, but without any keywords eg, http://www.domain.com/default.aspx?st=FT&ss=
  4. @ Muddy_Funster To answer your questions: 1. Where, other than the page that you have posted the code from, is 'keyword' assigned? Nowhere - just this search form 2. is the page that you have posted the code from actualy default.aspx? Yes, and it is working if I navigate to : http://www.domain.com/default.aspx?st=FT&ss=keyword1 http://www.domain.com/default.aspx?st=FT&ss=keyword2 http://www.domain.com/default.aspx?st=FT&ss=keyword3 That side is ready to go, just need to get the keyword search to convert into the end of the url. @zenlord As mentioned, I'm not so good with PHP, but following your advice, I tried: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form method="post" id="searchform" action="http://www.domain.com/default.aspx?st=FT&ss=<?php echo 'keyword'; ?>" /> <input type="text" name="keyword" id="se" size="35" value="search..." class="text" /> <input type="submit" id="searchsubmit" class="submit" value="Send" /> </form> <?php $keyword = htmlspecialchars($_POST['keyword']); array($keyword , create_function('&$v,$k', '$v = $k."=".$v ;')); echo '<a href="http://www.domain.com/default.aspx?st=FT&ss=', urlencode($userinput), '">'; ?> </body> </html> But that failed miserably. This is like learning ancient chinese...(!) I'd appreciate your guidance and time zenlord
  5. @hebeeb this is nothing like what I'm trying to achieve (thanks though!). All I need is: 1. Search box + submit button in html page 2. I enter in the search: telephone When i submit, I want the user to be directed to page with the keyword in the url like: http://www.domain.com/default.aspx?st=FT&ss=telephone I don't need to display results as the link is already waiting for this incoming url.
  6. Hi guys, I'm not so good with PHP (hence my post here). Other forums have suggested using javascript, but if not enabled by the user, then it's not much good). I'm trying to set up a search box with submit button. For any keywords searched for, I would like the search terms sent to an external site in the format: http://www.domain.com/default.aspx?st=FT&ss=XXXXX (where XXXXX is the keyword). So far, I have: <?php $keyword = htmlspecialchars($_POST['keyword']); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form method="post" id="searchform" action="http://www.domain.com/default.aspx?st=FT&ss=<?php echo 'keyword'; ?>" /> <input type="text" name="keyword" id="se" size="35" onblur="if (this.value == '') {this.value = 'search...';}" onfocus="if (this.value == 'search...') {this.value = '';}" value="search..." class="text" /> <input type="submit" id="searchsubmit" class="submit" value="Send" /> </form> </body> </html> .and although it directs to the url, the keyword(s) is not present. Any help would be appreciated.
  7. Hi. Thanks for your speedy response. This will be used outside of Opencart, so they want something that is non-template based and (if possible), all PHP
  8. Hi guys, I need some help from you pro's please with converting code from a TPL template file to PHP. My client has payment gateway scripts in an ecommerce site that he wants to offer to other merchants. The code currently is in numerous TPL files (currently being used in Opencart). What is involved in converting to plain ol' PHP? Do I need the TPL files at all? Can I rename the TPL extension to PHP as it looks like they contain PHP code?? Example of one of the TPL's is below: <form action="<?php echo $action; ?>" method="post" id="checkout"> <input type="hidden" name="instId" value="<?php echo $merchant; ?>" /> <input type="hidden" name="cartId" value="<?php echo $order_id; ?>" /> <input type="hidden" name="amount" value="<?php echo $amount; ?>" /> <input type="hidden" name="currency" value="<?php echo $currency; ?>" /> <input type="hidden" name="desc" value="<?php echo $description; ?>" /> <input type="hidden" name="name" value="<?php echo $name; ?>" /> <input type="hidden" name="address" value="<?php echo $address; ?>" /> <input type="hidden" name="postcode" value="<?php echo $postcode; ?>" /> <input type="hidden" name="country" value="<?php echo $country; ?>" /> <input type="hidden" name="tel" value="<?php echo $telephone; ?>" /> <input type="hidden" name="email" value="<?php echo $email; ?>" /> <input type="hidden" name="testMode" value="<?php echo $test; ?>" /> </form> <div class="buttons"> <table> <tr> <td align="left"><a onclick="location = '<?php echo $back; ?>'" class="button"><span><?php echo $button_back; ?></span></a></td> <td align="right"><a onclick="$('#checkout').submit();" class="button"><span><?php echo $button_confirm; ?></span></a></td> </tr> </table> </div> I also have 3 PHP files as well, which look like (example): <?php class ControllerPaymentOnlineVoucher extends Controller { protected function index() { $this->data['button_confirm'] = $this->language->get('button_confirm'); $this->data['button_back'] = $this->language->get('button_back'); $this->load->model('checkout/order'); $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); $this->load->library('encryption'); $this->data['action'] = 'https://www.domain-removed.com/purchaseAndRedeem.php'; $this->data['merchant'] = $this->config->get('onlineVoucher_merchant'); $this->data['order_id'] = $order_info['order_id']; $this->data['amount'] = $order_info['total']; $this->data['currency'] = $order_info['currency']; $this->data['description'] = $this->config->get('config_store') . ' - #' . $order_info['order_id']; $this->data['name'] = $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname']; if (!$order_info['payment_address_2']) { $this->data['address'] = $order_info['payment_address_1'] . ', ' . $order_info['payment_city'] . ', ' . $order_info['payment_zone']; } else { $this->data['address'] = $order_info['payment_address_1'] . ', ' . $order_info['payment_address_2'] . ', ' . $order_info['payment_city'] . ', ' . $order_info['payment_zone']; } $this->data['postcode'] = $order_info['payment_postcode']; $payment_address = $this->customer->getAddress($this->session->data['payment_address_id']); $this->data['country'] = $payment_address['iso_code_2']; $this->data['telephone'] = $order_info['telephone']; $this->data['email'] = $order_info['email']; $this->data['test'] = $this->config->get('onlineVoucher_test'); $this->data['back'] = $this->url->https('checkout/payment'); $this->id = 'payment'; $this->template = $this->config->get('config_template') . 'payment/onlineVoucher.tpl'; $this->render(); } public function callback() { if (isset($this->request->post['callbackPW']) && ($this->request->post['callbackPW'] == $this->config->get('onlineVoucher_password'))) { $this->language->load('payment/onlineVoucher'); $this->data['title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_store')); if (!isset($this->request->server['HTTPS']) || ($this->request->server['HTTPS'] != 'on')) { $this->data['base'] = HTTP_SERVER; } else { $this->data['base'] = HTTPS_SERVER; } $this->data['charset'] = $this->language->get('charset'); $this->data['language'] = $this->language->get('code'); $this->data['direction'] = $this->language->get('direction'); $this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_store')); $this->data['text_response'] = $this->language->get('text_response'); $this->data['text_success'] = $this->language->get('text_success'); $this->data['text_success_wait'] = sprintf($this->language->get('text_success_wait'), $this->url->https('checkout/success')); $this->data['text_failure'] = $this->language->get('text_failure'); $this->data['text_failure_wait'] = sprintf($this->language->get('text_failure_wait'), $this->url->https('checkout/payment')); $this->data['button_continue'] = $this->language->get('button_continue'); if (isset($this->request->post['transStatus']) && $this->request->post['transStatus'] == 'Y') { $this->load->model('checkout/order'); $this->model_checkout_order->confirm($this->request->post['cartId'], $this->config->get('onlineVoucher_order_status_id')); $message = ''; if (isset($this->request->post['transId'])) { $message .= 'transId: ' . $this->request->post['transId'] . "\n"; } if (isset($this->request->post['transStatus'])) { $message .= 'transStatus: ' . $this->request->post['transStatus'] . "\n"; } if (isset($this->request->post['countryMatch'])) { $message .= 'countryMatch: ' . $this->request->post['countryMatch'] . "\n"; } if (isset($this->request->post['AVS'])) { $message .= 'AVS: ' . $this->request->post['AVS'] . "\n"; } if (isset($this->request->post['rawAuthCode'])) { $message .= 'rawAuthCode: ' . $this->request->post['rawAuthCode'] . "\n"; } if (isset($this->request->post['authMode'])) { $message .= 'authMode: ' . $this->request->post['authMode'] . "\n"; } if (isset($this->request->post['rawAuthMessage'])) { $message .= 'rawAuthMessage: ' . $this->request->post['rawAuthMessage'] . "\n"; } if (isset($this->request->post['wafMerchMessage'])) { $message .= 'wafMerchMessage: ' . $this->request->post['wafMerchMessage'] . "\n"; } $this->model_checkout_order->update($this->request->post['cartId'], $this->config->get('onlineVoucher_order_status_id'), $message, FALSE); $this->data['continue'] = $this->url->https('checkout/success'); $this->template = $this->config->get('config_template') . 'payment/onlineVoucher_success.tpl'; $this->render(); } else { $this->data['continue'] = $this->url->https('checkout/payment'); $this->template = $this->config->get('config_template') . 'payment/onlineVoucher_failure.tpl'; $this->render(); } } } } ?> Any guidance would be highly appreciated... Phil
×
×
  • 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.