Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Take a look at this page from the manual: http://uk2.php.net/features.file-upload You'll see you're missing a few things (e.g. ENCTYPE in your form tag)
  2. Well, you can do it with CSS, but it's easier to do with tables. See this post: http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  3. Well, im guessing it's to do with the presumably unclosed tables. I imagine that's screwing with your layout.
  4. You can save the images by specifying the filename parameter in the imagejpeg() function. As for the odd output, did you remember to send a proper header? If you did, then try uncommenting that line and the imagejpeg() line and check to see if you get any errors displayed. I can't remember which of these problems results in the odd output.
  5. Don't like sarcasm? Avoid being stupidly vague then. You're first question was a "how long's a piece of string" question; your second seems to assume that either we happen to know every website in existance, or have read every thread on the forum.
  6. Been looking in your crystal ball then?
  7. Well, you don't appear to have a form tag; you've put a method attribute in your select tag, but that should be in a form tag. I would then assume that $_GET['client'] is unset, so nothing gets passed to the function.
  8. If you're just replacing known text, then you wouldn't want to use regular expressions. Less efficient.
  9. Try this: <?php $content = ""; for($i=1;$i<100;$i++){ $content .= number_format($i) . "\n"; } $g = fopen("file.txt", 'a'); fwrite($g, $content); ?> If you wanted them in order, you shouldn't be using rand(). The number_format() function will add the thousands separator for you. We use the .= operator to append the string to $content so it is not overwritten everytime.
  10. The syntax you're looking for is: ...WHERE ID = 1 OR ID = 2 You don't need quotes around integers. Alternatively, if you had a list of id's, you'd be better off using an IN clause: ...WHERE ID IN (1,2,3,4,5)
  11. Just tried it out on my dell. As soon as i plugged in the other monitor, it detected it and asked me what i wanted to do with it. Otherwise, the option is there from right clicking the desktop and clicking personalize->display settings (on vista).
  12. Can you give us your database structure? And tell us which fields correpond to which of the above variables? You should just be able to do this one update query.
  13. And where to all of these other variables come from? Wouldn't it be better to do this with one query to the database and update all the rows at once?
  14. Little confused by your code. What are you trying to do? I think you want an if statement rather than a where statement here though: while ($sites[$counter] != $numrows) I also imagine it's supposed to be $counter and not $sites[$counter]
  15. Use a counter? Start it at 1 before the loop, increase it by 1 each time the loop runs. Check to see if it's equal to the number of rows. If it is, do what you want. Although, couldn't you just do whatever you want to do after the loop has run?
  16. Resizing proportionally is just simple maths: Edit: See here for an FAQ/code snippet for creating thumbnails.
  17. Looks like major overkill to me. Try this: <?php function get_structure($dir){ $structure = array(); foreach(glob($dir.'/*') as $v){ if(is_dir($v)){ $structure[basename($v)] = get_structure($v); }else{ $structure[] = basename($v); } } return $structure; } echo '<pre>'.print_r(get_structure('C:/wamp/www'),1).'</pre>';//note no backslash on end ?>
  18. http://www.phpfreaks.com/forums/index.php/topic,208072.msg945188.html#msg945188
  19. Sorry? This doesn't sound like a PHP issue, but can you at least explain what the problem is? Browser issues are usually best when accompanied by a demo we can see.
  20. 1.) $lastpart is unset because you do not define it before using the .= operator. You should define it as an empty string prior to doing this: $lastpart = ''; 2.) You have an undefined ofset because: count($message) = 1. Therefore, $quote_times = 0. You therefore try to retrieve the index -1 with this part: $message[$quote_times - 1] I assume you only wanted the -1 in one of the lines. 3.) Yes. You'll get undefined index errors if $MainMessage has no quote tags. You can check and prevent these by checking the number of parts with count(). 4.) In your example, you would have an array with 3 elements: "
  21. Isn't this where that all falls down? You wouldn't be able to set the cookie for the second site. I'm struggling to see a way around that to be honest.
  22. In short, you can't do that. What you could do is check to see if a particular key has been set. Indeed, i'd reverse your logic. It would make more sense from a safety point of view to ensure that each option is false to start with. It should only be set to true if the required authorization is met. Doing it your way leaves you open to making a mistake allowing access to something you did not wish. So, i'd do this: if(isset($TEMPLATE['USER_CAN_EDIT'])){ //allow editing }else{ //don't allow } You would then allow editing just be adding the key to the array: //conditions have been met to allow editing $TEMPLATE['USER_CAN_EDIT'] = TRUE;//the actual value assigned would be irrelevant Note that you would only add the key if you want to allow it. You wouldn't, for example, set $TEMPLATE['USER_CAN_EDIT'] to false to prevent editing, you would just not set it at all.
×
×
  • 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.