Jump to content

niche

Members
  • Posts

    3,671
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by niche

  1. This is my first completely original JS. Why is my italian button so small? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="description" content="Save money" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>subcat</title><script type="text/javascript">function subcat() { var div = document.getElementById('subcat'); //get the container on the page div.innerHTML = ''; //clear out the subcat var new_subcat = document.createElement('form'); //create form new_subcat.action = "italian.php"; new_subcat.id = "italian"; var new_subcatB = document.createElement('button'); //create button new_subcatB.class = "button"; new_subcatB.type = "input"; div.appendChild(new_subcat); //div.appendChild(new_subcatB); //document.getElementById('italian').innerHTML=new_subcatB; document.getElementById('italian').appendChild(new_subcatB);}</script><style type="text/css">.button {padding:0px;width:82px;height:40px;vertical-align:top;}</style></head><body><?phpecho '<div style="float:left;height:100px;width:350px;background:yellow;">'; echo '<div style="float:left;height:40px;width:350px;background:pink;">'; echo '<button class="button" onclick="subcat()" >restaurants'; echo '</button>'; echo '</div>'; echo '<div id="subcat" style="float:left;height:40px;width:350px;background:Aqua;">'; echo '</div>';echo '</div>';?> </body></html>
  2. If I don't say this, someone else will. Please post in the html forum and put your code in a code tag (<>).. I'd prefer that you combine your code in a single script, but it's not required. One other suggestion, if your question is just about your anchors, limit your code to the part that's relevant to your question. Here again, not required, but I think your get more help, faster, by not making us wade through code that's not really connected to your question, IMO.
  3. I had to google web matrix. I just use a text editor (notepad++). I suppose that most use something similar if they want to code. Anyway, there's no substitute for just getting started. As much as I'd like to just use someone else's code (ummodified), I hardy ever get away with that. It's just easier to write it from scratch. Though that doesn't stop me from occassionly trying to use another's code like I did last night. I tried using google "free" code to map locations. It got six hours of my life until I discovered where it was headed and just wrote my own code to dynamically edit their iframe. My point is just start creating by putting your logo at the top of a page. Start that way, but don't forget the DOCTYPE. It's that easy to get started and we'll be there to to help you with your code.
  4. IMO, there's lots of hand holding here, but only on specific questions. That means you need to display the code you're working on (the shorter the better) and tell us about the problem/error message(s). Ironically, the more informed you are, the faster you'll get an answer. Make your questions as specific and complete as possible. EDIT:If you don't have code to display with your question, you probably haven't done enough research unless you're asking about keywords and function names.
  5. I found that I can dynamically edit the google iframe with my own code and by pass all the disfunctional google code. You get the iframe from the link button on a google map. It will look like this: <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=7327+S+30th+St,+Lincoln,+NE&aq=&sll=40.810476,-96.678362&sspn=0.008819,0.020041&ie=UTF8&hq=&hnear=7327+S+30th+St,+Lincoln,+Nebraska+68516&ll=40.737174,-96.675671&spn=0.008828,0.020041&t=m&z=14&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=7327+S+30th+St,+Lincoln,+NE&aq=&sll=40.810476,-96.678362&sspn=0.008819,0.020041&ie=UTF8&hq=&hnear=7327+S+30th+St,+Lincoln,+Nebraska+68516&ll=40.737174,-96.675671&spn=0.008828,0.020041&t=m&z=14&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small> You can make it dynamic like this: <?php$hn = "7327";$dir = "S";$sn = "30th";$stype = "St";$city = "Lincoln";$st = "Nebraska";$zip = "68516";$locationString = "$hn,+$dir,+$sn,+$stype,+$city,+$st,+$zip"; ?><iframe width="225" height="150" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=4<?php echo $locationString; ?>&oe=utf-8&client=firefox-a&ie=UTF8&hq=&hnear=<?php echo $locationString; ?>&ll=&spn=0.008827,0.020041&t=m&z=14&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?q=<?php echo $locationString; ?>&oe=utf-8&client=firefox-a&ie=UTF8&hq=&hnear=<?php echo $locationString; ?>&ll=&spn=0.008827,0.020041&t=m&z=14&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small> Google sucked 6 hours out of my life playing with their tutorial. Altering their iframe took about 20 min. Obviously, I still have to connect it with a table. Time to hit the rack.
  6. Line 6 should be: $doc = new DOMDocument("1.0");instead of: $doc = DOMDocument("1.0");according to: http://php.net/manual/en/domdocument.construct.phpThe error messages now are:Warning: domdocument::domdocument() [domdocument.domdocument]: Entity: line 1: parser error : Start tag expected, '<' not found in E:\wamp\www\phpsqlajax_genxml.php on line 6Warning: domdocument::domdocument() [domdocument.domdocument]: 1.0 in E:\wamp\www\phpsqlajax_genxml.php on line 6Warning: domdocument::domdocument() [domdocument.domdocument]: ^ in E:\wamp\www\phpsqlajax_genxml.php on line 6Fatal error: Call to undefined method domdocument::createElement() in E:\wamp\www\phpsqlajax_genxml.php on line 7
  7. Apparently the original script is for PHP4 according to: http://stackoverflow.com/questions/2467448/using-php-mysql-with-google-maps Here's the php5 version, but it still produces this error : any ideas? Fatal error: Call to undefined function DOMDocument() in E:\wamp\www\phpsqlajax_genxml.php on line 6 I changed line 6 from $doc = new DOMDocument("1.0"); to $doc = DOMDocument("1.0"); I couldn't find new DOMDocument in the manual. PHP5 version: <?phprequire("phpsqlajax_dbinfo.php");// Start XML file, create parent node$doc = new DOMDocument("1.0");$node = $doc->createElement("markers");$parnode = $doc->appendChild($node);// Opens a connection to a mySQL server$connection=mysql_connect ('localhost', $username, $password);if (!$connection) { die('Not connected : ' . mysql_error());}// Set the active mySQL database$db_selected = mysql_select_db($database, $connection);if (!$db_selected) { die ('Can\'t use db : ' . mysql_error());}// Select all the rows in the markers table$query = "SELECT * FROM markers WHERE 1";$result = mysql_query($query);if (!$result) { die('Invalid query: ' . mysql_error());}header("Content-type: text/xml");// Iterate through the rows, adding XML nodes for eachwhile ($row = @mysql_fetch_assoc($result)){ // ADD TO XML DOCUMENT NODE $node = $doc->createElement("marker"); $newnode = $parnode->appendChild($node); $newnode->set_attribute("name", $row['name']); $newnode->set_attribute("address", $row['address']); $newnode->set_attribute("lat", $row['lat']); $newnode->set_attribute("lng", $row['lng']); $newnode->set_attribute("type", $row['type']);}echo $doc->saveXML();?>
  8. Looks like it needs some work. Do you have a specific question?
  9. I'm trying to use this script from: https://developers.g...cles/phpsqlajax Google calls this script: phpsqlajax_genxml.php I've checked the php_domxml extension and restarted my wampserver. I'm running php 5.2.9-2. I've defined $username, $password, and $database per instructions in a script called phpsqlajax_dbinfo.php. It's causing errors. Do you know what's causing these problems? Warning: domnode::append_child() expects parameter 1 to be object, null given in E:\wamp\www\phpsqlajax_genxml.php on line 7 Notice: Use of undefined constant localhost - assumed 'localhost' in E:\wamp\www\phpsqlajax_genxml.php on line 10 Notice: Undefined variable: username in E:\wamp\www\phpsqlajax_genxml.php on line 10 Notice: Undefined variable: password in E:\wamp\www\phpsqlajax_genxml.php on line 10 Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\wamp\www\phpsqlajax_genxml.php on line 10 Not connected : Access denied for user 'ODBC'@'localhost' (using password: NO) The script: <?phprequire("phpsqlajax_dbinfo.php"); // Start XML file, create parent node$doc = domxml_new_doc("1.0");$node = $doc->create_element("markers");$parnode = $doc->append_child($node);// Opens a connection to a mySQL server$connection=mysql_connect ("localhost", $username, $password);if (!$connection) { die('Not connected : ' . mysql_error());}// Set the active mySQL database$db_selected = mysql_select_db($database, $connection);if (!$db_selected) { die ('Can't use db : ' . mysql_error());}// Select all the rows in the markers table$query = "SELECT * FROM markers WHERE 1";$result = mysql_query($query);if (!$result) { die('Invalid query: ' . mysql_error());}header("Content-type: text/xml");// Iterate through the rows, adding XML nodes for eachwhile ($row = @mysql_fetch_assoc($result)){ // ADD TO XML DOCUMENT NODE $node = $doc->create_element("marker"); $newnode = $parnode->append_child($node); $newnode->set_attribute("name", $row['name']); $newnode->set_attribute("address", $row['address']); $newnode->set_attribute("lat", $row['lat']); $newnode->set_attribute("lng", $row['lng']); $newnode->set_attribute("type", $row['type']);}$xmlfile = $doc->dump_mem();echo $xmlfile;?>
  10. That's good. Did you add or die(mysql_error()); to the end of your queries?
  11. Change if(mysql_num_rows($result)>0) to mysql_num_rows($result);exit; and add code from post six to the end of your query. Then report back.
  12. rootKID, justsomeguy is right. The error said it was expecting a resource. The successful output from your query generates a sql resource so its absence says the query failed.
  13. I use or die(mysql_error());
  14. Your error is inside that big if statement starting on line 63. Empty it and confirm that you don't get the same error. Then start adding back lines until you find the problem. If you can't fix it let us know. EDIT:Use exit; to avoid misleading errors.
  15. Is shop_cat_id an numeric or a text? Also, what's on line 63?
  16. Please post just the part of your code that's malfunctioning as a single executable script that can be analyzed.
  17. niche

    Layout help

    At what point did your code start acting up?
  18. I didn't have the form in the flow. Thanks to all that read this post.
  19. The button, in the form, is forcing the lower right button out of the yellow div. Why? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><?php session_start(); ?><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="description" content="Save money" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>ebop </title><style type="text/css">.button {margin:0px;padding:0px;width:82px;height:40px;font-size:12px;vertical-align:top;}.message {position:relative;margin:10px 0px 0px -5px;background:white;width:100px;display:none;border-style:solid;border-width:4px;}.div{margin:0px 0px 0px 0px;float:left;overflow:visible;width:170px;height:85px;background:yellow;}.wrapper{width:595px;}button.button:hover div.message {display:block;}</style></head><body><?phpecho '<div class="div">'; //button div echo '<button class="button" >Item <br/>Info'; echo '</button>'; echo '<button class="button" >Company Info'; echo '</button>'; echo '<form action="cart.php" method="post" style="height:40px;width:82px;" >'; echo '<button class="button" type="submit" >Save for Printing</button>'; echo '</form>'; echo '<button class="button" >email Question'; echo '</button>';echo '</div>'; //closes button div?></body></html>
  20. position:relative; I was experimenting last night and forgot to change it back. Thanks for reading this topic.
  21. Placement of my hover messages seem to be affected as I scroll down the page. Before scrolling down, placement of my hover messages are adjacent to the button that creates the hover. As I scroll down the page, the hover messages are no longer adjacent to the button that produces it. What's the issue? Here's my PHP code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><?php session_start(); ?><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="description" content="Save money" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>ebop </title><style type="text/css">.button {margin:0px;padding:0px;width:60px;height:60px;font-size:12px;vertical-align:top;}.message {position:fixed;margin:10px 0px 0px -5px;background:white;width:100px;display:none;border-style:solid;border-width:4px;}.div{margin:0px 0px 0px 0px;float:left;overflow:visible;width:595px;height:420px;border-style:solid;border-width:4px;}.wrapper{width:595px;}button.button:hover div.message {display:block;}</style></head><body><?phpecho '<div class="wrapper">'; echo '<div class="div">'; echo '<button class="button" >Item Info'; $item_info = "jh,kj hkhlh,kj, kh.,kj. lj,l. jhj.h ,j;jjh."; echo '<div class="message">' . $item_info . '</div>'; echo '</button>'; echo '</div>'; echo '<div class="div">'; echo '<button class="button" >Item Info'; $item_info = "jh,kj hkhlh,kj, kh.,kj. lj,l. jhj.h ,j;jjh."; echo '<div class="message">' . $item_info . '</div>'; echo '</button>'; echo '</div>'; echo '<div class="div">'; echo '<button class="button" >Item Info'; $item_info = "jh,kj hkhlh,kj, kh.,kj. lj,l. jhj.h ,j;jjh."; echo '<div class="message">' . $item_info . '</div>'; echo '</button>'; echo '</div>';echo '</div>';?></body></html>
  22. I learn something new here almost everyday. Thanks for your help ShadowMage.
×
×
  • Create New...