Solutions
-
Chris Day's post in LOAD DATA LOCAL INFILE WHERE clause? was marked as the answer<?php
// Make the searches all lower case
$var = "find me";
$var2 = "search";
$line[20] = strtolower($line[20]); // make the line all lower case
if (strpos($line[20], $var) || strpos($line[20], $var2)) { // || means OR. You can use && to mean AND
// string contains $var
} else {
// string dosent contain $var
}
?>
-
Chris Day's post in PHP Login Cron Job was marked as the answerThe following worked for me, you would have to re-add your file handling, change the url and change the login credentials.
<?php
$ch = curl_init("http://www.somewebsite.com/");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_USERPWD, "user:password");
$data = curl_exec($ch);
echo curl_error($ch);
print_r($data);
curl_close($ch);
?>Please note this was used to send the username and password for basic authentication set up on a Ubuntu system using .htpasswd and .htaccess -
Chris Day's post in Need Help with Countdown Timer was marked as the answerIn assets/js/scripts.js at the top of the script it is hard coded to countdown 250 days, you can change this to a static date by changing
var countTo = 250 * 24 * 60 * 60 * 1000 + now.valueOf();I.e.var countTo = 1420070400 * 1000; // Unix timestamp of the date you want to count down to multiplied by 1000That will count down to the new year -
Chris Day's post in Google charts with PHP & MYSQL not displayed was marked as the answerYour issue is the "BARRON'S EDUCATIONAL" record in your database or any record within the database that contains a single quote.
You could remove this quote or escape it like this
Replace:
$arrPie[]="['".$pub."',".$qty."]";With: $arrPie[]="['".addslashes($pub)."',".$qty."]"; -
Chris Day's post in Call function on click (jQuery) was marked as the answerhow about
$('.tab-to-be-clicked').bind("click", function(){ checkWidth(); }); or if the button is dynamicly loaded
$(document).bind("click", ".tab-to-be-clicked", function(){ checkWidth(); }); -
Chris Day's post in How To Import Large Excel File To MySql Database Using PHP was marked as the answerAfter making the above changes did you change $max_filesize to 41943040?
-
Chris Day's post in jQuery toggle() on array of mysql fetched arrray was marked as the answer<table> <?php $cat_set = get_all_cats(); while($category = mysql_fetch_array($cat_set)){ if($category["category"] != "no-cat"){ echo " <tr data-show=\"".$category["category"]."\"> <td id=\"cats\">".$category["category"]."</td> <td><img id=\"blink\" src=\"drop.png\"></td> </tr>"; $course_set = get_courses_for_cats($category["cat_id"]); while ($course = mysql_fetch_array($course_set)) { echo" <tr class=\"cont\" data-cat=\"".$category["category"]."\"> <td><input value = ". $course["course_code"] ." name=\"boxes[]\" type=\"checkbox\" /></td> <td class=\"code\">" . $course["course_code"] . "</td> </tr>"; } } else { $course_set = get_courses_for_cats($category["cat_id"]); while ($course = mysql_fetch_array($course_set)) { echo" <tr class=\"cont\" data-cat=\"".$category["category"]."\"> <td><input value = ". $course["course_code"] ." name=\"boxes[]\" type=\"checkbox\" /></td> <td class=\"code\">" . $course["course_code"] . "</td> </tr>"; } } } ?> </table> <script> $(document).ready(function(){ $(".cont").hide(); $("[data-show]").click(function(){ var selector = $(this).attr("data-show"); $("[data-cat='"+selector+"']").toggle(); }); }); </script>
-
Chris Day's post in Simulate the 'Backspace' button being pressed in JS/JQuery was marked as the answerNo problem, try this code
$(document).ready(function() {
$(".search").change(function() {
$('#search').val('').trigger("keyup");
});
}); -
Chris Day's post in Creating an opaque overlay was marked as the answerI have made a very primitive version here It uses JQuery to show and hide it everything else is CSS/HTML
-
Chris Day's post in iPage Hosting + Cost (UK) was marked as the answerif you do decide on one.com you can use my referral and you will receive an extra 3gb of space, i get the same aswell (no financial gain) but as i only use it for my emails now it dosent bother me.
http://one.me/enanaopg
-
Chris Day's post in Stopping a variable width div from animating outside it's width was marked as the answerlike this? http://jsfiddle.net/mMMfn/1/
-
Chris Day's post in Align centre was marked as the answerI would use a container as it explains itself realy it contains all the divs you are using so if you want to position them all easily you just position the container. As for IDs you can only use them once in a page where as a class you can use multiple times, you can also stack classes like so
.container { margin:auto !important; } .full-width { width: 100%; } .half-width { width: 50%; } .blue { color:blue; } <div class="container full-width blue">blue full width</div> <div class="container full-width">full width</div> <div class="container half-width">half width</div> <div class="container half-width blue">blue half width</div> -
Chris Day's post in Removing Empty Space At Bottom Of index.html Page was marked as the answeror you can add one of the following to your style sheet
.wrapper.wrapper-style3 { padding-bottom:0px; } or
.wrapper:nth-last-child(0) { padding-bottom: 0px; } -
Chris Day's post in rying to make a button scroll down the page at the same pace as a hidden div was marked as the answeris this what you are looking for
<html>
<head>
<style>
#container {
position:absolute;
top:100px;
left:500px;
}
#log-in {
width:300px;
height:300px;
background-color:#0066FF;
}
#my-button {
width:300px;
height:40px;
background-color:#0000CC;
color:#FFFFFF;
}
#hidden {
width:300px;
height:500px;
background-color:#00FF00;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test slider menu</title>
</head>
<body>
<div id="container">
<div id="log-in"></div>
<div id="hidden"></div>
<div id="my-button">
<form>
<input type="button" id="hide-button" value="Show" />
</form>
</div>
</div>
<script src="[url=http://code.jquery.com/jquery-1.9.1.js]http://code.jquery.com/jquery-1.9.1.js[/url]"></script>
<script>
$(document).ready(function() {
//hide the hidden div
$('#hidden').hide();
// user clicks on button
$('#hide-button').click(function() {
//toggles hidden div from view to hidden
$("#hidden").slideToggle("slow", function() {
//check if button is visible
if ($(this).is(':visible')) {
// change value to hide
$('#hide-button').val('Hide');
} else {
// change value to show
$('#hide-button').val('Show');
}
});
});
});
</script>
</body>
</html> -
Chris Day's post in Adding a line of PHP to each page making them unique was marked as the answeryes you can use if/else like this
$page = $_SERVER['REQUEST_URI'];
if ($page == '/') {
$content = 'page /';
} else if ($page == '/home') {
$content = 'page /home';
} else if ($page == '/about') {
$content = 'page /about';
} else if ($page == '/contact') {
$content = 'page /contact';
} else {
$content = 'default if page is not above';
}
-
Chris Day's post in How to edit this code?From javascript to html. was marked as the answernot realy sure what you wanted but i think this is what you want
<script type="text/javascript">
<!--
lang.username = "{$login_username}";
lang.password = "{$lang->login_password}";
lang.login = "{$lang->login}";
lang.lost_password = " — <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\" class=\"SomeCSSclass\">{$lang->lost_password}<\/a>";
lang.register_url = " — <a href=\"{$mybb->settings['bburl']}/member.php?action=register\" class=\"SomeCSSclass\">{$lang->welcome_register}<\/a>";
lang.remember_me = "{$lang->remember_me}";
// -->
</script> -
Chris Day's post in How to automate actions on a website to run each X minutes ? was marked as the answerthere is a programe called iMacro or if you are the web host you can use a xx min cron the later being the best option as its the server that does the work and your not relying on your computer being turned on
-
Chris Day's post in PHP code help please was marked as the answerAll you have to do is add target="_blank" to the link like so
<?php if( mfn_opts_get( 'social-facebook') ): ?> <li class="facebook"> <a href="<?php mfn_opts_show('social-facebook'); ?>" title="Facebook" target="_blank">F</a> </li> <?php endif; ?> -
Chris Day's post in Is It Possible To Insert 2 Separate Background Images? was marked as the answerbackground:url('http://imageshack.us/a/img689/4559/5f7a.jpg') top repeat-x, url('http://imageshack.us/a/img203/7673/2cs8.jpg') bottom repeat-x; that should work for you
-
Chris Day's post in How Do I Create Black Stripe BEHIND All Of The Divs? was marked as the answeryou post my code above in your style sheet or in your <head> tags with <style> and </style> wrapped around it, you also have to change the url for the image you want make sure it is in the correct location or if its an external link include http://
-
Yea pretty much I fixes it by doing the case on the type and then if type = T it would minus the value from 1, for some reason it didn't like having 0 in the case]
Example:
case `type` WHEN "T" THEN 1-val ELSE val ENDThat way 1-1 = 0 and 1-0 = 1 and it was much less code, dont know why i ever post on here as as soon as i post i usualy find the awnser 10 mins later -
Chris Day's post in porting query from MySQL to MsSQL was marked as the answerah you can use the convert() function in the group by clause so the query would be
SELECT convert(datetime, date, 100), value FROM table GROUP BY convert(datetime, date, 100) -
Chris Day's post in jquery errors was marked as the answertry the folowing code
<script>
$(document).ready(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
$('.about-me').hide();
$('.work').hide();
$('.contact').hide();
$('.container2').hide();
$('.header').hide();
$('.container2').delay(400).fadeIn('fast');
$('.header').delay(600).fadeIn('fast');
$('#recent1').hide();
$('#recent2').hide();
$('#recent3').hide();
$('#recent4').hide();
$('#recent5').hide();
$('#recent6').hide();
$(window).scroll(function(){
if(($(window).scrollTop()>0) && $(window).scrollTop()<399){
$('.header li').removeClass('hovered');
$('li#home').addClass('hovered');
}
if ($(window).scrollTop()>400 && $(window).scrollTop()<949){
$('.about-me').fadeIn('fast');
$('.header li').removeClass('hovered');
$('li#about').addClass('hovered');
}
if (($(window).scrollTop()>950) && $(window).scrollTop()<1349){
$('.work').fadeIn('fast');
$('.header li').removeClass('hovered');
$('li#work').addClass('hovered');
$('#recent1').delay(200).fadeIn('fast');
$('#recent2').delay(300).fadeIn('fast');
$('#recent3').delay(400).fadeIn('fast');
$('#recent4').delay(500).fadeIn('fast');
$('#recent5').delay(600).fadeIn('fast');
$('#recent6').delay(700).fadeIn('fast');
}
if (($(window).scrollTop()>1350)){
$('.contact').fadeIn('fast');
$('.header li').removeClass('hovered');
$('li#contact').addClass('hovered');
}
});
$('#home').click(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
$('.header li').removeClass('hovered');
$('li#home').addClass('hovered');
});
$('#about').click(function(){
$("html, body").animate({ scrollTop: 600 }, "slow");
$('.header li').removeClass('hovered');
$('li#about').addClass('hovered');
});
$('#work').click(function(){
$("html, body").animate({ scrollTop: 1050 }, "slow");
$('.header li').removeClass('hovered');
$('li#work').addClass('hovered');
});
$('#contact').click(function(){
$("html, body").animate({ scrollTop: 1850 }, "slow");
$('.header li').removeClass('hovered');
$('li#contact').addClass('hovered');
});
});
</script>also you are using <script src="js/js.js" type="text/javascript"</script>
<script>
</script>what should be <script src="js/js.js" type="text/javascript"></script> -
Chris Day's post in Multiple CSS link styles was marked as the answer.post a { font-size:16px; font-weight:700; color:#595959; } .post a:hover { color:#999999; }
try that or you could use
.post a:link, .post a:active, .post a:visited {i just prefer to use "a" then specify the hover after as im lazy -
Chris Day's post in Sticky floating image with button options was marked as the answerif you want it to vertically align you can use line-height:100px; if you want it to align in the centre horizontally use text-align:centre; or both if you want
sorry i miss read your post, i will just alter the code and post it up
#header{ position:fixed; height:50px; width:100px; left:50%; margin-left:-50px; top:0; background-color:#666; z-index:2; }