Jump to content

cleeclee

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cleeclee's Achievements

Member

Member (2/5)

0

Reputation

  1. wow that was very detailed and helpful. Thanks i'll make sure to work em out nicely. Your help is very much appreciated!
  2. hmm i see a timer that updates every sec according to the current time my computer is at. Would you care explaining each line to me so that i could do the trouble shooting myself? ^^
  3. Hello i'd like to know how this code works. It displays a time and date for me. But i don't understand how it does. Thanks in advance for the reply! <script> var myVar=setInterval(function(){myTimer()},1000); function myTimer() { var d=new Date(); var t=d.toLocaleTimeString(); document.getElementById("demo").innerHTML=t; } <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this[i + 1] = makeArray.arguments[i]; } var months = new makeArray('January','February','March','April','May', 'June','July','August','September','October','November','December'); var date = new Date(); var day = date.getDate(); var month = date.getMonth() + 1; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(day + " " + months[month] + " " + year); //--> </script>
  4. Got it figured out! thanks it was a small mistake in my codes. sorry to trouble you guys. Thank you!
  5. Hi i've decided to keep it simple. Here's what i did. Without the while loop i'm only able to display 1 line of data. I'd like to display the other lines too, so i used the loop and i have the same error msg as in my original post. "Warning: mysql_fetch_array() expects parameter 1 to be resource"
  6. Hi i'm trying to display a table thru mysql. Just learnt to do so and i haven't got a clue what is wrong with the code. In line 19 the error is that 'mysql_numrows() expects parameter 1 to be resource'. Can i get some help as to what to correct it with? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $host="localhost"; $username="root"; $password=""; $database="energy"; mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM tablename"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td><font face="Arial, Helvetica, sans-serif">Value1</font></td> <td><font face="Arial, Helvetica, sans-serif">Value2</font></td> <td><font face="Arial, Helvetica, sans-serif">Value3</font></td> <td><font face="Arial, Helvetica, sans-serif">Value4</font></td> <td><font face="Arial, Helvetica, sans-serif">Value5</font></td> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"field1"); $f2=mysql_result($result,$i,"field2"); $f3=mysql_result($result,$i,"field3"); $f4=mysql_result($result,$i,"field4"); $f5=mysql_result($result,$i,"field5"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> </tr> </table> <?php $i++; } ?> </body> </html>
  7. Hi sorry Xao, i realized that by having 2 audio tags will solve the problem. But the sounds are playing together. how do i play the first one then the second one? I've tried using the javascript setTime function. But it doesnt work. I placed the script between the two audio tags. Is there another way round it?
  8. I am able to play the sound already. Thank you for your help! Could i just also ask another question too? I am able to play only 1 music. After that the other one doesn't play. Here's what i did, it's a very newbie work cause i only have about 6 weeks of experience. Hope you can guide me along. Thank you very much! <html> <audio controls="controls" autoplay="autoplay"> height="0.5" width="0.5"> <source src="silence.mp3" type="audio/mp3"> <source src="silence.ogg" type="audio/ogg"> <embed height="100" width="100" src="silence.mp3"> <source src="alarm.mp3" type="audio/mp3"> <source src="alarm.ogg" type="audio/ogg"> <embed height="100" width="100" src="alarm.mp3"> </audio> ​</html>
  9. Hi i would like to the delay the opening of the window.open pop up by 30seconds and this is what i have. But it doesnt work. The pop up still appears immediately. can i get some help with it please and thank you! <script> function pop() { setTimeout ("pop()", 30000); } window.open('http://localhost:8000/test.php','','width=350,height=200') </script>
  10. Hi thank you for the reply. I've added the codes all into my simple script and none seems to have worked for me.
  11. Hi i've managed to include a simple pop-up in my website and would like to add a sound to play when the pop up appears and the sound to stop when the pop up closes. I've found articles which allows me to add music to the web page body itself only. Please help? ^^ below is a part of my code that is used to make the pop up appear <html> <span id="someelem">Please hold on!</span> </html> <script> (function(){ setTimeout(showTooltip, 20000) })(); function showTooltip() { alert("WARNING ENERGY LEVEL CRICTICALLY HIGH"); } </script> <style> #someelem { cursor: pointer; } </style>
  12. Hello I'd like to have the pop up after 20s then at 35s appear again as another pop up box. I'm really a newbie at it, please do tell me what I have to insert in between my javascript to kinda seperate them? <html> <span id="someelem">Please hold on!</span> </html> <script> (function(){ setTimeout(showTooltip, 20000) })(); (function(){ setTimeout(showTooltip, 350000) })(); function showTooltip() { alert("WARNING ENERGY LEVEL GETTING TOO HIGH"); } function showTooltip() { alert("WARNING ENERGY LEVEL CRICTICALLY HIGH"); } </script> <style> #someelem { cursor: pointer; } </style>
  13. Hello there again helpful people. I reiterate that I barely have any html knowledge and i'll not go into it. I'm not being lazy or stupid. If you dont want to help me then just don't reply to my posts. Sorry for side tracking.. How do i put the .swf animation i've put up in my web page side by side. let's say 2 in a row and another 2 in another row. Right now the animations are below one another after i put them up. I've tried using the codes i've found online, they work with images with URL only. Thank you in advance again for your replies. Any kind of help is greatly appreciated. <!doctype html> <html> <head> <title>EMS</title> <link rel="stylesheet" href="style.css" /> <script src="functions.js"></script> </head> <body> <body background="http://www.moxyimagery.com/backgrounds/black-carbon-sheet.jpg"> <center><IMG SRC="http://very-soft.com/media/products/screenshots/Energy_animation-site_1.gif" ALT="GIF" WIDTH=900 HEIGHT =80"></center> <center><font size ="10"><font color="#81F7F3">Energy Management</font></font></center> <div id="flashContent"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="302" height="217" id="airflowgraph" align="middle"> <param name="movie" value="airflowgraph.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="airflowgraph.swf" width="302" height="217"> <param name="movie" value="airflowgraph.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--<![endif]--> <a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> <div id="flashContent1"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="240" height="230" id="Airflow" align="middle"> <param name="movie" value="Airflow.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="Airflow.swf" width="240" height="230"> <param name="movie" value="Airflow.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--<![endif]--> <a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> <div id="flashContent2"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="302" height="218" id="Energygraph" align="middle"> <param name="movie" value="Energygraph.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="Energygraph.swf" width="302" height="218"> <param name="movie" value="Energygraph.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="window" /> <param name="scale" value="showall" /> <param name="menu" value="true" /> <param name="devicefont" value="false" /> <param name="salign" value="" /> <param name="allowScriptAccess" value="sameDomain" /> <!--<![endif]--> <a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> </body> </html>
  14. Thank you Matt that worked really well. Now i've new knowledge to to boast about. That was really helpful, really cant thank you enough.
  15. I do not have any html background, i'm an Green techonology student and was dumped an IT project as my final year project ( 8 weeks is all I have ). Wished there was classes for me to even pay attention to in the first place. So please dont judge me when you don't know anything about me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.