Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. Well to display errors without reloading the page, then you will need to use javascript. If you need to check with a database to see if there are errors, you will need to use AJAX. Otherwise, if you don't mind the same page being reloaded, then put the form processing at the top of the page with the form, surrounded by an if(isset($_POST['submit'])) statement. That won't solve your problem, but it should get you started. If you want further help just say so. Denno
  2. You could swap the 1939 and 2012, then have the variable decrement? $i = 2012; while($1 > 1939){ $i--; echo 'whatever'; } Denno
  3. if(mysql_num_rows($result) == 0)){ redirect("../index.php");} elseif(mysql_num_rows($result) == 1){ redirect("../welcome.php"); } That will count the number of entries that is returned from your query string. This should either be a 1 or 0, unless you have an error in your database somewhere..
  4. let me know ur skype name when you've got it up and going..
  5. any chance u can download skype? If not I'll try and make do here..
  6. do you have skype or anything so I can talk to you through your code? Might be a bit easier than constantly replying here..
  7. sorry mate I got distracted watching a tv show.. I'll look through it now.. I'm only looking at your query and while loop really, just wanted to see the placing of the {'s and }'s.. I'll reply in a sec
  8. This is how you would usually set up the loops to create a table (psuedo code): <table> while loop condition { <tr><td> //add content to the table cell </td></tr> }//close while loop </table> That code will create one table, will multiple table rows, each with only one column.
  9. Looking at the excerpt of code, you never open the table tag? And with the closing tag where it is, it looks like you're going to close a table everytime the loop runs.. You want the opening and closing table tags outside of the while loop..
  10. You could do three things. One, send the variables back by appending them to the URL of queue_info.php. For example queue_info.php?id=5&from=user, then inside queue_info.php, you access those variables using $_GET, exactly as you've used $_POST. This means that the user will see all of the variables and their content, which may not be wanted. You could use javascript to submit another form on the queue_action.php page. Submit it to queue_info.php and access using $_POST again. Or the third is using session variables, which will then be accessible on any page in your website.. Hope that helps a little.. Denno
  11. Just google tutorials, or youtube tutorials. It'll allow you to send a request to the server to be processed by PHP (which is where your mysql query will run), and then return the result to the browser, to a div you specify, all without refreshing the page, pretty sweet . Exactly how comments on facebook appear in real time, using AJAX (I assume) Denno
  12. You could make the form submit to the property list page, have code at the top of the page to determine if a form has been submitted, then add the entry to the database, then as the page continues to process, it will pull all the entries in the database, including the newly added one, and display them on the page. If you want this to happen without the page appearing to refresh, then you will need to use AJAX. Which I'm pretty sure JQuery makes very easy, just look for some tutorials on it. Hope that helps somewhat.. Denno
  13. your wrapper is wider than your container? What's up with that?
  14. If you make img a block element, and then use margin: auto, that will centre the image. img{margin:0 auto; display: block;} try that
  15. I don't know the exact code, but I know there are PHP functions that allow you to make a variable into a 'date' variable, so PHP will recognize it as a date, and not as a strings of characters. After that you might be able to do some sorting using greater-then, less-then etc, but I'm really not too sure on that..
  16. Ok thanks for the replies.. We are using a txt file as our 'database', where we were checking the usernames and passwords, so I guess I could just create a new txt file in a similar way.. Thanks Denno
  17. thanks for the reply... Using a database, however, is well above the scope for this practical.. Is there anything simpler that I could use? I don't think there is a huge need for it being secure...
  18. I've got a somewhat simple problem I think.. I'm working on a uni practical, and one of the checkpoints is to limit the number of incorrect login attempts to 2. I know I could do this very easily with session variables, however on the practical sheet, it says that we're not allowed to modify any of the partially implemented code. So I was wondering, what other ways are there to track the number of incorrect logins? If it comes to it, I will just use session variables, as it's pretty much the most sensible way I'd imagine.. but would like to know of any other possible ways.. Cheers Denno
  19. I was wondering how I could make the footer appear at the bottom of the browser for pages where there isn't enough content to cause vertical scrolling. I want to implement it on a search results page, so when there are very few results, the footer will be attached to the bottom of the browser, however when there are alot of results, then the footer is pushed all the way down to the bottom of that data, as per usual. I have tried positioning the footer absolutely, with bottom:0px;, however that causes the footer to stay there even when there is enough content to push the footer down.. Thanks in advance. Denno
  20. I think you need a double equals? ($data == $list) Otherwise you're saying "move contents of $list into $data", and that doesn't really make sense as the condition of a while loop.. Denno
  21. Can't you just use count() to see the size of the second array, and then use that value as the terminating value for a for loop. Something like: for($i = 0 ; $i <= count($arrayOne); $i++){ $arrayTwo = $arrayOne; } Please excuse any syntax mistakes, it's been a little while since I've done PHP programming, so I may have written that in a Java type format by mistake.. But that should be the general idea I would think. Hope that helps Denno
  22. Are you supposed to be using curly braces instead of square braces?? Denno
×
×
  • 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.