downah
Members-
Posts
127 -
Joined
-
Last visited
Everything posted by downah
-
do you have an auto increment field in your table? could you show it?
-
Hmm well first of all take the quotes away from } else { $_SESSION['username'] = "$username"; include "main_interface.php"; to } else { $_SESSION['username'] = $username; include "main_interface.php"; does it give any error?
-
Can I see the code for the form that is sending it to this page?
-
your a moderator can't you edit the post to do the guy a favour? :'(
-
Hi guys, I have a few little problems with the tipTip jquery tooltip, it seems to work pretty well and I am using it on my website, but I can't find a way to insert an image in there, or to style it (neither with the included style from the tooltip itself) This is what I am using <script language="javascript"> $(function(){ $(".someClass").tipTip(); }); </script> and this is how I implement it into the html echo '<a href="profile.php?username='; echo $row['username']; echo '" class="someClass" title="'; echo $row['username']; echo ' '; echo $row['gender']; echo ' '; print yearsSince($dob); echo '">'; echo ucfirst($row['username']); echo "</a></td>"; I tried styling the class someClass but that styles the whole url, as I only want the title basically. any suggestions? Sorry in advance if this might be very basic, but I have not used javascript and or jqeury a lot at all.
-
I think this is what is used mostly for mailing, I heard that mail() in general is not very reliable. I think it is because you're sending mails from the server, have a look at: http://pear.php.net/package/Mail
-
I see so if I start using the mysqli functions I won't have to be sanitize my normal queries at all?, I understand why it is a little bit slower, but that does not really bother me, as the pro side of not having to sanitize the database input, and it being a lot more secure is a massive upside to me, I am just not sure what I am thinking is right. Would you say a experienced developer being up to date would always use mysqli prepared statements instead of normal mysql queries? I am a bit confused as of what I should get used to doing, I was quite happy having gotten the grasp of the mysql functions
-
So just seen this http://www.ultramegatech.com/2009/07/using-mysql-prepared-statements-in-php/ from another topic, and am a bit confused now, I started coding a little while back, but did not get introduced to mysqli until very recently, should I change all my normal mysql queries to the mysqli prepared statements like in the website/tutorial stated? does this mean I won't have to use mysql_real_escape_string and it is more secure in general? Would really like some input, much appreciated.
-
Yeah, most of those tutorial sites are still in the PHP4 era. It's really frustrating helping beginners when they pretty much need to unlearn everything they have read on those sites because it's just plain wrong. Functional maybe, but efficient, secure, etc? Probably not (no offense to you). It would be in your best interest to stop going to those sites and learn from reputable and up-to-date sources. In fact, the PHP manual is (usually) pretty up-to-date and one of the best ways to learn how to use new functions or parts of the API. You are probably right, but I don't have the knowledge to check either of those (downsides of being a nooby) so to me it functionals, and I stess lots on making it as secure as possible, sanitise each string that comes in (I only realized a while ago of things like firebug) and then I realized what if people change my select box to a normal input box and submit the form like that through firebug? since I wasn't sanitizing basically anything that wasn't normal text input :-\ still not sure if that is possible with firebug but better safe than sorry. Either way the PHP manual is actually very confusing for a beginner, so most people search for easier explained tutorials and websites, and unfortunately these seem to be the old ones. Thanks for your advice though, if there is no mention of mysqli, would you say that is it outdated?
-
That's right, I was just scared for people being able to insert scripts through there since I didn't really seem to be able to sanitize it with htmlentities(), so it seems with the strip_tags I should allow only certain codes (all the functions on the built in text editor) to be able to get it secure?
-
Interesting, but I can't tell you how much I've learned on W3 schools(I have only been coding over the past couple of months), although you are right they don't help sanitize your code.. I don't really like tizag, and have only just recently read up about mysqli which is pretty annoying (wish I did from the start), but I didnt get pointed to it or really noticed it after awhile, most tutorials are the 'old'? mysql it seems.. either way apart from all that I have been writing pretty functional scripts so it is definitely still possible!
-
Wondering about htmlentities() as I have a rich text editor implemented on my website, how would I correctly use htmlentities() as I still want the data which was put into the rich text editor to correctly show, sorry for me being a bit vague, it is late and im tired but hope someone can shine some light on this for me
-
Login System and Adding data into a Database
downah replied to timmykins02's topic in PHP Coding Help
$username = null ; $password = null ; why do you set them to nothing..? that way the variable is empty -
use the $_POST function, select from your database based on the search string
-
Wouldn't be very hard to do! just check out the mysql update function http://www.w3schools.com/php/php_mysql_update.asp to update records and to create new records http://www.w3schools.com/php/php_mysql_insert.asp and to delete records http://www.w3schools.com/php/php_mysql_delete.asp to connect to db: http://www.w3schools.com/php/php_mysql_connect.asp You could write that whole script in a day just getting things of w3schools php section, so don't worry and get started!
-
echo "You ordered".$quantity."".$item.".<br/>."; echo "Thank you for ordering from Boombaby art supppplies!"; to echo "You ordered" . $quantity . $item .".<br/>"; echo "Thank you for ordering from Boombaby art supppplies!"; ? That is what I would try, not sure if it helps
-
In need of "Mini-CMS" code for simple form processing.
downah replied to sakonnetweb's topic in PHP Coding Help
create a form <form method="post" action="submitform.php"> <input type="text" name="headline"> <textarea name="story" rows="2" cols="20"></textarea> <input type="submit" value="Publish"> </form> ---submitform.php <?php //connect to server $con = mysql_connect("server","user","pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } //select database mysql_select_db("Your_Database", $con); //take what they wrote in the form into a var $headline = $_POST['headline']; $story = $_POST['story']; //put it inside the table or show an error mysql_query("INSERT INTO Your_Table (Headline, Story) VALUES ('$headline', '$story')")or die(mysql_error()); //display something for user if it worked echo 'Successfully put ' . $headline . ' into the database.'; mysql_close($con); ?> You will need a mysql database with a table that contains 3 rows a unique ID as primary key and auto increment, and two fields for Headline and Story To display all headlines and make them clickable through to their unique page to show its content. --index.php <?php //connect to server $con = mysql_connect("server","user","pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } //select database mysql_select_db("Your_Database", $con); //take what they wrote in the form into a var $result = mysql_query("SELECT * FROM Your_Table"); echo "<table> <tr> <th>Headline</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>"; echo '<a href="display.php?uniqueID='; echo $row['uniqueID'] . '">'; echo $row['Headline']; echo '</a>'; echo "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> To display ---display.php <?php //connect to server $con = mysql_connect("server","user","pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } //select database mysql_select_db("Your_Database", $con); //take what they wrote in the form into a var $uniqueID = $_GET['uniqueID']; $result = mysql_query("SELECT * FROM Your_Table where uniqueID = '$uniqueID'"); echo "<table> <tr> <th>Headline</th> <th>Story</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Headline'] . "</td>"; echo "<td>" . $row['Story'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> something like this? not tested.. -
Help with simple(not so simple for a noob like myself) login script
downah replied to isaacneal's topic in PHP Coding Help
Try or die(mysql_error()); after your queries? -
Hi guys, I have been looking for some tooltip solutions as my client wants a feature where when you hover over the username of a certain member, it will show the relative image and information on that member inside the tooltip, now I have been searching around and simple tooltips seem to be no problem, but pulling out information from a database is another, it seems I have to do this with Ajax, but I don't understand how when hovering over a username, it can grab that username and pull out relative information on that user? Anyone who can explain this process so it is easier for me to grasp, and start building on it? Basically like this : http://rndnext.blogspot.co.uk/2009/02/jquery-ajax-tooltip.html Although I don't really understand that concept.. Much appreciated!
-
Solved it thanks for everyone who tried to help! Much appreciated!
-
Okay thanks anyway, for anyone else who could help much appreciated, I do not want to do it the css way!
-
I understand, but I would still really like to know why this is working in a blank script, but not in the script im using, noone could explain if this is because of the divs?
-
I think the reason it doesnt work is because of document.images is that right? The images are within certain div's how do I access those? I would really like to fix this javascript code. this is the whole code --> <!doctype html> <html> <head> <title>Home</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="imagetoolbar" content="no"> <meta http-equiv="imagetoolbar" content="false"> <meta name="generator" content="LMSOFT Web Creator Pro, Version:6.0.0.4"> <meta http-equiv="X-UA-Compatible" content="IE=9"> <link href="./lmwcglobal.css" rel="stylesheet" type="text/css"> <link href="index.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="./jquery/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="./jquery/jquery-ui-1.8.11.custom.min.js"></script> <link rel="stylesheet" href="./jquery/themes/base/jquery.ui.all.css" type="text/css" media="all" /> <script type="text/javascript" src="./jquery/LMCenterInWindow.js"></script> <script type="text/javascript" src="./lmpres90.js"></script><noscript></noscript> <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> <script src="jquery.bxSlider.min.js" type="text/javascript"></script> <script type="text/javascript"> <!-- if (document.images) { homebuttonup = new Image(); homebuttonup.src = "http://viifit.com/images/gym-light.png"; homebuttondown = new Image(); homebuttondown.src = "http://viifit.com/images/gym-dark.png"; } function buttondown(buttonname) { if (document.images) { document[buttonname].src = eval(buttonname + "down.src"); } } function buttonup(buttonname) { if (document.images) { document[buttonname].src = eval(buttonname + "up.src"); } } // --> </script> <script type="text/javascript"> $(document).ready(function(){ $('#slider1').bxSlider(); }); $(function(){ var slider = $('#slider1').bxSlider({ controls: false }); $('#go-prev').click(function(){ slider.goToPreviousSlide(); return false; }); $('#go-next').click(function(){ slider.goToNextSlide(); return false; }); }); </script> </head> <body style="margin-Left:0px;margin-Top:0px;margin-Bottom:0px;margin-Right:0px; background-color:#ffffff;" onresize=LMGlobalPosPage();> <DIV class="cLinkHidden"> [<a href="http://www.lmsoft.com" title="Build Your Own Website">web page software</a>] [<a href="http://www.lmsoft.com/webcreatorpro.html" title="Website Creation Easy">easy website builder software</a>] </DIV> <div id='Page'> <div id='Img10'> <img id='Img10Inner' src='./images/vii-web-new.jpg' alt="" /> </div> <div id='Img3'> <img id='Img3Inner' src='./images/logo.jpg' alt="" /> </div> <div id='Text1'> <p style="line-height:0;text-align:left"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</span></font></p><p style="line-height:0;text-align:left"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;"><br /></span></font></p><p style="line-height:0;text-align:left"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span></font></p><p style="line-height:0;text-align:left"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;"><br /></span></font></p><p style="line-height:0;text-align:left"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span></font></p> </div> <form method=post id='Form1' name='Form1' action='http://www.lmsoft.com/services/form2email2.asp' onsubmit=FireEvent('Form1','_OnSubmit') onreset=FireEvent('Form1','_OnReset')> <DIV id=Input1> <input type='text' id='objInput1' name='companyname' size=30 maxlength=60 onclick=FireEvent('Input1','_OnClick'); ondblclick=FireEvent('Input1','_OnDblClick'); onmousedown=FireEvent('Input1','_OnMouseDown'); onmouseup=FireEvent('Input1','_OnMouseUp'); onfocus=FireEvent('Input1','_OnEnter'); onblur=FireEvent('Input1','_OnLeave'); onchange=FireEvent('Input1','_OnChange'); onkeydown=FireEvent('Input1','_OnKeyDown'); onkeypress=FireEvent('Input1','_OnKeyPress'); onkeyup=FireEvent('Input1','_OnKeyUp'); onselect=FireEvent('Input1','_OnSelect'); > </DIV> <DIV id=Input2> <input type='text' id='objInput2' name='subject' size=30 maxlength=60 onclick=FireEvent('Input2','_OnClick'); ondblclick=FireEvent('Input2','_OnDblClick'); onmousedown=FireEvent('Input2','_OnMouseDown'); onmouseup=FireEvent('Input2','_OnMouseUp'); onfocus=FireEvent('Input2','_OnEnter'); onblur=FireEvent('Input2','_OnLeave'); onchange=FireEvent('Input2','_OnChange'); onkeydown=FireEvent('Input2','_OnKeyDown'); onkeypress=FireEvent('Input2','_OnKeyPress'); onkeyup=FireEvent('Input2','_OnKeyUp'); onselect=FireEvent('Input2','_OnSelect'); > </DIV> <DIV id=Input3> <input type='text' id='objInput3' name='phone' size=30 maxlength=60 onclick=FireEvent('Input3','_OnClick'); ondblclick=FireEvent('Input3','_OnDblClick'); onmousedown=FireEvent('Input3','_OnMouseDown'); onmouseup=FireEvent('Input3','_OnMouseUp'); onfocus=FireEvent('Input3','_OnEnter'); onblur=FireEvent('Input3','_OnLeave'); onchange=FireEvent('Input3','_OnChange'); onkeydown=FireEvent('Input3','_OnKeyDown'); onkeypress=FireEvent('Input3','_OnKeyPress'); onkeyup=FireEvent('Input3','_OnKeyUp'); onselect=FireEvent('Input3','_OnSelect'); > </DIV> <DIV id=Input4> <input type='text' id='objInput4' name='email' size=30 maxlength=60 onclick=FireEvent('Input4','_OnClick'); ondblclick=FireEvent('Input4','_OnDblClick'); onmousedown=FireEvent('Input4','_OnMouseDown'); onmouseup=FireEvent('Input4','_OnMouseUp'); onfocus=FireEvent('Input4','_OnEnter'); onblur=FireEvent('Input4','_OnLeave'); onchange=FireEvent('Input4','_OnChange'); onkeydown=FireEvent('Input4','_OnKeyDown'); onkeypress=FireEvent('Input4','_OnKeyPress'); onkeyup=FireEvent('Input4','_OnKeyUp'); onselect=FireEvent('Input4','_OnSelect'); > </DIV> <DIV id=Input5> <input type='text' id='objInput5' name='sector' size=30 maxlength=60 onclick=FireEvent('Input5','_OnClick'); ondblclick=FireEvent('Input5','_OnDblClick'); onmousedown=FireEvent('Input5','_OnMouseDown'); onmouseup=FireEvent('Input5','_OnMouseUp'); onfocus=FireEvent('Input5','_OnEnter'); onblur=FireEvent('Input5','_OnLeave'); onchange=FireEvent('Input5','_OnChange'); onkeydown=FireEvent('Input5','_OnKeyDown'); onkeypress=FireEvent('Input5','_OnKeyPress'); onkeyup=FireEvent('Input5','_OnKeyUp'); onselect=FireEvent('Input5','_OnSelect'); > </DIV> <DIV id=Input6> <input type='text' id='objInput6' name='website' size=30 maxlength=60 value='http://' onclick=FireEvent('Input6','_OnClick'); ondblclick=FireEvent('Input6','_OnDblClick'); onmousedown=FireEvent('Input6','_OnMouseDown'); onmouseup=FireEvent('Input6','_OnMouseUp'); onfocus=FireEvent('Input6','_OnEnter'); onblur=FireEvent('Input6','_OnLeave'); onchange=FireEvent('Input6','_OnChange'); onkeydown=FireEvent('Input6','_OnKeyDown'); onkeypress=FireEvent('Input6','_OnKeyPress'); onkeyup=FireEvent('Input6','_OnKeyUp'); onselect=FireEvent('Input6','_OnSelect'); > </DIV> <DIV id=Input7> <textarea id='objInput7' name='message' cols=45 rows=8 onclick=FireEvent('Input7','_OnClick'); ondblclick=FireEvent('Input7','_OnDblClick'); onmousedown=FireEvent('Input7','_OnMouseDown'); onmouseup=FireEvent('Input7','_OnMouseUp'); onfocus=FireEvent('Input7','_OnEnter'); onblur=FireEvent('Input7','_OnLeave'); onchange=FireEvent('Input7','_OnChange'); onkeydown=FireEvent('Input7','_OnKeyDown'); onkeypress=FireEvent('Input7','_OnKeyPress'); onkeyup=FireEvent('Input7','_OnKeyUp'); onselect=FireEvent('Input7','_OnSelect'); > </textarea> </DIV> <DIV id=Input8> <input type='Button'id='objInput8' name='vInput8' value='Submit' onclick=ButonOnClickSubmit('Input8','Form1'); ondblclick=FireEvent('Input8','_OnDblClick'); onmousedown=FireEvent('Input8','_OnMouseDown'); onmouseup=FireEvent('Input8','_OnMouseUp'); onfocus=FireEvent('Input8','_OnEnter'); onblur=FireEvent('Input8','_OnLeave'); onkeydown=FireEvent('Input8','_OnKeyDown'); onkeypress=FireEvent('Input8','_OnKeyPress'); onkeyup=FireEvent('Input8','_OnKeyUp'); onselect=FireEvent('Input8','_OnSelect'); > </DIV> <input type='hidden' name='lmcheck' value='0'> <input type='hidden' name='lmserialwc' value=''> <input type='hidden' name='lmto' value=''> <input type='hidden' name='lmfrom' value='DATAFORM@lmsoft.com'> <input type='hidden' name='lmsubject' value=''> <input type='hidden' name='lmadr' value=''> <input type='hidden' name='lmserial' value=''> <input type='hidden' name='lmserialemail' value=''> </form> <div id='WebObj1'> <div id="slider1"> <div><img src="slide1.png"></div> <div><img src="slide1.png"></div> <div><img src="slide1.png"></div> <div><img src="slide1.png"></div> </div> </div> <div id='Text2'> <p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;"><br /></span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. .</span></font></p> </div> <div id='Text3'> <p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;"><br /></span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. .</span></font></p> </div> <div id='Text4'> <p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;"><br /></span></font></p><p style="line-height:0;text-align:center"><font face="Arial" color="#808080"><span style="font-size:10pt;line-height:15px;">Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. .</span></font></p> </div> <div id='Video1'> <!--[if !IE]> <--> <object ID='Video1Inner' type='application/x-shockwave-flash' data='./lmplayer.swf?file=tp://www.youtube.com/watch?v=nCgQDjiotG0&controlbar=false' pluginspage='http://www.macromedia.com/go/getflashplayer' width='277' height='125'> <param name="menu" value="true"> <param name="allowfullscreen" value="True"> <param name="allowscriptaccess" value="always"> <param name="quality" value="High"> <param name='scale' value='tofit'> <embed name='Video1Inner' src='http://www.youtube.com/watch?v=nCgQDjiotG0' scale='tofit' autoplay='false' controller='false' EnableContextMenu='true' width='277' height='125'></ebmed> </object> <!--> <![endif]--> <!--[if IE]> <object ID='Video1Inner' type='application/x-shockwave-flash' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' width='277' height='125'> <param name="movie" value="./lmplayer.swf?file=tp://www.youtube.com/watch?v=nCgQDjiotG0&controlbar=false"> <param name="menu" value="true"> <param name="allowfullscreen" value="True"> <param name="allowscriptaccess" value="always"> <param name="quality" value="High"> <param name='scale' value='tofit'> <embed name='Video1Inner' src='http://www.youtube.com/watch?v=nCgQDjiotG0' scale='tofit' autoplay='false' controller='false' EnableContextMenu='true' width='277' height='125'></ebmed> </object> <![endif]--> </div> <div id='Img4'> <a href="index.html" onmouseover="buttondown('homebutton')" onmouseout="buttonup('homebutton')"> <img id='Img4Inner' name="homebutton" src='http://viifit.com/images/gym-light.png' alt="" /> </a> </div> <div id='Img5'> <img id='Img5Inner' src='./images/house-light.png' alt="" /> </div> <div id='Img6'> <img id='Img6Inner' src='./images/senior-light.png' alt="" /> </div> <div id='Img7'> <img id='Img7Inner' src='./images/schools-light.png' alt="" /> </div> <div id='Img8'> <a href="" id="go-prev"> <img id='Img8Inner' src='./images/left-light.png' alt="" /></a> </div> <div id='Img9'> <a href="" id="go-next"> <img id='Img9Inner' src='./images/buttonright.png' alt="" /></a> </div> <script type="text/javascript" src="./index.js"></script> <noscript></noscript> </div> </body> </html>
-
http://jsfiddle.net/ETHaM/5/ I have tried it on here and it works.. but not in my index when I open it up from my directory or when I upload it on my host.. its live on viifit.com the image with the bike (icon green one) has that exact code connected to it - the link works but not the mouseover?
-
Hi guys I have a simple rollover onmouseover effect, I have tried several scripts but none of them work, can anyone tell me why? javascript <script language="JavaScript" type="text/javascript"> <!-- if (document.images) { homebuttonup = new Image(); homebuttonup.src = "./images/gym-light.png" ; homebuttondown = new Image() ; homebuttondown.src = "./images/buttonright.png" ; } function buttondown( buttonname ) { if (document.images) { document[ buttonname ].src = eval( buttonname + "down.src" ); } } function buttonup ( buttonname ) { if (document.images) { document[ buttonname ].src = eval( buttonname + "up.src" ); } } // --> </script> link <a href="index.html" onmouseover="buttondown('homebutton')" onmouseout="buttonup('homebutton')"> <img id='Img4Inner' name="homebutton" src='./images/gym-light.png' alt="" /> </a>