
frshjb373
Members-
Posts
42 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
frshjb373's Achievements

Member (2/5)
0
Reputation
-
I'm trying to use php to echo only the first 10 items of an array. I have the entire list displaying if there are more than 10 items, but I can't figure out how to display only 10. Here's the code. Any help is much appreciated. Thank you in advance! <?php if (count($all_machines) > 10) { echo '<ul>'; foreach($all_machines as $machine) { echo '<li>' . $machine['name'] . '</li>'; } echo '</ul>'; } else { echo "No machines"; } ?>
-
I have the following code. Functionally, it's working great, but when you toggle between button 1 and button 2 and the div slides into position, the size of the div collapses. I'd like to make it so that the page doesn't resize when toggling back and forth. I'm figuring this is an easy fix, but I can't seem to get it right. Code is below. Any help is much appreciated. Thank you in advance! <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(function () { $("[name=toggler]").click(function () { $('.toHide').hide(); $("#blk-" + $(this).val()).show('slide'); }); }); </script> <label> <input id="rdb1" type="button" name="toggler" value="1" /> </label> <label> <input id="rdb2" type="button" name="toggler" value="2" /> </label> <div id="blk-0" class="toHide"> <div class="center-form-img" > <img src="{{media url="wysiwyg/form-inactive.jpg"}}" alt="" /> </div> </div> <div id="blk-1" class="toHide" style="display:none"> {{block type=core/template name=ContactUs template=cmg/ContactUs1.phtml}}</div> <div id="blk-2" class="toHide" style="display:none">{{block type=core/template name=ContactUs template=cmg/ContactUs2.phtml}}</div>
-
Form submission prompts encryption message on select browsers
frshjb373 replied to frshjb373's topic in PHP Coding Help
Wow, I'm an idiot...I had our site bookmarked in Firefox as https://www.domain.com...so the browser changes all pages to do the same. However, when i type in "domain.com" and navigate to form, it works just fine. A lot of wasted time for nothing. Nonetheless, thank you for the advice. I appreciate it. -
Form submission prompts encryption message on select browsers
frshjb373 replied to frshjb373's topic in PHP Coding Help
I tried that as well and also tried the "_forced_secure", but no go. Wondering if there's something in the htaccess I can manipulate to actually change the url. Let me know if you can think of anything else and thanks for the help! -
Form submission prompts encryption message on select browsers
frshjb373 replied to frshjb373's topic in PHP Coding Help
So the action looks like the following: action="<?php echo $this->getUrl('ccfp/form') ?>index" This is what it looks like in source code in browser: action="http://www.domain.com/ccfp/form/index" We are using Magento, but I can't figure how to manipulate the dynamic code to be an https rather than http. Thank you for the help. Look forward to hearing back if anyone has additional info. -
I'm not sure if this is the best place to post this issue, but any help is much appreciated. We have a form on our Magento site, that when submitted on Firefox, prompts the following security warning: Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party. Are you sure you want to continue sending this information? I have contacted our hosting and they explained it's an issue with the code, "you would typically getting a notice like that if you're calling assets over an http on a page that is using https." If anyone has any insights as to how to avoid this from a development perspective, please let me know. Thank you in advance for the help!
-
Trying to pass some data through url using some javascript. One of the records in my mysql database contains an ampersand. Not really sure how to encode the url. Any help is much appreciated! Here's the JS I'm using: function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='sell-iphone.php?cat=' + val ; } And here's the PHP. "$cat" is the value I'm pulling from the database. Dont' think the db is relevant to this however: <?php @$cat=$_GET['cat']; // Use this line or below line if register_global is off if(strlen($cat) < 0){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } ?>
-
Ampersand in database record will not work
frshjb373 replied to frshjb373's topic in PHP Coding Help
After looking at it more, I think it's a Javascript issue. Here's the Javascript and PHP... Javascript: function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='sell-iphone.php?cat=' + val ; } PHP: <?php @$cat=$_GET['cat']; // Use this line or below line if register_global is off if(strlen($cat) < 0){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } ?> -
I'm trying to query a database where some of the values in the record have an ampersand (AT&T) and I get no results. However, if I change the records to "ATT" it works just fine. How do I get the ampersand to query correctly? Any help is much appreciated. Thank you!