Everything posted by drennan
-
Error 1045 connecting to MySQL from Dreamweaver
I reinstalled MAMP then removed preferences and repaired permissions. It worked after reinstalling but thanks for the tips.
-
PHP display session username
I have just started to use PHP so this is probably something obvious. I've setup a MySQL table with 'username', 'password' and 'name' columns. I've created a login page which authenticates using 'username' and 'password' then loads the welcome page. I'm trying to work out what PHP I would need in the welcome page to display the 'name' of the person currently logged in (by session ID?) Can't work it out from the info i've found on google. thanks.
-
Error 1045 connecting to MySQL from Dreamweaver
Hi all, I'm having problems connecting to my remote database from dreamweaver. I contacted my hosting company and they said they cannot see any hits from my IP and to try another app. I downloaded sequel pro and it connects straight away, but I've been using DW for years (for static sites) and really wanna get this working. This is the first time i've used a database in DW so I might be missing something. DW throws up the error: MySQL Error#: 1045. Access denied for user 'xxxx'@'xxxx.net' (using password:YES). Does anyone know why one app would connect when DW won't? Does something need flushing or will deleting DW prefs do anything? I also sometimes get the message 'waiting for server', which times out, instead of the 1045 error. Does this indicate a DW problem since the errors are inconsistent? thanks guys Dren
-
Using javascript to calculate data
Thanks <table width="830" border="0" cellspacing="1" class="tableBG" id="main"> <tbody> <tr> <td width="40"><img src="images/datasheet/thumbs/01.png" alt="" width="36" height="36"></td> <td width="198" align="left"> Item A</td> <td width="60">50g</td> <td width="40"> <LABEL class="label_check" for="checkbox-06"><INPUT name="sample-checkbox-06" id="checkbox-06" value="1" type="checkbox" onClick="change(this)"></LABEL></td> <td width="73">£1.15</td> <td width="73">33</td> <td width="73">7.1</td> <td width="73">0.1</td> <td width="73">0.5</td> <td width="73">0.3</td> <td width="73">0.9</td> <tr> <td><img src="images/datasheet/thumbs/02.png" alt="" width="36" height="36"></td> <td align="left">Item B<span class="textSmall"></span></td> <td>100g</td> <td> <LABEL class="label_check" for="checkbox-07"><INPUT name="sample-checkbox-07" id="checkbox-07" value="1" type="checkbox" onClick="change(this)"></LABEL></td> <td>£1.15</td> <td>146</td> <td>12.5</td> <td>0</td> <td>10.8</td> <td>3.1</td> <td>0</td> <tr> <td> </td> <td align="left"> </td> <td> </td> <td> </td> <td><input name="total1" type="text" class="data2" id="total1" value="£0.00" readonly="readonly"> </td> <td><span class="footerFields"> <input name="total2" type="text" class="data1" id="total2" value="0" readonly="readonly"> </span></td> <td><span class="footerFields"> <input name="total3" type="text" class="data1" id="total3" value="0" readonly="readonly"> </span></td> <td><span class="footerFields"> <input name="total4" type="text" class="data1" id="total4" value="0" readonly="readonly"> </span></td> <td><span class="footerFields"> <input name="total5" type="text" class="data1" id="total5" value="0" readonly="readonly"> </span></td> <td><span class="footerFields"> <input name="total6" type="text" class="data1" id="total6" value="0" readonly="readonly"> </span></td> <td><span class="footerFields"> <input name="total7" type="text" class="data1" id="total7" value="0" readonly="readonly"> </span></td> </tbody> <tr>
-
Using javascript to calculate data
Hey all. I'm pretty new to javascript - someone helped me with this a while ago. I've made a table of data and each column totals up at the bottom when a checkbox on the row is clicked. Trouble is, if I add a blank row within the table, the data stops calculating for all rows below it. I'm wondering if there is a way to exclude blank rows from the javascript? Here's the code so far. Thanks guys function change(obj) { var tr=obj.parentNode.parentNode.parentNode; if(obj.checked) { tr.className+='checked' } else { tr.className=tr.className.replace('checked', ''); } clickCh(); } function clickCh(){ var tr=document.getElementsByTagName('tbody')[0].getElementsByTagName('tr'); var total1=total2=total3=total4=total5=total6=total7=0; for(var i=0; i<tr.length; i++) { if(tr.getElementsByTagName('input')[0].checked) { var td=tr.getElementsByTagName('td'); total1+=parseFloat(td[4].firstChild.data.replace(/^[^\w\d\s\.\,]*/,"")); total2+=parseInt(td[5].firstChild.data); total3+=parseFloat(td[6].firstChild.data); total4+=parseFloat(td[7].firstChild.data); total5+=parseFloat(td[8].firstChild.data); total6+=parseFloat(td[9].firstChild.data); total7+=parseFloat(td[10].firstChild.data); } } document.getElementById('total1').value="\u00a3"+total1.toFixed(2); document.getElementById('topTotal1').value="\u00a3"+total1.toFixed(2);; document.getElementById('total2').value=total2+" cal"; document.getElementById('total3').value=total3.toFixed(1)+"g"; document.getElementById('total4').value=total4.toFixed(1)+"g"; document.getElementById('total5').value=total5.toFixed(1)+"g"; document.getElementById('total6').value=total6.toFixed(1)+"g"; document.getElementById('total7').value=total7.toFixed(1)+"g"; document.getElementById('total8').value=total8.toFixed(1)+"g"; }
-
Can a dropdown menu overlay the DIV below?
Done what you suggested above and after some playing around I've got it to work!! Thanks a million for your advice. As you can tell, I'm still learning but i'm finally starting to make things happen with javascript/CSS which is really improving my websites thanks again mate.
-
Can a dropdown menu overlay the DIV below?
Ahh cool. Thanks for introducing me to z-index and your workaround I've done what you suggested but the z-index thing isn't working, prob due to something i've overlooked. I've uploaded the changes to the same link. Thanks mate, been stuck on this for ages! EDIT: Have applied the lower z-index to '#slider #login' as well and same outcome. Sorry to keep editing... OK, i've set the position to relative which has brought it to the front, but if I remove the colour from the DIV, the layer behind shows through. Can I make it hide the slider but show the background? cheers
-
Can a dropdown menu overlay the DIV below?
Hey guys, I've created a sliding horizontal DIV (using jQuery), which is hidden when its outside of the containing DIV. Problem is that the slider contains 2 jQuery dropdown menus and they are also hidden on the Y axis when expanded. I've tried making the Y axis overflow visible on the menu (css/jquery.selectbox.css) but it doesn't overlay the DIV underneath like a standard dropdown. I'm still learning all the different CSS properties. Is there a way to make it overlay the content below? Heres the example. Thanks guys http://drennan.drivehq.com/sliderPreview.html
-
jQuery Sliding DIV
Hi, Someone helped me out with a javascript/jquery slide-in login form but they are no longer available and i'm struggling to change something quite basic. At the moment my page loads with a DIV containing the login form. When you click the 'close' button the form slides off screen and a 'login' button appears. I need the page to load with the login button and for the form to appear but don't know where to start. Please could someone tell me what I need to change? thanks <script type="text/javascript"> $(function() { var closeButton = $('#buttonClose'), loginBox = $('#login'), closed = $('#closeOn'); closeButton.click(function(e) { loginBox.animate({ 'margin-right' : '-630px' }, 500, function() { closed.fadeIn() } ) }) closed.click(function() { closed.fadeOut('normal', function() { loginBox.animate({ 'margin-right' : '24px' }, 500) }) }) }) </script> <body onLoad="MM_preloadImages('images/buttonCloseOn.png','images/buttonLoginOn.png')"> <div id="container"> <img src="images/button.png" alt="Show Login" id="closeOn"> <div id="login"> <div id="form"> <form name="login" method="post" action=""> <div id="close"><a href="#"><img src="images/buttonCloseOff.png" alt="close panel" name="buttonClose" width="25" height="25" border="0" class="close" id="buttonClose" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('buttonClose','','images/buttonCloseOn.png',1)"></a> <label for="username"></label> <input name="username" type="text" onfocus="this.value=''" class="formField" id="username" value="USERNAME"> <label for="password"></label><input name="password" type="password" onfocus="this.value=''" class="formField" id="password" value="PASSWORD"> <a href="#"><img src="images/buttonLoginOff.png" alt="login" name="buttonLogin" width="67" height="28" border="0" class="login" id="buttonLogin" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('buttonLogin','','images/buttonLoginOn.png',1)"></a></div> </form> </div> </div> </div> </body>
-
Display Server Time
Thanks for that. I'll look into what you suggested. cheers
-
Display Server Time
Hi, I've been playing around with javascript clocks for my site but they all seem to grab the time from my machine. Is there a way to display the server time so that all users see the same time? I'm only really looking for a bit of script that displays the time in text/html on my site rather than a flash clock etc. I was thinking this must be possible but I just looked at the BBC website clock and if I change my computer time, the BBC site clock changes too. I would have thought it would be more accurate to sync the clock with a time server? Would there be some sort of permissions problem with getting the time from the web server? Thanks guys.
-
applying initial value to password field
Thanks guys, gonna look into the jquery option a bit more.
-
applying initial value to password field
Hey, Is there a simple way to do this? If I change the form field to a password field, the initial value appears as asterisks. thanks guys
-
DIV background image problem
thanks dude, it was a float problem. nice1
-
DIV background image problem
Hi. I've created a form where people input their business expenses, so each row of the form is identical and in its own div. The DIVs are wrapped in a container div with a background image, with image position set to center bottom. The idea is that the user can add more rows via a script and the BG image will always sit at the bottom behind the last few rows. trouble is, the container div apparently needs a height to display the BG image and this messes up the dynamic resizing. Anyone know how I can get the image to stay at the bottom of the container div while allowing it's height to vary based on the contents? thanks, Dren
-
Marketing via social networking/bookmarking
cheers for the advice
-
Marketing via social networking/bookmarking
I've recently launched my website and am trying to get to grips with web marketing. I've heard there are some do's and dont's, like you shouldn't register on a bookmarking site and immediately post links back to your site. I was wondering though, what initial steps you guys take to promote a new site and if there are any other things I should watch out for? I registered on twitter when I launched and have been tweeting new services and news. I got a follower on twitter today and their page was just full of links to design resources. Should I keep my account more active by posting links to other people's (vetted) design resources or would that look bad for a web design company? Does anyone know of a reliable and current guide for beginners? Any advice appreciated. cheers guys
-
What to charge for SEO
Hi, I have spent the last few months learning SEO techniques and have just had my first request to optimise a website. SEO results are so variable that I dont have a clue how to price the service. I added an 'areas covered' page to a website a while back, which isn't really SEO, so I had 'piano tuner SW1, piano tuner WD2 etc' and although its not a professional way to do it, my client was coming 1st in google for these search results. I only charged them £75 for 3 hours work but felt I should have charged more for 1st place in google. How do people normally structure charges for SEO? Should it just be done on hours of work or should I add additional charges for the eventual position in google? Thanks
-
How do I check google position
Hi, I have just launched my website and submitted it to google (about 2 weeks ago). I have searched google on how to check my sites position on certain search phrases but I cant find any clear info. Is there a free online tool where I can enter my domain name and a phrase, such as 'web design london' and see what position my site comes up in google? I want to check this regularly as I implement SEO techniques and dont want to have to go through the results manually each time to find where my site comes. thanks
-
Simple SEO question
Hi, I've been building websites for a while and have just started looking into SEO. I seem to have overlooked the importance of headers (by using the h1 h2 tags etc). I have just been naming my title styles randomly, like 'title 1' etc. So I am now going to rename my title CSS styles to h1 h2 etc. At the moment I have about 5 sections of text in my page, each with a title in blue. So I linked a CSS style to them called 'blue'. What is the best way to name these in terms of SEO? Can I just rename 'blue' as 'h1' and style all the blue headings as h1, or do I need to change them to h2, h3 etc as they go down the page? Dont really understand how it should best be structured for search engines. Hope thats all clear! thanks, Dren
-
best free 'live chat' for my website
thats soooo what i was looking for, thanks! totally customizable.
-
best free 'live chat' for my website
Hi, Can anyone advise me of a good, free live-chat program for my website? I'm looking for something minimal, so a button/icon that users can click to launch live chat in a new window rather than an embedded chat window. Ideally one that can be styled with css so the chat window fits the look of my site. I'm looking for something that will say 'chat now' if i'm logged in and 'unavailable, leave a message' if i'm logged out in the evenings. Also, i'm using a mac, so it will either need to have a mac app or a web interface for me to receive requests. Looked on google for a few hours but there are so many that are either not free, for windows or cant be styled. Thanks guys.
-
Flash preloader for HTML content?
good point. thanks for the tip
-
Flash preloader for HTML content?
Hi, does anyone know if it's possible to create a flash preloader that links to the loading progress of HTML content? I basically want just the HTML background image and the flash preloader to display until all HTML content (mainly images) has loaded, then for the preloader to disappear and the HTML to render instantly. I've done this with a flash site but wondered if its possible with HTML. If not, is there another preloader method for HTML, such as a numerical or CSS progress indicator? The site has a lot of images and it looks messy while loading. I'd prefer a nice flash progress intro while the files were being downloaded, then for everything to appear at once. thanks guys
-
javascript/css thumbnail scroller?
Hi, I want to put thumbs of websites I have designed on a vertical scroller on the right hand side of my webpage, preferably one where the up/down scroll speeds up as your mouse moves further from the center point. Clicking the thumbs needs to trigger colorbox (like lightbox with html capabilities) and colorbox is all working fine in my webpage. I created the scroller mentioned above, in flash, but have had days of problems getting the actionscript to trigger colorbox (not good with actionscript) and have now given up on that. So i'm looking into alternatives and wondering if the scrolling effect (with speed change) is possible with javascript or css? Or on the off chance, if anyone knows a method of getting colorbox triggered from a flash button that would be great (i know i'm in the wrong forum for that). Thanks guys