Jump to content

skaterdav85

Members
  • Content Count

    874
  • Joined

  • Last visited

Everything posted by skaterdav85

  1. this is the link http://www-scf.usc.edu/~dtang/hce2/index.phpIm concerned with both the masthead (where it says Health Care Engineering) and the div with the three images. When i resize the browser and keep making the width smaller, the divs that hold these images keeps getting smaller because i specified a margin-left and margin-right of 5%. The divs keep getting smaller even when i go past the images. Instead, I just want the div to stop getting smaller once it hits the image and then make the margins smallers and show less of my page as you continue to make the browser window width smaller.Similar to the effect on this page when you resize the browser:http://itp.usc.edu/Anyone know how to do this? here is my HTML code for my masthead: <div id="masthead"><table border="0" cellspacing="0" cellpadding="0"><tr><td width="33%" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="http://www.usc.edu" target="_blank"><img src="usc_name_black.gif" alt="USC" width="315" height="25" border="0" /></a></td> </tr> <tr> <td><a href="http://healthcareengineering.usc.edu/"><img src="title.jpg" alt="USC" width="475" height="50" border="0" /></a></td> </tr> </table></td><td width="33%" align="right"><table width="70%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right"><a href="http://www.usc.edu" target="_blank"><img src="mono-white-cardinal-big.gif" alt="USC" width="94" height="75" border="0" /></a></td> </tr></table></td></tr></table></div> and here is my CSS for the masthead: #masthead {margin-left:5%;margin-right:5%;padding: 0px;border:1px solid #000;background-color:#990000;}
  2. so here i want to plot points on a google map. the points are coming from an array. I want to loop through the 'for loop' towards the bottom of the script, and each time it calls my plotPoint function and passes it a new address. But its not working. What am i doing wrong? anyone know? Thanks! <!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>ITP 404 - HW 6</title><script src="http://maps.google.com/maps?file=api" type="text/javascript"></script><script type="text/javascript">var uscInfo = new Array(5);//this creates a multidimensional arrayfor(i=0; i<5; i++) { uscInfo[i] = new Array(2);}uscInfo[0][0] = '839 Childs Way, Los Angeles, CA 90089';uscInfo[0][1] = 'tutor.jpg';uscInfo[1][0] = '3715 McClintock Avenue, Los Angeles, CA 90089';uscInfo[1][1] = 'ISE.jpg';uscInfo[2][0] = '3650 McClintock Ave, Los Angeles, CA 90089';uscInfo[2][1] = 'itp.jpg';uscInfo[3][0] = '1025 West 34th Street, Los Angeles, California 90089';uscInfo[3][1] = 'ee.jpg';uscInfo[4][0] = '3620 South Vermont Ave., Los Angeles, California 90089';uscInfo[4][1] = 'kap.jpg';var map = null;var geocoder = null;var uscAddress = 'University of Southern California, Los Angeles, CA 90089'; function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(address); } } ); } } //end of showAddress function function plotPoint(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { //map.setCenter(point, 13); map.addOverlay(new GMarker(point)) //var marker = new GMarker(point); //map.addOverlay(marker); marker.openInfoWindowHtml(address); } } ); } } function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); //map.setCenter(new GLatLng(37.4419, -122.1419), 13); geocoder = new GClientGeocoder(); map.setCenter(showAddress(uscAddress), 13); for(i=0; i<5; i++) { plotPoint(uscInfo[i][0]); } } }</script></head> <body onload="initialize();" onunload="GUnload()"> <div id="map_canvas" style="width: 700px; height: 500px"></div> </body></html>
  3. mysql_connect(servername,username,password);Im using XAMPP, so on my files where i connect to my MYSQL db, my servername by default is localhost, username is 'root', and the password is blank.When i host, do i need to change this, even if i place my mysql db in a secure directory?
  4. what does return do? Ive never really been familiar with this, except the fact it can return a value. what does return alone do?
  5. So here is my routine. I want to abort the script inside the first if statement, so that when you click once, the div is displayed, and when you click a 2nd time, it hides. But this doesnt work if you reset x equal to 0, because it just keeps the div displayed. And if you dont reset x to 0, the 3rd click (if you wanted to show the div again), wont do anything. Any ideas?<script language="javascript">var x = 0;function showBody() {if(x == 1) { document.getElementById('body').style.display='none'; x=0;//NEED EXIT OR ABORT FUNCTION HERE............................................... }if(x == 0) { document.getElementById('body').style.display='block'; x = 1;}}</script><div onclick="showBody();">click here</div><div id="body" style="display:none;">this is the hidden body</div>
  6. So would i be using a function in SQL that escapes out quotation marks? haha good point.
  7. is there a way you can view how many times your site has been viewed without putting an actual counter on the page? I use Google Webmaster Tools but I dont think it has that feature.
  8. I created the site in ColdFusion. Are you familiar with the language? Right now the page errors if any of the following words or characters are submitted.* < > = - _ ; insert update delete Would this prevent a good number of sql injections? I didnt want to eliminate single quotes, since that can be used regularly and i didnt know how to parse that out.
  9. Basically what i did was on my process page, if any of the form fields contained * or < or >, the page would give an error message and not load the rest of the page or process any of my server code. does that work partially to?for a sql injection to work, wouldnt the hacker need to know the db table and field names? the file permissions were changed on my db file so that someone browsing couldnt view it.
  10. I recently created a coldfusion site using an access database. I did both client (javascript) and server side validation so that all form fields wont accept characters like * < or > or certain words like (insert, delete, update). I also put maximum lengths on all form fields through server side validation. I was wondering what other measures i could do that would prevent hacking or sql injections. Im not too familiar with sql injections and how they work, so any feedback would be appreciated!
  11. is there a function in CF similar to javascript's indexOf method? i wanted to do server side validation but the Adobe CF book vol 1 doesnt go over much server side validation w/ cfif blocks.
  12. in php/mysql development, do most people use the GUI or the command line utility?
  13. do i use these to create the db examples? if so, how?
  14. thanks.also, i am using a book to help me learn, and it came with 2 .sql files. What are these? and where in my XAMPP folder would i put them to use them?
  15. skaterdav85

    Basic Mysql Help

    sorry if this is a newby question, but im new to mysql. So I installed MySQL, but i dont know how to access the mysql command-line utility. how do i get there?I also installed XAMPP on my other computer and am using phpmyadmin to create a mysql database. does that have a mysql command line prompt instead of teh GUI?Thanks!
  16. why is there three equal signs? still confused on that.
  17. Hi,So i used the strpos method in my condition to see if a state begins with the letter 'c', then make the table cell red. However this doesnt work. I used the substring method to achieve the same thing and this DID work. Anyone know why? <body><?php $state[0] = 'alabama'; $tax[0] = 4;$state[1] = 'alaska'; $tax[1] = 0;$state[2] = 'arizona'; $tax[2] = 5.6;$state[3] = 'california'; $tax[3] = 7.25;$state[4] = 'colorado'; $tax[4] = 2.9;$state[5] = 'connecticut'; $tax[5] = 6;$state[6] = 'delaware'; $tax[6] = 0;$state[7] = 'florida'; $tax[7] = 6;$state[8] = 'georgia'; $tax[8] = 4;$state[9] = 'hawaii'; $tax[9] = 4;$state[10] = 'idaho'; $tax[10] = 5;$state[11] = 'illinois'; $tax[11] = 6.25;$state[12] = 'massachusetts'; $tax[12] = 5;$state[13] = 'oklahoma'; $tax[13] = 4.5;$state[14] = 'oregon'; $tax[14] = 0;function calcTC($taxrate) { $TC = 200.00*(1 + $taxrate/100); return $TC;}?><table><?phpfor($count=0; $count<count($state); $count++) { echo ("<tr>"); if(substr($state[$count] , 0, 1) == 'c') { //if( strpos($state[$count],'c') == '0' ) { echo ("<td bgcolor='red'>"); } else { echo ("<td>"); } echo ($state[$count] . "</td>"); echo ("<td>".$tax[$count]."</td>"); echo ("<td>".calcTC($tax[$count])."</td>"); echo ("</tr>");}?></table></body>
  18. So i wrote a script where when a user mouses over a link, it shows a layer and the layer moves according to where the mouse is. Now this works fine in IE and Safari, but in FF, it only shows and hides the layer and FF spits an error saying 'event is not defined' on line 22. However, when you use "event" as an argument for 'moveLayer(event)', it works fine in all 3 browsers. Does anyone know why? <html><head><style>#lay1 {border: 1px black solid;position:relative;top:200px;left:150px;z-index:1;background-color:red;width:100px;visibility:hidden;padding:5px;margin:5px;}</style><script type="text/javascript">function moveLayer(){ x=event.clientX; y=event.clientY; document.getElementById('lay1').style.top = y + 15 + "px"; document.getElementById('lay1').style.left = x - 50 + "px";}function layerVis(value) {document.getElementById('lay1').style.visibility=value;}</script></head><body><div id="lay1">hello world</div><center><a href="#" onMouseOver="layerVis('visible');" onMouseMove="moveLayer();" onMouseOut="layerVis('hidden');">LINK 1</a></center></body></html>
  19. good idea using the display property instead of innerHTML. that worked in IE and FF, and im assuming it will be fine in the other browsers. Thanks!
  20. anyone know of a program for Mac OSX similar to MS XML Notepad that validates against an XSD file?
  21. skaterdav85

    Layers

    ok well i want to learn how to create layered menus. but i dont know how to position layers so they stay under a particular link all the time.
  22. skaterdav85

    Layers

    i created a layer, but how do i always keep it under the link, despite when i resize the browser window? this is my code: <html><head><title>layers</title><style>#layer1 {position:relative;top:5px;left:10px;border:1px solid black;background-color:yellow;width:80px;visibility:hidden;}</style><script language="javascript">function showLayer() {document.getElementById('layer1').style.visibility='visible';}</script></head><body><div id="layer1">this is my first layer.</div><div align="center"><a href="#" onclick="showLayer();">Show Layer 1</a></div></body</html>
  23. ok here is the link where its at. just try typing in the email field a valid email address, and you'll notice how everything gets shifted down. I was using IE 7. it works fine though in safari, opera, and ff.http://www-scf.usc.edu/~dtang/PellaBella/contact.php
  24. so i created a form and did some JS validation on it. I have a text input field for emails, where if a condition is not met, it writes to an h3 tag"*please enter a valid email address".this works fine in the browsers, but in IE, it acts a little weird. even if the form is valid, it writes a blank space or line break or something to the h3 tag, shifting everything under it down a bit. In firefox, opera, and safari, it just doesn't write anything to the h3 tag, leaving all the text etc where it should be.anyone know how to stop IE from doing this? Thanks!
  25. well i went to this link: http://www.entropy.ch/software/macosx/php/and followed the following instructions. i can restart php by just reinstalling everytime, but that takes like 5 minutes each time. im sure theres another way to do it, im just too new at this to know haha.
×
×
  • Create New...