How Can I Achieve This...?I Really Need You

by filiks
7 replies
Hi Guys,
im new to php and i need a help fixing up my site. i have a code that is linking to an online payment site but i want the link to go instead to emails of my assistants... so instead of going to paypal i want the link to go to info@example.com, admin@example.com,tickects@example.com. please how can i achieve this.

i have included the codes here for you to see.


Code:
<?php get_header();?>  
<?php
global $wpdb;
echo tgt_get_inner_background();
require_once dirname( __FILE__ ) . '/functions/form_process.php';
if(count($get_room)< $num_rooms)
{
?>     
        <div class="localization">
            <p class="site-loc">
                <a href="<?php echo HOME_URL;?>" style="color:white">
                    <?php echo get_option('tgt_hotel_name');?>
                </a>
            </p>
            <p>&raquo;&nbsp;<?php _e('Booking payment','hotel'); ?></p>
        </div>
         <div style="clear:both;"></div>         
            <div class="middle-inner">
                   <div class="center-inner">
                <div class="title">                
                    <p class="h1"><?php _e('Booking','hotel'); ?></p>
                     <font color="#FF0000" style="font-size:14px;"><?php _e('Booking has a problem, please try again', 'hotel'); ?></font>
                    <div style="clear:left;"></div>                        
                    <div id="search" style="margin-top:15px; float:left; margin-left:0;">  
                        <div id="search_left"></div>       
                                <div id="search_center"><a href="#dialog" name="modal"><?php _e('Back','hotel'); ?></a></div>
                        <div id="search_right"></div>
                    </div>
                 </div>
                </div>
             </div>         
<?php    
}else {
require_once dirname( __FILE__ ) . '/booking_sub.php';
$guest_in_room = $num_adults + $num_kids;
?> 

               <div class="localization">
                <p class="site-loc">
                    <a href="<?php echo HOME_URL;?>" style="color:white">
                        <?php echo get_option('tgt_hotel_name');?>
                    </a>
                </p><p>&raquo;&nbsp;<?php _e('Booking payment','hotel'); ?></p>
              </div>
         <div style="clear:both;"></div>         
            <div class="middle-inner">
                   <div class="center-inner">
                <div class="title">                
                <p class="h1"><?php _e('Booking','hotel'); ?></p>
                
                <div class="contact-form" style="margin:15px 0;">
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="booking2"><strong><?php _e('Arrival/Check-in','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo date('d M y',$arrival_date); ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Departure/Check-out','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo date('d M y',$departure_date); ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Rooms Type','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $room_type->post_title; ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Number Rooms','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $num_rooms; ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Occupancy','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $num_adults.'&nbsp;'.__('Adult(s)','hotel'); ?>&nbsp;<?php echo __('and','hotel').'&nbsp;'.$num_kids.'&nbsp;'.__('Kid(s)','hotel'); ?></td>
                            </tr>
                                                  
                            <tr>
                                <td class="booking2"><strong><?php _e('Day(s)','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $day_rate; ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Guests per Room','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $guest_in_room; ?></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Price per room','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $room_price.' '.$currencysymbol; ?></td>
                            </tr>
                            
                            <?php if($room_discount != '' && $room_discount > 0) { ?>
                            <tr>
                                <td class="booking2"><strong><?php _e('Discount','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $room_discount.' %'; ?></td>
                            </tr>
                            <?php } ?>
                           
                            <tr>
                                <td class="booking2"><strong><?php _e('Deposit','hotel'); ?></strong></td>
                                <td class="booking2"><?php echo $deposit.' %'; ?></td>
                            </tr>
                           
                            <tr>
                                <td class="booking2" style="color:#955845;"><strong><?php _e('Total Charges','hotel'); ?></strong></td>
                                <td class="booking2" style="color:#955845;"><strong><?php echo $paid.' '.$currencysymbol; ?></strong></td>
                            </tr>
                        </tbody>
                    </table>
                    
                    <div id="search" style="margin-top:15px; float:right;">  
                            <div id="search_left"></div>        
                                    <div id="search_center"><a target="_blank" href="<?php echo tgt_get_link_term(); ?>"><?php _e('Terms &amp; Conditions','hotel');?></a></div>
                            <div id="search_right" style="background: url('<?php echo TEMPLATE_URL;?>/images/search-btnright4.png')"></div>
                        </div>
                </div>
                
                <div style="clear:both;"></div>    
                
                <div class="contact-form">
                    <p class="h1" style="color:#282323; padding-bottom:10px; font:35px Georgia;"><?php _e('Traveller Details','hotel'); ?></p>
                    <!-- start fill info -->
                    <div id="fill_info" style="display:">
                    <form method="post" name="form_fill_info" id="form_fill_info" action="" > 
                    
                    <div style="width:290px; float:left;">   
                        <div class="input-content">
                               <p><?php _e('Title :','hotel');?></p>
                            <select class="select2" name="s_title" id="s_title">
                                            <option value="Mr."><?php _e('Mr.','hotel'); ?></option>
                                            <option value="Mrs."><?php _e('Mrs.','hotel'); ?></option>
                                            <option value="Ms."><?php _e('Ms.','hotel'); ?></option>
                            </select>
                        </div>              
                        <div class="input-content">
                            <p><?php _e('First Name :','hotel');?>*</p>
                              <input class="input" type="text"  name="first_name" id="first_name" size="15" />
                            <p id="first_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div>  
                        <div class="input-content">
                            <p><?php _e('Phone :','hotel');?>*</p>
                              <input class="input" type="text" name="phone" id="phone" size="15" />
                            <p id="phone_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div>  
                        <div class="input-content">
                            <p><?php _e('City/State :','hotel');?>*</p>
                            <input class="input" type="text" name="state" id="state" size="15" />
                            <p id="state_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div>                                              
                    </div>
                     <div style="width:290px; float:left;">   
                         <div class="input-content">
                            <p><?php _e('Email :','hotel');?>*</p>
                              <input class="input" type="text" name="email" id="email" size="15" />
                            <p id="email_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div> 
                        <div class="input-content">
                            <p><?php _e('Last Name :','hotel');?>*</p>
                              <input class="input" type="text" name="last_name" id="last_name" size="15" />
                            <p id="last_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div>
                        <?php 
                        $country = tgt_get_countries(TEMPLATE_URL.'/data/countries.xml');    
                        $def_country = get_option('tgt_hotel_country');
                        ?>
                        <div class="input-content">
                            <p><?php _e('Country :','hotel');?>*</p>                            
                            <select name="country" id="country" class="select2" >
                            <?php
                            foreach ($country as $k=>$v)
                            {
                            ?>
                                <option value="<?php echo $k; ?>" <?php if($def_country == $k) echo 'selected="selected"' ?>><?php echo $k; ?></option>
                            <?php    
                            }
                            ?>
                            </select>                            
                        </div>                       
                        <div class="input-content">
                            <p><?php _e('Street :','hotel');?>*</p>
                              <input class="input" type="text" name="street" id="street" size="15" />
                            <p id="street_err" style="width:auto; font-weight:normal; font-size:12px; color:#FF0000;"></p>
                        </div>                        
                    </div>   
                    <div class="input-content" style="float:left; width:600px; margin-top:10px;">
                            <input style="float:left; margin-right:10px;" type="checkbox" id="check_agree"  name="check_agree"> <p style="font-size:12px; font-weight:normal;">
<?php _e('Yes, I agree that my credit card will be charged at the time of booking according to the rate deposit or prepay policy.','hotel'); ?></p>
                        </div> 
                        <div style="clear:left;"></div>                        
                            <div id="search" style="margin-top:0; float:left; margin-left:0;">  
                            <div id="search_left"></div>       
                                    <div id="search_center"><a href="#dialog" name="modal"><?php _e('Change Date','hotel'); ?></a></div>
                            <div id="search_right" style="background: url('<?php echo TEMPLATE_URL;?>/images/search-btnright4.png')"></div>
                        </div>
                        
                        <div id="search" style="margin-top:0; margin-left:0; float:right;">  
                            <div id="search_left"></div>        
                                    <div id="search_center">
                                    <input type="button" name="submit_continue" onclick="fill_data('fill_info');" value="<?php _e('Continue','hotel');?>" id="butt_save" class="png" />
                                    </div>
                            <div id="search_right"></div>
                        </div>
                
                    </form>                    
                </div>
                <div style="clear:both;"></div>
                </div>
                <!-- end fill info -->
                <!-- start list info -->
                <div id="list_info" style="display:none">                                 
                <div class="contact-form" style="margin:15px 0;">
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="booking2" width="47%"><strong><?php _e('Customer','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_full_name"></div></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Email','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_email"></div></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Phone','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_phone"></div></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('Country','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_country"></div></td>
                            </tr>
                            
                            <tr>
                                <td class="booking2"><strong><?php _e('State','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_state"></div></td>
                            </tr>                            
                           
                            <tr>
                                <td class="booking2"><strong><?php _e('Street','hotel'); ?></strong></td>
                                <td class="booking2"><div id="show_street"></div></td>
                            </tr>                           
                            
                        </tbody>
                    </table>
                <?php                 
                if($paid == 0 || get_option('tgt_permit_payment') == 0) 
                { 
                ?>
                    <form method="POST" name="submit_payment_free" id="submit_payment_free" action="<?php echo tgt_free_payment_link (); ?>" >
                    <input type="hidden" name="pay_free" value="yes">
                    <input type="hidden" name="u_id_free" id="u_id_free">
                    <input type="hidden" name="room_type_free" id="room_type_free" value="<?php echo $room_type->ID; ?>">
                    <input type="hidden" name="num_rooms_free" id="num_rooms_free" value="<?php echo $num_rooms; ?>">
                    <input type="hidden" name="date_in_free" id="date_in_free" value="<?php echo $date_in; ?>">
                    <input type="hidden" name="date_out_free" id="date_out_free" value="<?php echo $date_out; ?>">
                    <div style="clear:left;"></div>                        
                    <div id="search" style="margin-top:15px; float:left; margin-left:0;">  
                        <div id="search_left"></div>       
                                <div id="search_center"><a href="#dialog" name="modal"><?php _e('Change Date','hotel'); ?></a></div>
                        <div id="search_right"></div>
                    </div>
                    <div id="search" style="margin-top:15px; float:right;">  
                        <div id="search_left"></div>        
                                <div id="search_center">
                                <input type="submit" name="submit_confirm" value="<?php _e('Confirm','hotel');?>" id="butt_save" class="png" />
                                </div>
                        <div id="search_right"></div>
                    </div>
                    </form>
                <?php
                }else if(get_option('tgt_permit_payment') == 1 && $paid >0)
                {
                ?>
                    <form method="POST" name="submit_payment" id="submit_payment" action="https://www.paypal.com/cgi-bin/webscr" >                     
                    <input type="hidden" name="cmd" value="_ext-enter">
                    <input type="hidden" name="redirect_cmd" value="_xclick">            
                    <input type="hidden" name="return" id="paypal_return" >
                    <input type="hidden" name="cancel_return" id="paypal_cancel_return">                        
                    <input type="hidden" name="business" value="<?php echo get_option('tgt_paypal_email'); ?>">
                    <input type="hidden" name="rm" value="2">            
                    <input type="hidden" name="currency_code" value="<?php echo get_option('tgt_currency'); ?>">           
                    <input type="hidden" name="quantity" value="1">            
                    <input type="hidden" name="item_name" value="<?php bloginfo('name'); ?> Booking Submission">            
                    <input type="hidden" name="item_number" id="paypal_item_number">           
                    <input type="hidden" name="amount" id="amount" value="<?php echo $paid;?>">                    <input type="hidden" name="invoice" id="paypal_invoice">          
                    <input type="hidden" name="cbt" value="Book Room Online &rarr;">      
                    <div style="clear:left;"></div>                        
                    <div id="search" style="margin-top:15px; float:left; margin-left:0;">  
                        <div id="search_left"></div>       
                                <div id="search_center"><a href="#dialog" name="modal"><?php _e('Change Date','hotel'); ?></a></div>
                        <div id="search_right"></div>
                    </div>
                    <div id="search" style="margin-top:15px; float:right;">  
                        <div id="search_left"></div>        
                                <div id="search_center">
                                <input type="submit" name="submit_continue" value="<?php _e('Confirm & Pay','hotel');?>" id="butt_save" class="png" />
                                </div>
                        <div id="search_right"></div>
                    </div>
                    </form>
                <?php
                }
                ?>
                </div>                
                <div style="clear:both;"></div>
                </div>
                <!-- end list info -->
                </div>
                </div>
            </div>
<?php } ?>
            <?php get_sidebar();?>
            <div style="clear:left;"></div>
       <div class="bottom">
               <img src="<?php echo TEMPLATE_URL; ?>/images/inner-page-bottom.jpg" />
       </div>
       
    </div>
<!-- content end -->
<?php get_footer();?>
#achieve #thisi
  • Profile picture of the author Brandon Tanner
    Not sure why you'd want to do that, because if someone clicked on a "Pay Now" button and their email client popped up, they would be pretty confused (and rightly so). I'd imagine that would have a pretty dismal effect on your conversion rate. And it may even be against Paypal's TOS to do that.

    Assuming that you actually have a legitimate reason for doing this though, you can hyperlink an email address using the following code...

    HTML Code:
    <a href="mailto:info@example.com">Click here to email me</a>
    Or if you want to hyperlink the email via form submit, you would put the email link inside your form's "action" attribute...

    HTML Code:
    <form action="mailto:info@example.com">
    The only thing that will do though is open up their email client and populate the "To" field with your email address (assuming that they even have an email client installed on their computer). A better option would be to put an email contact form on your webpage instead. Google "email contact form"... lots of options.
    Signature

    {{ DiscussionBoard.errors[8492961].message }}
  • Profile picture of the author filiks
    thank you for your response...yes i know it will affect the conversion, but its not for me but a client and his reason is that online marketing is not so much in vogue where in malawi, so he needs to get all form data into his email account. This way he will be able to contact them by phone....

    thank you once again, i really appreciate you!
    {{ DiscussionBoard.errors[8493236].message }}
  • Profile picture of the author David Beroff
    In that case, I'd recommend a two-step process: Use Freedback.com first to collect all of the booking information, and then from there, send the customer to PayPal for payment. Your conversion will actually increase, because they will be giving you their contact information first before pulling out their credit card, and if they hesitate on the second step, someone can always follow up with them by phone or email.
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[8493482].message }}
  • Profile picture of the author brutecky
    If you need to get there info you can also have a presubmit form function that calls a PHP script via AJAX that does the emailing. That way you get the payment and the info both with one button press.
    {{ DiscussionBoard.errors[8495193].message }}
  • Profile picture of the author maruka
    Banned
    So you are a programmer on the fly that dont know how to tell your client that if he wants the honey he needs to give the money,I personally think that your client is an egoistic person that needs to understand that in order to gain control on his business he needs to invest ,so have you heard the word support ticket system?
    I think that can handle it all ,well if his clients are interested theyll send support ticket
    other wise is a very stupid invention sorry but you suck as inventors really mami
    {{ DiscussionBoard.errors[8501935].message }}
    • Profile picture of the author David Beroff
      Originally Posted by maruka View Post

      So you are a programmer on the fly that dont know how to tell your client that if he wants the honey he needs to give the money,I personally think that your client is an egoistic person that needs to understand that in order to gain control on his business he needs to invest ,so have you heard the word support ticket system?
      I think that can handle it all ,well if his clients are interested theyll send support ticket
      other wise is a very stupid invention sorry but you suck as inventors really mami
      Huh!? Attitude aside, what on earth is the problem with a simple, free, one-step form submission process? That's why I suggested Freedback.com. (Actually, that's why I invented Freedback.com, although I am no longer associated with it.) These are prospective customers; the OP's intent is to make the process as simple and lightweight as possible, so as to encourage people to ask questions, and possibly even book. (That's why I suggested showing the form first, and then PayPal.)

      And, as far as your attitude and language, well, let's just say that this is a professional forum, not middle school.
      Signature
      Put MY voice on YOUR video: AwesomeAmericanAudio.com
      {{ DiscussionBoard.errors[8502013].message }}
  • Profile picture of the author maruka
    Banned
    David Beroff no one will get to the second step cant you hear that this people is not educated about buying online so you and brutecky are deadfull wrong I think this dude needs more than anything hiring a programmer that does build an online chat support system and also hire an employee that collects info online,this backed by the tickets and a normal payment solution ,I even liked the form this dude placed here is very compleate
    but unaltered

    sadly things already invented so save your inventive energies for your lovers other wise they are worth less
    {{ DiscussionBoard.errors[8501999].message }}

Trending Topics