Jump to content

heavyEddie

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by heavyEddie

  1. That would certainly do it as well, but I found the answer... In my code I was calling a different variable than what this code was using. Man... I new it would be a stupid answer. If nothing else, folks can now see two methods for removing a trailing slash. I think I read someplace the using substr was faster than preg_replace. Not sure if that is accurate though.
  2. OK, I can't see any reason that this line of code isn't working. It is intended to remove a trailing slash if it exists... but it doesn't. It seems to work for displaying the string without the trailing slash, but not defining the variable. I have a feeling this is going to be a "DUH" moment. Doesn't work... if(substr($url, -1) == "/") $url = substr($url, 0, -1); However, this will display what I'm looking for if(substr($url, -1) == "/") echo substr($url, 0, -1);
  3. I ended up taking a different approach by writing some smarty modifier plugins. Thanks Daniel0 for a positive response and suggestion.
  4. This is a good starting point as for a class... if it is what you are looking for. http://www.ricocheting.com/perl/mysql.php
  5. I understand the basic concept of Tidy, but was curious if would allow me to customize the tags it recognizes and convert it to my own customized tags? I know I can use some preg commands for this purpose, but am kind of hoping it could be done at the same time I do some cleaning with tidy. Example: Dude, this is my wife.<comment>She is hot!</comment> would become: Dude, this is my wife. <span id="hot">She is hot!</comment> As always... your help and suggestions are welcome.
  6. Thanks for the technique! I'm not sure I will use it in this particular case, but in my library for sure.
  7. Yes, after thinking it through you folks are of course correct. I will probably have a category and rely on tags for an easy to find search.
  8. Thanks for the info folks... the goal is better SEO and not to make it worse. So, when I just read this article and it said to redirect to a single URL using a 301 redirect. Should the 2nd and 3rd url then redirect to the first? With a .html at the end
  9. On a new site I'm working on I'm using .htacess and mod_rewrite so I can create URLs that are SEO friendly. For example... http://www.bla.com/products/kitchen/coffee-pot http://www.bla.com/products/food/beverage/coffee-pot http://www.bla.com/products/x43252 (coffee pot model #) Ultimately, all these URLs will point to the same page. I know the first two examples are good for SEO, but the 3rd probably is not. Is it a good idea to redirect these two one of the other URLs or leave it alone?
  10. I'm going for two things with this method. One is attractive rounded corners and the 2nd is that the corners are not printed with the page. Will the leaner keep all the corners as background images? If so, I'm always interested in a leaner, faster loading page.
  11. That did the trick... the server should be online this weekend and I will be able to start putting the design up for a more detailed look. I can handle most of the PHP/MySQL issues, but the design aspect is new to me. Thank you very much! I think I will go learn up on the :before and :after.
  12. I've been playing with this a few days, and figure it is time for some help. So, here a screen shot is attached of what is happening. To summarize, I have a large set of divs that create a rounded corner effect. Unfortunatly, it isn't liquid so it isn't adjusting the height as I had hoped it would. Any help greatly appreciated. CSS Below #content_t { background: url(/home/ed/Desktop/x/images/content_t.png) 0 0 repeat-x; width: 720px; margin-top: 23px; margin-left: 20px; float: left; } #content_b { background: url(/home/ed/Desktop/x/images/content_b.png) 0 100% repeat-x; } #content_l { background: url(/home/ed/Desktop/x/images/content_l.png) 0 0 repeat-y; } #content_r { background: url(/home/ed/Desktop/x/images/content_r.png) 100% 0 repeat-y; } #content_bl { background: url(/home/ed/Desktop/x/images/content_bl.png) 0 100% no-repeat; } #content_br { background: url(/home/ed/Desktop/x/images/content_br.png) 100% 100% no-repeat; } #content_tl { background: url(/home/ed/Desktop/x/images/content_tl.png) 0 0 no-repeat; } #content_tr { background: url(/home/ed/Desktop/x/images/content_tr.png) 100% 0 no-repeat; padding: 60px 15px 50px 15px; height: 100%; } #content_left { width: 200px; background-color: #cccccc; float: left; } #content_right { width: 300px; background-color: red; float: left; } HTML below <div id="content_t"> <div id="content_b"> <div id="content_l"> <div id="content_r"> <div id="content_bl"> <div id="content_br"> <div id="content_tl"> <div id="content_tr"> <div style="posistion:absolute;"> <div id="content_left"> dudeaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaa a a aaaaaaaaaaa a a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br> dude<br> dude<br> dude<br> dude<br> dude<br> dude<br> dude<br> dude<br> dude<br> dude<br> </div> <div id="content_right"> right<br> right<br> right<br> right<br> right<br> right<br> right<br> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> [attachment deleted by admin]
  13. Field and Values in slibrary id = 1 display = 'yes' id = 2 display = 'yes' id = c999 display = 'no' id = 5 display = 'yes' id = c822 display = 'yes' Field and Values in clibrary cid = 999 name = 'how to walk a dog' cid = 822 name = 'how to wlak a cat' Desired output id display name 999 no how to walk a dog 822 yes how to walk a cat
  14. I've searched around, but this type of question is really hard to find any kind of hits with. So... I have two tables. The first has a field called "id" that can be numeric or have "c" prefixed to a number. The second has a field called "cid" that will match the "id" field with the prefixed "c" So, the challenge is to join the tables and strip the prefixed "c" on the "id" field and then use it in the join. My query looks like this, but it doesn't work since it will not recognize cid. SELECT s.id, s.display, IF(LEFT(s.id, 1) = 'c', SUBSTRING(s.id,2), s.id) as cid, c.name FROM slibrary AS s INNER JOIN clibrary AS c ON cid = c Is this possible?
  15. Don't I feel silly... Thanks, the extra argument was the issue. I am parsing each line of the file, which is why I'm not using file_get_contents(). Thanks for the help and advise!
  16. I'm trying to use the code below to parse some information in a text file that is generated on a remote server. If I use stream_get_line it works nicely, but fgets simply gets stuck in an endless loop. Any ideas? I wish to use fgets since it appears that stream_get_line isn't available on many hosts. $file = "http://www.site.com/bla.pl?id=1"; $handle = fopen($file, "r"); // Read each line of the file and check to see if this person is still logged in or not. if ($handle) { while (!feof($handle)) { //$buffer = stream_get_line($handle, 1000, "\n"); $buffer = fgets($handle, 4096, "\n"); //bla bla bla bla bla } fclose($handle); }
  17. I have a need to use something like the RSA SecuriID system on a website. The question is... how can I do it REAL cheap? I need about 10 folks to have access and don't mind hitting an API on some other site to help authenticate if needed. I can spend a few hundred dollars, but can never afford the entire setup. Any ideas?
  18. Never mind, this seems to work well... echo '<img src="captcha.php?id=' . $id . '" onclick="javascript: this.src=\'captcha.php?id=' . $id . '&time=\' + (new Date()).getTime();" />';
  19. I'm trying to force my captch to reload the image when a user clicks the image. However, if you don't provide a unique URL some browsers will use a cached version of the image and not reload. So, this is the code I'm trying to use, but it seems I'm doing something wrong. Comes back with "now is not defined". I'm pretty sure this is javascript 101 echo '<img src="captcha.php?id=' . $id . '" onclick="javascript: this.src=\'captcha.php?id=' . $id . '&time=\' + now.getTime();" />';
  20. http://en.wikipedia.org/wiki/Tag_%28metadata%29
  21. For a site I'm working on I need to create a tagging system. As far as I can see there is two approaches... Approach 1 would be to to have a comma delimited field associated with each record that folks place the tags when they submit. This will require parsing for every search but would keep the tables themselves pretty simple. Approach 2 would be to create a separate table and literally place and have a tag word for each record. This could create a whopper of a table, but would probably be less work and possibly faster. So, which would be faster? Any advise? Anything to watch for?
  22. Thanks guys... I apologize, I thought I responded but did not I ended up salting against a file located below the public_html. Not the best solution, but seems to be working fine.
  23. Thanks for the information. I suppose this really isn't all that much different than all the config.php files that forums and such use.
  24. I can't have the user decrypting it on their side... so I guess as secure as a guy can go without user intervention.
  25. I have a table that I'm thinking about putting some sensitive data in... any suggestions on how to encrypt the table so if I did get hacked I would still be somewhat protected?
×
×
  • 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.