Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. You might like to use cURL. It'll allow you to make a request to another page and retrieve the result.
  2. I'm pretty sure the way we were shown that 0.9999.. = 1 was something along the lines of: let [tex]x = 0.\overline{999}[/tex] then [tex]\frac{x}{10} = 0.0\overline{999}[/tex] and [tex]x - \frac{x}{10} = 0.\overline{999} - 0.0\overline{999} = 0.9[/tex] so [tex]\frac{9x}{10} = 0.9[/tex] Therefore: [tex] x = 1[/tex]
  3. Well i'm still not entirely sure what it is you're doing. Maybe if you explain that we can suggest a good way.
  4. If you google around for javascript tooltips you'll find plenty of stuff. This was the second one i stumpled across: http://www.walterzorn.com/tooltip/tooltip_e.htm And this has plenty of suitable examples: http://www.smashingmagazine.com/2007/06/12/tooltips-scripts-ajax-javascript-css-dhtml/
  5. I'm not sure if i follow. Are you having troubles writing to menu.html? Why are you doing this anyway? You'd be better off changing menu.html to a php file and simply echoing the information there.
  6. This is something you'll have to use javascript to solve. Personally i'd think it would be nicer to have this as an option which pops up when you hover over the name, rather than on a right click.
  7. The manual page should answer that for you: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html It really should be your first port of call for questions such as these.
  8. So where's the error? Is it with the upload script or with the display? I.e. Is the information being inserted into the database correctly? And what actually happens? Do you get any error messages?
  9. You'd be looking to use a join. I'd suggest checking out this excellent tutorial: http://www.phpfreaks.com/tutorial/data-joins-unions
  10. Not true. Variables inside double quotes are parsed. kateevanne, i think we're going to need some more of your code to help. Post it up inside tags.
  11. Sticking a load of links into your signature is probably just going to annoy everyone... I generally refer people to the the tutorials on this site as i know they're of a high quality.
  12. There's no syntax error there. Also, you previously said there was an error on line 31, now you're not posting 31 lines and it's migrated to line 19? Which is it?
  13. Is it really necessary? Most websites offer you a chance to select your location on the home page and there's always a link to change from other pages. It's never going to be 100% accurate. More trouble than it's worth IMO.
  14. Your problem is that condition is a reserved word. You'd be best changing the name of the field, though you could place it in backticks (`)
  15. Baaaad idea. Some browsers wont send the submit button unless it's actually been clicked. So all those people who press enter to submit the form will be confused. And ken is right - $_POST is always set. Just check it's size with count.
  16. You'd be better off ensuring they've not been inactive for a while anyway. That way there's not an issue if they leave their browser open and are away from their computer for a while either. You can do this by storing a timestamp of their last activity and ,on each page load, checking to see it wasn't more than x minutes ago. If it was, log them out.
  17. Storing the options of the list in an array will make your life a whole lot easier here. You can then check each option in turn to see if that is the value of the selectbox. If it is, then set the selected attribute. For example: <?php $options = array("value1"=>"Text 1","value2"=>"Text 3",=>"value4"=>"Text 4"); echo '<select name="selectbox">'; foreach($options as $value => $text){ //has the form been submitted and, if it has, is this option the one that was chosen? $selected = ((count $_POST > 0) && ($_POST['selectbox'] == $value) ) ? 'selected="selected"' : ''; echo '<option> value="'.$value.'" '.$selected.'>'.$text.'</option>'; } echo '</select>'; ?>
  18. Indeed - with the way firefox preserves tabs, it must also maintain the session. You can get round this by employing your own auto log-out - store a timestamp of the last activity and, on each page load, check to see if the last action happened more than x minutes ago. If it did, redirect to the login page.
  19. Hold up. You have columns in your table named pic1 through pic15? That's a bad design. It's hard to maintain and hard to change. It's also hard to search with anything other than the most basic search. I'd suggest you alter your database design to have a separate table for the pictures, linked to your main table by a unique ID. You might like to read up about database normalization and have a read of this tutorial: http://www.phpfreaks.com/tutorial/data-joins-unions
  20. You've lost me slightly, but if you're trying to sort items that are coming from a database, you should have the database do the sorting. E.g.: SELECT field1,field2 FROM yourtable WHERE field1 < somevalue ORDER BY field2 DESC
  21. Don't you see though? Though you might not be interested in making money, you obviously would like to create something which people are going to use - you want a website with some notable traffic. Even that's a hard thing these days - without a good idea that is. And that's why people who think they have some unique niche - or even just the ability to do something better - will be keeping it to themselves.
  22. Indeed. It was just for demonstration. I'm assuming you'll be generating these checkboxes in a loop in any case. Try the tutorial above, it really will help - you'll not need the part which shows you how to update the database with the checkboxes, but the rest is relevant
  23. pg_fetch_assoc() returns an array. No value in your database is going to be equal to that array - you need to extract a value from it first. That said, you can probably do this with the one query, if you explain a bit more about what you're trying to do and tell us your database structure.
  24. You must set the checked attribute to checked if you want the check-box pre checked. (Do i win an award for most extensive use of the word checked in one sentence?) e.g.: <?php $yourValueFromDb = 1; $checked = ($yourValueFromDb == 1) ? 'checked="checked"' : ''; echo '<input type="checkbox" id="heatedseats" name= "heatedseats" disabled="disabled" '.$checked.' "/>'; ?> I wrote a tutorial about working with check-boxes and databases, which you might like to read: http://www.phpfreaks.com/tutorial/working-with-checkboxes-and-a-database
  25. If you view a class as simply a wrapper for variables and functions, your view of OOP is way off.
×
×
  • 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.