Jump to content

ultraloveninja

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by ultraloveninja

  1. Ok, cool. So then this: $query = "select items from table_name where state = '$_GET[state]'; Would become this: $mysqli_query = "select items from table_name where state = ? Correct?
  2. Doing a phpinfo(); should let me know if mysqli is supported, right?
  3. I'm working on using a MySQL query to return some resutls based off getting part of the URL from a previous page. URL sample: <a href="http://site.com/file.php?alabama">Alabama</a> MySQL Query sample: $query = "select items from table_name where state = '$_GET[state]'; Which will then query the database based off the state name and then spit out an array with the data, etc. I'm not too sure what the "safest" way to accomplish this is though since I've been informed that this will lend to possible SQL injection. Any suggestions on how to escape this properly?
  4. Ahhh, cool! Yeah, I think that will work. I'll mess around with it and if I have any other questions, I'll let you know. Thanks!
  5. I'm working on getting a result returned from MySQL to output an array of items to be rendered into HTML. My current code functions like so: $query = "select stores,item1,item2 from wp_dbt_nonnis_distro_data where state = '$_GET[state]' order by stores asc"; $result = mysql_query($query,$conn); while ($row = mysql_fetch_array($result)){ $stores = $row['stores']; $item1= $row['item1']; $item2= $row['item2']; $new1 = str_replace(',', '</li><li>', $item1); $new2 = str_replace(',', '</li><li>', $item2); echo <<<END <div class="stores"> <h2>Store Name: $stores</h2> <h3>Brands Carried:</h3> <div class="items"> <p>Item1</p> <ul><li>$new1</li></ul> </div> <div class="items"> <p>Item2</p> <ul><li>$new2</li></ul> </div> </div> END; } So far, this works fine for returning the items and then replacing the comma (since the items are separated by commas within the DB) and then creating the list items for the HTML. Only thing is that if there are no items returned for a particular item, it just shows an empty bulleted list item. I'm not sure how to get it to check the array and see if there is anything that comes back for each item and if not, then have it display some text like "Not Available".
  6. You probably want to looking into using something like a jquery tooltip. If you do a Google search for jquery tooltip you'll find a bunch of resources and docs about creating them.
  7. Are you getting broken image links or are they not being outputted correctly? What does it look like when you view the source of the page?
  8. Never mind, I figured out a soluion by using a GET from the URL to pass to script.
  9. I'm working on an interactive map and I am wondering if it's possible to pass part of a URL to a PHP script and have it look up information and then fetch it back to display within an iframe in a lightwindow? The map is CSS based and each the link on each state within the href contains the state name (e.g. - #statename). When a user clicks on the map, the #statename is appended to the URL. I'm wondering that if it's possible to pass that part of the URL (#statename) to PHP and have it run the script from there? Here's a link to the interactive map that I am working on. If you click on the state of Texas you'll see what I mean: http://sjdunham.com/beta/maptest/ I'm not too familiar with AJAX and JS all very much. I can get my way around jQuery but I'm not sure if there will be any conflicts with using Shadowbox in there already or what.
  10. I'm using the javascript version from http://detectmobilebrowsers.com/ to redirect to a mobile site. The only thing is that I have a link to go to the full site in the off chance that users want/need to go there. However, when you click on the link to view the full site from the mobile, it picks back up on the redirection and kicks it back to the mobile version and not to the full site. I was doing some searching and was wondering if it could be possible to hack it so that it uses window.location.href.indexOf or somthing of that nature like this: if(window.location.href.indexOf("mobile/index.html") > -1) {window.location = "http://thefullsiteURL.com"} else { function (a, b) { if (//mobile direction stuff from detectmobilebrowsers.com })(navigator.userAgent || navigator.vendor || window.opera, 'http://thefullsiteURL.com/mobile/index.html')}; Does that look like it's even possible?
  11. I think that you need to return the focus to the div or item that you want such as : div.focus() or something of that sort
  12. I'm working on the ability to show/hide div's when an image is clicked and to randomly show divs on page load. I'm not quite sure why it works in the testing area (JSfiddle) but not when I implement it into the site. Here a link to the fiddle: http://jsfiddle.net/JmVUx/17/ And here's a demo to the site I am working on: http://sjdunham.com/test/yzn/ Am I missing something? Not too sure what could be the difference between the two. I've tried stripping out any other references to other scripts and still no go. Any help is greatly appreciated. Thanks!
  13. Ok. I'll have to read up on that some more. Thanks for your help tho!
  14. Ahhh...ok. So, how does that work then? Is it because $i is already in the for loop?
  15. I am using scandir to scan two folders and then output the HTML. I can get it to work for one directory (the thumbnails) but I'm not sure how to get the other directory to output the array. Here's my code: <?php $dir2 = 'basement-pics'; $scan2 = scandir($dir2); $dir = 'basement-pics/thumbs/'; $scan = scandir($dir); for ($i = 0; $i<count($scan); $i++) { if ($scan[$i] != '.' && $scan[$i] != '..') { echo '<a href="' . $scan2 . '"><img src="basement-pics/thumbs/' . $scan[$i]. '" /></a>'; } }; ?> This is new ground for me so any help is greatly appreciated. Thanks!
  16. Gotcha. I moved all the other non-image variables outside of the image conditional stuff and it worked. I am still working on it, so I am going to add the sanitary stuff now. Thanks for all your help!
  17. Ok, I'll try that and get back to you in a bit. Thanks!
  18. I did a print for the full insert string which comes up as this when I have a picture: insert ignore into tbl_tribue (petname,familyname,letter,description,imgpath,thumbpath) values ('test','test','A','test','images/DSC00161-mod.jpg','images/smallDSC00161-mod.jpg') and this is the print string when I do not have a pic: insert ignore into tbl_tribue (petname,familyname,letter,description,imgpath,thumbpath) values ('tes2','test2','A','','','') I can try to echo out the variables and get back in a few...
  19. I also had no idea that you could scrape a site with file_get_contents()
  20. Looks like you already have it defined: $tags = get_meta_tags("$website"); Then make your SQL query like this: mysql_query("INSERT INTO ls_sites (site_title, site_url, site_desc) VALUES ('$tags', 'Griffin', '35')");
  21. What other information are you looking to collect? If you are looking for a web crawler, then you might want to look into Nutch: http://nutch.apache.org/ I am not sure that PHP is going to "scrape" info off of a site.
  22. I googled: php live chat open source and this is what I found: http://mibew.org/ https://blueimp.net/ajax/ http://www.webresourcesdepot.com/open-source-live-support-open-web-messenger/
×
×
  • 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.