Guest Posted March 8, 2006 Posted March 8, 2006 is this possible in php? the javascript i tried to use had a (); which of course interfered with the ending of the php echo for the oscommerce text box.
kgt Posted March 8, 2006 Posted March 8, 2006 http://us2.php.net/manual/en/function.strtolower.php Contributions Discount Coupon Codes Donations
Guest Posted March 8, 2006 Posted March 8, 2006 this is where i'm confused... i have: <?php echo tep_draw_input_field('coupon_code', '', ' size="30"'); ?> the code: $str = strtolower($str); the ; cancels it out :(
RL2000 Posted March 8, 2006 Posted March 8, 2006 What exactly do you need to do? Insert clever remark here
kgt Posted March 8, 2006 Posted March 8, 2006 this is where i'm confused...i have: <?php echo tep_draw_input_field('coupon_code', '', ' size="30"'); ?> the code: $str = strtolower($str); the ; cancels it out :( If you want to enforce lowercase in PHP, it must happen after the form is submitted. This would be before. Contributions Discount Coupon Codes Donations
Guest Posted March 8, 2006 Posted March 8, 2006 What exactly do you need to do? the coupon contribution i'm using only works if the coupon code is entered in lowercase letters, so in order to avoid confusion i need to force lowercase for the code input box If you want to enforce lowercase in PHP, it must happen after the form is submitted. This would be before. where exactly would the lowercase-force code have to go, in the form action? in case you can't tell, i'm dumb as a doornail with php :lol:
kgt Posted March 8, 2006 Posted March 8, 2006 where exactly would the lowercase-force code have to go, in the form action? Can't tell you for sure, since I don't know the contribution. Look for something like tep_db_prepare_input($HTTP_POST_VARS['coupon_code']) at the top of the file. This would need to become tep_db_prepare_input(strtolower($HTTP_POST_VARS['coupon_code'])) Contributions Discount Coupon Codes Donations
Guest Posted March 9, 2006 Posted March 9, 2006 i tried: <?php echo tep_draw_input_field(strtolower('coupon_code', '', ' size="30"')); ?> in place of: <?php echo tep_draw_input_field('coupon_code', '', ' size="30"'); ?> got the error: Warning: Wrong parameter count for strtolower()
Guest Posted March 9, 2006 Posted March 9, 2006 <?php echo tep_draw_input_field(strtolower('CAPITAL_STRING'), '', ' size="30"'); ?>
Guest Posted March 9, 2006 Posted March 9, 2006 no errors this time, but now the coupon don't work :(
Guest Posted March 9, 2006 Posted March 9, 2006 what coupon? I am not sure why you want to change the name of the form to lower case. Or you want to change the content of the input box? <?php echo tep_draw_input_field('coupon_code', strtolower('DEFAULT_TEXT_GOES_HERE'), ' size="30"'); ?>
Guest Posted March 10, 2006 Posted March 10, 2006 ohhh, no i did not mean i want to change the NAME of the form, i meant i need to change whatever the user TYPES to lowercase
kgt Posted March 10, 2006 Posted March 10, 2006 Look for something like tep_db_prepare_input($HTTP_POST_VARS['coupon_code']) at the top of the file. This would need to become tep_db_prepare_input(strtolower($HTTP_POST_VARS['coupon_code'])) It will be at the top of the page, or at the top of the page that this form posts to. tep_draw_input_field() creates a text box. You need to edit the data returned from the text box. Contributions Discount Coupon Codes Donations
Guest Posted March 10, 2006 Posted March 10, 2006 my bad, so it would be something like: if ((isset($_POST['coupon_code'])) and ($_POST['coupon_code'] != '')) { switch (strtolower($_POST['coupon_code'])) { the strtolower was still there, but any coupons typed in caps never came through.. odd. maybe it's a deal with the contribution, i'll ask in the support thread
Recommended Posts
Archived
This topic is now archived and is closed to further replies.