Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Adam

    Grab url

    You're looking for 'location.hash' I think.
  2. On line 37 there's an unclosed brace. Edit: Appears to be one missing on line 41 too.
  3. "The Pragmatic Programmer" by Andrew Hunt and David Thomas. Only about half way through at the moment but definitely recommend it to anyone.
  4. What are the one or two things not correct? Or.. what errors / messages are you getting back? This is the kind of thing I meant before... move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"] . "-" . time());
  5. Works here... <?php $file = 'my_image.jpg'; if (!preg_match('/\.(jpg|gif|png)$/', $file)) { echo 'Invalid!'; } else { echo 'Valid!'; } ?>
  6. I'd re-write all of that if I were you. When's this code dated from? .. I highly doubt you still need to be ensuring that mysql_real_escape_string exists: Remove that. What are your reasons for setting the send/response character sets every page load? What's the "query_file_content()" function, what code does that contain? Although it's massively bloated, I can't really see why it would cause an error like that. I'm guessing this is a shared server and it doesn't like the amount / size of file operations...
  7. Would need to be: /\.(jpg|gif|png)$/
  8. Have you taken a look at imagecopyresampled?
  9. To get around the duplicate image name problem, control the image names yourself. You could either a have unique string as the full name, or attach it to the end of the original image, e.g. 1251120114.jpg ... or ... my_picture_2009-1251120114.jpg. A good way to ensure (as good as) a completely unique number is to attach a random number to time. As for checking the file extension, look around on Google. There's literally millions of tutorials out there for uploading images with PHP, I'm sure with a bit of work you'll be able to implement some of the code used.
  10. There's a button to toggle between them above the editor as well, little red 'A' on right.
  11. I though he meant like this... [attachment deleted by admin]
  12. That wouldn't work with WYSIWYG editors though, would it?
  13. Could you not break down the code at all?
  14. Adam

    Hexspeak

    Hah, I think that's up there with 'geek code': http://en.wikipedia.org/wiki/Geek_Code
  15. Have you checked the source?
  16. Heh worth asking, some people do actually forget. I wrote the variable wrong for the mysql_fetch_assoc call, should be "$consultsq3".
  17. Heh, can't believe I didn't spot this before. Have you connected?
  18. Found it. or die(mysql_error());
  19. try this: <?php $consultsq3 = mysql_query("SELECT * FROM icu INNER JOIN family ON icu.id_incr = family.pt_id AND icu.id_incr = ' " . $row['id_incr'] . " '") or die ("Invalid query: " . mysql_error ()); if (mysql_num_rows($consultsq3) == 0) { echo 'No record found!'; } else { $result3 = mysql_fetch_assoc($consultq3); foreach ($result3 as $index => $value) { echo "index is " .$index . "and vakue is". $value; } } ?>
  20. Perhaps this could be helpful to you: http://www.almsamim.com/create-your-own-advanced-wysiwyg-editor-part-1-t10.html I've not read it myself but the comments seem positive. I dare say in order to create your own custom 'basic' editor, you're probably going to have to learn some of the advanced stuff as well.
  21. I tried to create one but it appears you can only have 1 character per user. Not very effective error handling:
  22. Why would you start the session then destroy straight after? There maybe more to the login functionality as well. Post the code used to login.
  23. What version of IE did they spot this in? I've tested 6_crosses.html in FF3 and IE7. In IE7 you can see some payment option buttons that do seem to have a margin underneath them causing a gap, but you can't see them at all in FF3.
  24. Try this: <?php preg_match_all('/<VirtualHost (.*?)>(.*?)<\/VirtualHost>/s', $Contents, $vhost_matches); ?>
  25. Just so you know it doesn't match which regex delimiter you use. People have their own preference, I just seem to think I have to escape less using hash. And.. well if it works, just wrap the part you want to match in brackets: preg_match_all('/NameVirtualHost ([^\*].*:.*)\r/', $Contents, $vhost_matches);
×
×
  • 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.