Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. They do it exactly the way I showed you. If you don't want to use the .html extenstion (which is a really good idea in this case for various reasons, not to mention highly SEO friendly) then you can just omit that from the regular expression in the RewriteRule I provided. RewriteEngine On RewriteRule ^([0-9a-z_\-]*) index.php?slug=$1 [L] I did omit the carat from the previous example .. that should have been there, but I have gone back and editted it.
  2. I didn't see from your log file it was leading memory. What is showing you that you have a memory leak?
  3. For the all in one packages, they include everything. I know you have posted other threads about this. You can either install apache/php/mysql seperately and configure them to work together or you can do an all in one install. You can't start mixing the two. Make sure you have no apache, php or mysql installed. It would probably be a good idea at this point to run a registry cleaner. A great free one is ccleaner. Run that in registry fix mode and let it clean out any crap you have accumulated. REBOOT. Then try installing xamp : http://www.apachefriends.org/en/xampp-windows.html
  4. I'm not seeing what the problem is here. The xmlreader and sax libraries both allow you to parse large files in pieces, and the code you have looks like it works fine and handles memory ok.
  5. Are you also planning to do php code to talk to mysql?
  6. Of course there could be a problem there and probably is. ODBC is a lowest common denominator technology. It was designed so people with excel could suck out some data from some funky datasource into their spreadsheet. It is slow and lacks functionality by definition. Figure out what your issue is with the native mysql driver. I'm sure I don't have to tell you that native db drivers are always the way to go especially when you're trying to store blobs or do anything else that is highly database specific. There's probably millions of websites running php/mysql and not a one uses odbc.
  7. Well there are a couple of things to this. The first is the type of the primary key column as DaiLaughing pointed out. What is VERY important is that your column be declared UNSIGNED. Even if it is not currently unsigned you can safely alter the table with no loss of data. If the column is not UNSIGNED then you only have access to half the available numbers, as it is reserving a bit for the sign, and half the potential range of values are allocated to negative integers. The rest of this comes down to the datatype that goes on byte boundaries. You have tinyint (1 byte), smallint (2 bytes), mediumint (3 bytes) int (4 bytes) and even Bigint (8 bytes). Very few sites will ever exceed the number of id's available from an unsigned int (4,294,967,295).
  8. What operating system are you installing mysql on.
  9. You have a mysql table... why in gods name are you trying to use odbc? mysql
  10. Without some code to look at there's not much we can do for you.
  11. Do you have a modification that takes the slug and looks up the story rather than the id? For example: index.php?slug=this_is_my_story You are going to need to to work prior to the rewrite. What I'd recommend is that you artifically append .html to the end of your slug urls. So the links that you would have to your stories would be: Latest Story Of course for this to work, you can't have any other .html url's for your site, or if you do you will need a specific rewrite rule to handle them so that the rule that will rewrite these slugged urls won't mistakenly rewrite those. With that said something like this in your site .htaccess is typical RewriteEngine On RewriteRule ^([0-9a-z_\-]*)\.html index.php?slug=$1 [L]
  12. eMonk: When you do a mysql_query() the mysql server calculates the result. That result then sits on the server. In order to access it you have to fetch the individual rows. This is clearly shown in the php manual, so I'm not going to post it here. There are many different ways to fetch but the one I recommend for most people is mysql_fetch_assoc
  13. Sure that type of thing could be fairly easily done using jquery. You have your drop down and you have a input type="text" element that is hidden. You need a little bit of javascript that you'll attach to your drop down list element's onChange event, which again can be done very simply with jquery, that simply checks the value of the input element and does a toggle().
  14. And for the record, we both know that you are not starting out. You're one of those people who has some business and you need this system and for whatever reason you are in over your head. Rather than just admit that, you're playing this game where you think that we're stupid, and you can snow us with this "gee shucks I'm just a beginner" act, and we'll all jump in and code what you need, and then when you have what you are looking to get from us, we'll never see you again, nor will you actually be writing code. I knew this all along, but I thought I'd do you a favor and if it wasn't too big of a deal I'd do your code for you, and you'd go on your merry way. And since you asked, no I didn't get any help starting out. I've been programming for a long long time, in a lot of different computer languages for a number of different companies and industries. The way I started out? I sat down with a couple of books and read them cover to cover, and then I started writing programs. And I continued to do this, and even as we speak I continue to study and review, and most of all I try and remain open to learning new things and new ways to do things which is not easy to do at a certain point in life, but it's very much a reality of this business. People like you come to this site every day. Even though we have guidelines and a terms of service which people either don't read or just choose to ignore they come in droves looking for "free programming" and in dribs and drabs we often give that out, even though we're very clear that we're here as a community for developers. So the reality of this situation is... even though I know you are not a programmer, and will never be a programmer, I answered you anyways, because really I'm too nice of a guy. The saddest thing is that had you just swallowed your pride and showed a small degree of courtesy I would probably have given you something very close to the code you wanted, if not the code you needed exactly. If you'd answered the question that I asked you multiple times, I probably would have helped you out. I know a lot about the state of forums on the internet. Try jumping on irc into the #php channel sometime and try to get some help for what you're doing and you'll find out what php developers think of people with questions like yours. This site is the most visited help site on the web for a reason. If you can't get help here, you are truly screwed. And of course you could just spend the $100 or whatever it might cost you to actually hire someone to spend a few hours fixing this code for you, although from the looks of it, it's a complete mess.
  15. I'm not sure if I can help you because this site is a place where developers and in some cases designers can get help and advice with specific questions. I understand that you have a static website that nonetheless has a consistent design. You also have a wordpress install that for some reason is godawful slow, but from what I gather is not what you want because it does not really match the look and feel of the rest of the site. What I'm saying to you is that typically people want a CMS. The main reason for this is so that they can easily update content. They want to make a blog entry to talk about something related to their craft, or promote something. I understand what type of site you have and what the genre is. I could take all your existing pages and probably stitch them together into something dynamic and embed a piece of a blog in it as well. So could countless other developers here. The question is... can we lead you by the hand through that process? It's highly unlikely you'll get that type of help here. So I jumped ahead and basically tried to advise you on how you could get something like the site you posted which looks to me like it is probably using a cms or blog as it's base engine. This is why I linked the joomla site which although primarily a vblog has many of the same features as the site you linked, including categories, and blocks of content that look like they are driven by modules. There is nothing special about a CMS or a blog like wordpress to developers like myself. They are written in PHP and we can read that code. All the blogs and CMS's out there do tend to have one thing that makes them useful to people and that is that they have templates, which I referred to. The template is what gives the site it's organization and look and feel. That is why I brought up them up. You could take your entire existing site, move it into a joomla install and it would look like it does now --- if you have your custom template installed!
  16. There is a reason NOBODY else replied to you. Feel free to look around and notice some of the other threads that receive multiple replies here, and ask yourself why I'm the only one who replied. I asked you a specific question and for good reason. Apparently you have absolutely no idea what your existing code does. You can't read it at all or understand it can you? Your code displays a list of RATES. These rates vary. There is no totaling being done when you have a single rate. So why would anyone assume to understand what sort of totaling you expect when you have multiple different rates per day? You don't figure that out when you have one day, but now you want to figure it out and display something entirely different simply because there are 2 different rates involved? But by all means, it is me who has the problem communicating even though I asked you a very specific and reasonable question which you did not answer. Furthermore your command of written english is not very good. Just to clarify, this is TRIVIAL to me. The problem exists with you and your inability to express your question in a clear manner either because you are too befuddled or too lazy or some combination of both. Apparently you are unaware that words have precise meanings. MAX() as a function returns the largest. And yet you want a "total" ie. a SUM() which takes a range of numbers and adds them together. Are you unaware that max and sum are two entirely different things? Here's an example of what you might have said that would actually make sense and be achievable: "I want to calculate the number of days in each range, and multiply days * rate. Then ADD the sum for each date range and display a total." The people who answer questions here do so as a public service to people, and you have the unmitigated gall to question someone with 4k answers (nevermind the 3k I answered in prior incarnations of the board), suggest that I'm in someway dense, when I'm a professional developer by trade who has coded literally hundreds of websites visited by tens of millions of people, and then chide me for being sarcastic? Here's an example of sarcasm so that you actually can understand what it is. "Let's review--- you can't program and you want someone here to write the code that you can't write, code you already admitted in a roundabout way that someone else wrote, and that you ostensibly paid something for. Now rather than paying someone to complete, add or fix it for you, you come here asking how to fix what you can't (or in other words, PROGRAM) but you don't consider that looking for 'free programming.' I guess when you go down to your mechanic you ask them to fix your car, when they give you the bill you say: well I popped the hood open and I knew something was wrong with the engine... I mean gee I all you did was fix it." ^^^^^^^^^ Sarcasm Trust me, your presence will not be missed. I would ban you in advance but that would require another minute of my time, and I don't want it to waste that on someone of your ilk.
  17. You need to do a better job explaining what you're asking for. A picture wouldn't hurt either --- people call those "wireframes" typically.
  18. The problem is that the site you have is nothing but a bunch of static html pages. So there is nothing for the blog to "live within". What most people have is a CMS or blog that they use as the basis for their site. Wordpress can be blown up via modules and extensions into a full site. For example you could do a full site in joomla, drupal, wordpress or Serendipity to name just a few solutions. CMS's have blog modules built in for the most part. For example, here's a cms I built for someone with joomla: http://www.gb4k.com/ The problem is that you need to be able to translate a design into a template at minimum or pay someone to do it for your, which requires a good understanding of php/html & css.
  19. I don't see how what you are asking for makes any sense. If I am staying for 10 days, and the first 9 days the rates are offseason and the last day it's in season and the rates go up, what do you want to display. I asked for specifics, I'm not a mind reader, nor is anyone else here that I know of.
  20. Better yet, why not modify what you have to make it do what you want.
  21. You get the value of form submissions in the $_POST[] superglobal array. An update statement is generally: UPDATE table SET column="...some value" WHERE ... some criteria
  22. Nice stuff, imagemagick has some great features.
  23. Doing that is generally referred to as making a slug. You should write a function that sluggifies your title (replaces punctuation and spaces) and makes a unique string that you will need to save in your title table. It would be ideal if you had a script other than index.php so you could do a rewrite based on domain.com/story/slug.... but regardless the rest of the magic is typically done using mod_rewrite rules. The main confusion point for people seems to often be the links they need to use. When you supply links in your blog you need to output the rewritten form of the link. Nothing will automatically rewrite your output, so in other words, once your rewriting is working all your links should be either /story/slug or /slug depending on how your rewrite rules are working.
×
×
  • 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.