Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. The form simply needs to be around the elements you're submitting. Also, why are you using $PHP_SELF? That should be $_SERVER['PHP_SELF']. How are you accessing the post variables -- hopefully using $_POST[]?
  2. Are you actually using the post method in your form?
  3. Thanks for the info! I will keep that in mind. Unfortunately, I have a decent amount of dates that go back before 1901. But, I will keep this in mind if I can use it for any dates. Qadoshyah If that is the case, then I'd recommend you use an unsigned smallint. Only requires 2 bytes, and you will not have any issue with range, as it allows values up to 64k.
  4. It's confusing because there is no established standard way of handling this. Different people have different ways of doing it. One way is to have your beta and production be svn sandboxes. Thus whenever you want to bring your latest changes in, you simply do an svn up. The only downside to this is that you also have the svn cruft. I've seen elaborate systems using a combination of svnlook used in scripting up systems that find changes, and dump them into a staging directory, then use rsync to update the remote server. One thing to defnately look at is precommit and postcommit hooks. They can be used to do all sorts of things, like for example, in precommit, you could run php -l and disallow the commit if a php file has a syntax error.
  5. Even better, MySQL has a YEAR(4) type. The only caveat is that the year has to be in the range of 1901 to 2155. Why should you care? With the myisam engine, a double column requires 8 bytes, whereas a year only requires 1 byte! Saving 7 bytes per row for both data and index if needed, is always extremely important to consider for a database of any significant size.
  6. As a web developer, javascript will be more beneficial in the near term.
  7. While wordpress is a blog, a blog is essentially a cms. I've seen many complete sites built ontop of wordpress. I guess it depends on your definitions. I would agree that the lines can be blurry, but in general CMS's are more general purpose, whereas blogs are tuned mainly for people to self publish. Of course once you have any sort of modularity, you can make either one look and act like the other.
  8. Understandable, and a good choice. Far too often people come in and get in over their head. If you're not a programmer or a student who wants to be a programmer, it's far better to get someone who knows what they are doing. Best of luck with your project.
  9. Just to reiterate, when you do a query you get a result SET. A set is 0 or more rows. When the result set is prepared in the sql server, it still has to be FETCHED. You do this in a loop because you don't know how many rows you might have in your result set --- it could be 0 or it could be a million or more, so you need to do the type of loop that jl5501 describes. In a nutshell, the reason you only see one row is that you are only fetching one row.
  10. A couple comments: First save yourself the headache and don't do a bunch of concatenated lines in a query string. Just one string will do fine: Yours: $result_ads = mysql_query("SELECT * FROM jobs ". "JOIN customer_info ON jobs.customer_id = customer_info.customer_id ". "JOIN bus_info ON jobs.bus_id = bus_info.bus_id ". "JOIN sides ON jobs.side_id=sides.side_id ". "ORDER BY bus_info.bus_number ASC") or die(mysql_error()); Should be: $result_ads = mysql_query("SELECT * FROM jobs JOIN customer_info ON jobs.customer_id = customer_info.customer_id JOIN bus_info ON jobs.bus_id = bus_info.bus_id JOIN sides ON jobs.side_id=sides.side_id ORDER BY bus_info.bus_number ASC") or die(mysql_error()); Now this shows you how to join up all the tables, which is fine. Hopefully you understand that you get a row for every time the tables join together, so you'll have multiple rows for a bus, for every side/advertiser you have. You'll have to use PHP to figure out when one bus starts and the next ends, in making your table. This basically means you need a variable for bus where you check when the bus changes, and close out your tr and start a new one whenever that occurs. The main issue you have right now is that your query doesn't actually specify any columns in any of the tables other than jobs. $result_ads = mysql_query("SELECT jobs.*, customer_info.*, bus_info.*, sides.* FROM jobs JOIN customer_info ON jobs.customer_id = customer_info.customer_id JOIN bus_info ON jobs.bus_id = bus_info.bus_id JOIN sides ON jobs.side_id=sides.side_id ORDER BY bus_info.bus_number ASC") or die(mysql_error()); This is just the easy way out because what you should really do is just specify the individual columns you need, like bus.name or what ever you need for your output. Because I don't know what your database schema looks like, I just put tablename.* for every table, but you should only query for the columns you need for your php script.
  11. If you use Joomla as you say, and the site uses Joomla, then there are about 10 different Joomla gallery modules. Some years ago I contributed to one of them (Ponygallery) and it has all the features you mentioned -- uploads, automatic thumbnailing and downscaling, and plenty of other bells and whistles. With that said there are numerous other ones you can find out about on the Joomla forums, which are by far the better place to seek help on a Joomla related question.
  12. It's comparing apples and oranges. Wordpress is a blog, not a cms. Joomla is probably the most CMS'ish of the 3. Drupal is more of a sitebuilding system. Out of the box it doesn't have a ton of functionality, but when you add in a bunch of core modules it becomes a very capable platform for developing a site. I agree 100% with whansen02 that you need to provide a lot more information. *If* you really know php well, you can make all 3 of these platforms do great things, but the same could be said for numerous other packages, not to mention a few key frameworks. If you want a blog, Wordpress is fine. With that said, most of the key people in the PHP community choose to run their blogs on Serendipity, which from an architectural standpoint is a lot cleaner and better built, and comes out of the box with optimizations like support for smarty and it's intrinsic page caching mechanism. If you're looking for a system as a non programmer, and it really does need to be a CMS, then of the 3, Joomla is the simplest and most functional out of the box.
  13. One way of answering this question is to put in timings around the scripts and major structural elements of your scripts. Another is to use XDebug and its profiling mode.
  14. Typically these patterns are used in GUI's to help with event handling. In a web environment, they really aren't that useful.
  15. Is vampirefreaks.com your site?
  16. To elaborate on Thorpe's answer, you apparently are getting the return value from your dpkg-deb command. To capture the actual output of the command: $output = `dpkg-deb --help`; echo $output; Note that these have to be backtics around the command, exactly as shown.
  17. It comes down to what you are going to use virtualization for. If it's a workstation, then VMWare player or workstation, Sun Virtualbox, or if on Linux KVM are worth looking at, as they are all designed to allow you to run virtualization on top of your existing OS. These days it's very important to have a chip that includes virtualization instructions (Intel VT or AMD-V) and essential if you want to run a virtualized 64bit os. KVM requires it, while some of the other products can run on older chips with the virtualization instructions, but only 32 bit os's. If you're talking about a server, then typically you're looking at a virtualization OS like Xen or OpenVZ, where you are no longer booting your original OS. In the case of Xen, it runs paravirtualized OS's with very little overhead, because the guest os has been altered to take advantage of the Xen os. OpenVX is very popular with hosting companies because it offers high performance with very little overhead, although it isn't so much virtualization as a chrooted environment. The real question is what you want virtualization for. Without knowing that, it's hard to advise which products fits your needs the best.
  18. Yes it's optional, it aliases the table, so that you don't have to spell out the full table name all the time. There are also times when you require an alias -- namely when you are joining a table to itself.
  19. Yes you should use $_SESSION['ID'] to check if logged in. When a session expires you will not know it. All that you will know is that the user does not have a $_SESSION['ID'] that is set and > 0. In that case, you should check the sesstoken cookie to see if they have the remember me setting. If so, then try and find them by the sesstoken you stored, and if found, load up the info, set the $_SESSION['ID'] and any other pertinent info into the session and and log them in. Perhaps it would be easiser to just think of rememberme as a key that gets you through the front door into your apartment, without having to give your name and pw.
  20. I have discussed this in several threads already this week. Try looking at some of the other threads I've answered.
  21. It doesn't have to be 'error=', it can be anything you want. However, the ? seperates the url from the query string, so that always comes first, then the name=value pairs seperated by &. It's under your control however -- as you decide what you want to name these parameters.
  22. gizmola

    mail()

    It seem highly likely that something on the server is broken. Typically mail just dumps the email out to the mta using sendmail, unless otherwise configured. If your server is configured to send the mail to the ISP's email server, then it's highly likely that their server is having issues and php is hanging on script attempting to make an smtp connection to their server and relay the outbound email.
  23. This comes into play when you authenticate/login the user. IF the user doesn't have a $_SESSION['ID'] set, then they are not logged in. -- If not logged in check the $_COOKIE['sesstoken'] and query the user table where remembercode = $_COOKIE['sesstoken']. If you get a row back, load that user up just as if they had logged in. -- else -- Display the login form. IN the login form, if the remember check box is set, and the user authenticates, then you call the rememberMe() function.
×
×
  • 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.