By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Image placement with echo '<img src="https:/.....

P: 1
Hi, I'm new to this forum and quite new to php. Im running a webshop based on Joomla and Virtuemart. Im currently working on adding pictures with the payment methods and for that I'm using php.
I don't know if this place is the best to post this question but I thought I'll try any way.

My problem is that I want to change the placement of the pictures. Right know there is a radio button where you can choose witch payment method you like and under that there is an picture for the payment. What I like to do is to have the radio button first and to the right Ill have the picture. Does any body know how I should code this?

This is my code and is is at the bottom I have inserted the images I like to see (I have marked it with bold:

Expand|Select|Wrap|Line Numbers
  1. if( $nocc_payments &&  $cc_payments ) {
  2.     echo '<table><tr valign="top"><td width="50%">';
  3. }
  4.  
  5. if ($cc_payments==true) { 
  6.       ?>
  7.     <fieldset><legend><strong><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_PAYMENT_CC') ?></strong></legend>
  8.         <table border="0" cellspacing="0" cellpadding="2" width="100%">
  9.             <tr>
  10.                 <td colspan="2">
  11.                     <?php $ps_payment_method->list_cc($payment_method_id, false) ?>
  12.                 </td>
  13.             </tr>
  14.             <tr>
  15.                 <td colspan="2"><strong>&nbsp;</strong></td>
  16.             </tr>
  17.             <tr>
  18.                 <td nowrap width="10%" align="right"><?php echo $VM_LANG->_('VM_CREDIT_CARD_TYPE'); ?>:</td>
  19.                 <td>
  20.                 <?php echo $ps_creditcard->creditcard_lists( $db_cc ); ?>
  21.                 <script language="Javascript" type="text/javascript"><!--
  22.                 writeDynaList( 'class="inputbox" name="creditcard_code" size="1"',
  23.                 orders, originalPos, originalPos, originalOrder );
  24.                 //-->
  25.                 </script>
  26.         <?php 
  27.                     $db_cc->reset();
  28.                     $payment_class = $db_cc->f("payment_class");
  29.                     $require_cvv_code = "YES";
  30.                     if(file_exists(CLASSPATH."payment/$payment_class.php") && file_exists(CLASSPATH."payment/$payment_class.cfg.php")) {
  31.                         require_once(CLASSPATH."payment/$payment_class.php");
  32.                         require_once(CLASSPATH."payment/$payment_class.cfg.php");
  33.                         $_PAYMENT = new $payment_class();
  34.                         if( defined( $_PAYMENT->payment_code.'_CHECK_CARD_CODE' ) ) {
  35.                             $require_cvv_code = strtoupper( constant($_PAYMENT->payment_code.'_CHECK_CARD_CODE') );
  36.                         }
  37.                     }
  38.         ?>      </td>
  39.             </tr>
  40.             <tr valign="top">
  41.                 <td nowrap width="10%" align="right">
  42.                     <label for="order_payment_name"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_NAMECARD') ?>:</label>
  43.                 </td>
  44.                 <td>
  45.                 <input type="text" class="inputbox" id="order_payment_name" name="order_payment_name" value="<?php if(!empty($_SESSION['ccdata']['order_payment_name'])) echo $_SESSION['ccdata']['order_payment_name'] ?>" autocomplete="off" />
  46.                 </td>
  47.             </tr>
  48.             <tr valign="top">
  49.                 <td nowrap width="10%" align="right">
  50.                     <label for="order_payment_number"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_CCNUM') ?>:</label>
  51.                 </td>
  52.                 <td>
  53.                 <input type="text" class="inputbox" id="order_payment_number" name="order_payment_number" value="<?php if(!empty($_SESSION['ccdata']['order_payment_number'])) echo $_SESSION['ccdata']['order_payment_number'] ?>" autocomplete="off" />
  54.                 </td>
  55.             </tr>
  56.         <?php if( $require_cvv_code == "YES" ) { 
  57.                     $_SESSION['ccdata']['need_card_code'] = 1;    
  58.             ?>
  59.             <tr valign="top">
  60.                 <td nowrap width="10%" align="right">
  61.                     <label for="credit_card_code">
  62.                         <?php echo vmToolTip( $VM_LANG->_('PHPSHOP_CUSTOMER_CVV2_TOOLTIP'), '', '', '', $VM_LANG->_('PHPSHOP_CUSTOMER_CVV2_TOOLTIP_TITLE') ) ?>:
  63.                     </label>
  64.                 </td>                        
  65.                 <td>
  66.                     <input type="text" class="inputbox" id="credit_card_code" name="credit_card_code" value="<?php if(!empty($_SESSION['ccdata']['credit_card_code'])) echo $_SESSION['ccdata']['credit_card_code'] ?>" autocomplete="off" />
  67.  
  68.                 </td>
  69.             </tr>
  70.         <?php } ?>
  71.             <tr>
  72.                 <td nowrap width="10%" align="right"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_EXDATE') ?>:</td>
  73.                 <td><?php 
  74.                 $ps_html->list_month("order_payment_expire_month", @$_SESSION['ccdata']['order_payment_expire_month']);
  75.                 echo "/";
  76.                 $ps_html->list_year("order_payment_expire_year", @$_SESSION['ccdata']['order_payment_expire_year']) ?>
  77.                </td>
  78.             </tr>
  79.         </table>
  80.     </fieldset>
  81.   <?php  
  82. }
  83.  
  84. if( $nocc_payments &&  $cc_payments ) {
  85.     echo '</td><td width="50%">';
  86. }
  87.  
  88. if ($nocc_payments==true) {
  89.     if ($cc_payments==true) { 
  90.         $title = $VM_LANG->_('PHPSHOP_CHECKOUT_PAYMENT_OTHER');
  91.     }
  92.     else {
  93.         $title = $VM_LANG->_('PHPSHOP_ORDER_PRINT_PAYMENT_LBL');
  94.     }
  95.  
  96.    ?>
  97.     <fieldset><legend><strong><?php echo $title ?></strong></legend>
  98.         <table border="0" cellspacing="0" cellpadding="2" width="100%">
  99.             <tr>
  100.                 <td colspan="2"><?php 
  101.                     $ps_payment_method->list_nocheck($payment_method_id,  false); 
  102.                          echo '<img src="https://www.payson.se/sites/all/files/images/external/payson-210x80.jpg">';
  103.    echo '<br />';
  104.  
  105.                     $ps_payment_method->list_bank($payment_method_id,  false);
  106.                     echo '<br />';
  107.                     $ps_payment_method->list_paypalrelated($payment_method_id,  false);
  108.                     echo '<img src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif"><br />';
  109.                      ?>
  110.                 </td>
  111.             </tr>
  112.          </table>
  113.     </fieldset>
  114.     <?php
  115. }
  116.  
  117. if( $nocc_payments &&  $cc_payments ) {
  118.     echo '</td></tr></table>';
  119. }
  120.   ?>
  121.  
Hope some understands what I like to do and can help. Sorry for my bad English.

Regards
Anni
May 23 '10 #1
Share this Question
Share on Google+
1 Reply


dlite922
Expert 100+
P: 1,584
if this is done on the client (in the browser) and not on the server, than you need JavaScript to do this.

hint: look at document object and the onclick attribute.

Dan
May 25 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.