Jump to content

1internet

Members
  • Posts

    136
  • Joined

  • Last visited

Everything posted by 1internet

  1. Ok so it is for user experience, to let them know that something is happening, and some event (the preloader) did actually happen on click. I guess you could do it the reverse as well, i.e. when you arrive at a new page it starts with a pre-loader. How would you do that? i..e. display a preloader until the web page has downloaded?
  2. I see on sites these days, that when people click to another page, they get a preloader before the page loads. Lets look at this as an example. Say for a list of results, e.g. hotels, with pagination. The view the first page with 10 results, and click on to the next page. The current page then has an overlay displayed over it, with a preloader, telling the visitor the next page is loading. Then the new page is displayed. What is actually happening here. Is it simply just displaying the preloader, then going to the next page? Or is it actually pre-loading the next page, and as soon as it is ready, displaying it?
  3. Ok I have a table, called reviews. I want to work out the average for where a company=84 for example So we have all these numbers for reviews company review 84 1 84 2 84 3 84 4 84 3 89 4 89 1 89 4 I want to be able to add them all up, and divide them by the number of rows, to create the average for the reviews. But only for a particular company. So in this example I would want to extract 1+2+3+4+3 = 13/5 = 2.6 I have been trying to use msyql AVG(), but not much luck. How do I go about doing this?
  4. So I want to run a set of results, fetching rows that have a date that is higher than the current date today. There is a column called date, so this will be checked for each row against the current date. Something like "SELECT * FROM `test` WHERE '$date' > $currentDate" How is this done? i.e. I don't want to show rows that have expired.
  5. I am just wondering if I have worked out what a cron job actually is. Am I right in saying it is something from the apache server, that will do something on a regular basis, e.g. daily, weekly? The "something" that it does, is this just simply loading a certain php file. Then the php file may have certain checks that might compare the dates, e.g. if todays date is more than a date taken from a database row, then email this address? Am I right?
  6. So there isn't really any clever way, at least using only css, unless you use a table?
  7. Oops, yea sorry I was copying and pasting the code, I am using the right -f address. But, I am using a test server on a different domain, so I am sure you must be right about that.
  8. I have a hosting account that requires the addition -f parameter for sending emails. It seems to be sending emails to some addresses, but not all, and I am not sure why this is the case. $to = '[email protected]'; $subject = 'test email'; $body = 'test'; $header .= 'From: [email protected]'. "\r\n"; $header .= 'Reply-To: [email protected]; $ffrom = '-f'.$to; @mail ($to, $subject, $body, $header,$ffrom); Why might this work for some email addresses and not others? Could it be the php.ini?
  9. Sorry for the ambiguity, I was struggling to explain it. So to align something in the middle horizontally, you use margin-right: auto; margin-left: auto; How would you create the same effect vertically?
  10. e.g. you have a div like: <div> <img src="image.jpg" /><p>some text</p> </div> If the paragraph text is floating next to the image, or even an inline element, how can you have the image vertically aligned in the middle of the div, no matter how much text is in the paragraph?
  11. making the argument for rand() a random number that was set in the session seemed to work.
  12. I mean a loading sign, before the page is displayed, to tell the user the page is loading. How is that done? Something like display loading sign until page is loaded. Or if page not loaded display loading sign? What functions do that?
  13. I want to have a page loading indicator when people are navigating through my site. If I am using php and clicking through to different pages, what is the function to check if a page is fully loaded, and provide a loading indicator until it has loaded? Also how do you do this with jquery ajax too?
  14. requinx - if I use the $random, does that mean this variable is a random number, that is then stored within the session?
  15. Oh, of course cron job, I should have known that. thanks
  16. I want to send an email every 7 days. Essentially a row is picked out at random from a database, and their email address is taken and they are emailed. Every 7 days another one at random is chosen, and again they are emailed. So I am guessing it would have something to do with the current date, and then worked out somehow if it is a multiple of 7 and if so email them that day? I am not entirely sure, and really cant get my head around this one. How is this done?
  17. So I want to show my results in random order, I have used the ORDER BY RAND() mysql function, but the issue is, when you have pagination and go to another page, every page is also random results, i.e. there could be the same results as the previous page, and by clicking through all pages, you will never see all results. My query is SELECT * FROM `businesses` ORDER BY RAND() LIMIT $startResults, $perPage So how do I make all the results random, but not sure duplicate results on the other pages?
  18. That's not true, you can change the url without reloading, but I am not sure how it is done.
  19. Yea, I want to keep it fairly simple, but just make sure that all the results that should be shown are, e.g. london restaurants search would return all the restaurants in London. I am not too concerned about order just yet, I guess that is going to be another kettle of fish.
  20. Right, I see, but what if there are 3 or 4 keywords, how can we have $piece1,2,3,4? Would it need to be an array? Is this the best way to handle a search?
  21. I want to search across multiple fields, e.g. city = London category = restaurant name = Acme Steakhouse Description = the best steaks in town, fillet, rump, t-bone So if I was searching for the above result, I would want it to be displayed with searches like "London restaurant", "London Steakhouse", "t-bone restaurant", "Acme Fillet", you get the idea, I just can't work out how to transfer across multiple search words to each field. In fact I really have no idea how this would be done. Is there a trick to this?
  22. Can the url be updated too?
  23. I have a search results page, and when someone clicks on the next link, or a higher page number, I want the current results to slide out to the left, whilst the new ones slide in from the right. Then if someone clicks on previous or a lower page number I want the current results to slide out to the right, and the new ones to slide in from the left. Also if possible can it change the url when the new results come in? I want to use jquery, and was wondering what is the best way to do this, would it be using animate? I have tried but cant seem to work it out.
  24. Instead of your getExtension function, you can just use: $type = $_FILES['image']['type']; $allowed = array('image/jpeg', 'image/png', 'image/gif'); if(in_array($type, $allowed)) { //image upload code } I would also either concatenate the errors or add them in an array, and echo them all out at the end. Instead of copy, why not use move_uploaded_file($_FILES['image']['tmp_name'], $newname)
  25. Oh right, I can keep concatenating, that will work. Sorry, I was listening, but just trying to explain what I wanted to achieve as best as possible. I still have a lot to learn on logic, but this really helps. Thanks
×
×
  • 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.