Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. It's very unusual for a ISP to not have webmail these days, are you sure hers doesn't? Regards Huggie
  2. I have two paragraphs on a page that I want to replace. I've used preg_match_all() to get these paragraphs into an array. This works without issue and was simple as the paragraphs are between HTML comments. The code's shown below. <?php $pattern = '/<!\-{2}\s#CONTENT[^>]+>((?:.(?!<!))+.)<!\-{2}\s#CONTENT[^>]+>/s'; $c = preg_match_all($pattern, $fs, $matches, PREG_PATTERN_ORDER); ?> I also have the text that I want to replace it with in an array. I thought it would be a case of simply using preg_replace() or str_replace() with my two array's as arguments to swap them around. This works without issue too, brilliant. BUT... And there's always a but. If the paragraphs are the same, this causes problems. It replaces both paragraphs, with the the first element in the replacements array, as I would expect it to. My question is, how can I get each replacement to only replace one instance of the matched text? Here's the code: <?php /* * $matches[1] is my array from preg_match_all() * $textareas is my array of replacements **/ foreach ($matches[1] as $k => $v){ $matches[1][$k] = '/\Q' . $v . '\E/'; // Make each match a valid regex pattern } $nfs = preg_replace($matches[1],$textareas,$fs); ?> Regards Huggie
  3. Very useful for security permissions. Regards Huggie
  4. The first question should have been "in what format is your text file". Please give an example of layout. Regards Huggie
  5. It means that $POST['email'] isn't defined. (Not set) Use isset() first to see if it exists. Regards Huggie
  6. From what I can see you are using the GD library. Regards Huggie
  7. Does the script upload and resize without outputting anything to the browser? If it does then I'd be willing to bet that it's not the uploading part that's the problem, but more the resizing part. Try to echo something to the screen post upload but pre resize and see if it works for both. Are you using the GD library for resizing? Go here to get an idea of how to calculate the memory usage required... Regards Huggie
  8. PHP is case sensitive... Try if ($_POST['Register']) { Regards Huggie
  9. This is open to spam as you're coding the email addresses in the page. Crawlers will have a field day. Think about using a name => id type link. Regards Huggie
  10. I'd give Google a try... with the follwoing search free +wysiwyg +php Regards Huggie
  11. I don't use a Visual tool anymore, other than a browser of course. But I used to use Macromedia (Adobe) Dreamweaver, which can handle PHP I believe. Regards Huggie
  12. This is a help forum, if you want someone to write it for you, then you should look in the PHP Freelance forum. Regards Huggie
  13. Change the image table and comment table setup slightly so it's like this: Table Image: ImageID <- unique ImageTitle ImageURL UserID <- unique id from the user table Table Comment CommentID <- unique ImageID <- unique id from the image table CommentBody Regards Huggie EDIT: Beaten to it
  14. Take a look at the Array type in the manual. Regards Huggie
  15. INACTIVE needs to be in quotes. Otherwise php thinks it's either a constant or a boolean value. As Liam said, include ' ' around INACTIVE and you should be fine. Regards Huggie
  16. No, PHP can't fetch any information from your local machine unless your browser offers it to the server. Regards Huggie
  17. I agree, I have the w3schools link in my signature. Regards Huggie
  18. In short, yes! You could open the document, read in the contents and then try and format it, but by the time you've learned about COM objects and written the PHP you'd have been quicker to do it manually. Regards Huggie
  19. Nothing's going to keep the formatting unless you save your word document as HTML (I believe there's an option when you Save As...) but it'll contain all Microscofs proprietory rubbish! Regards Huggie
  20. Mr P!nk, have you tried it before suggesting it? Give it a go and see what happens! Regards Huggie
  21. Look at ini directives and error handling functions for correct use of display_errors Regards Huggie
  22. I think fopen() is aimed at ASCII data, not Binary data (Like a .doc file). I'd use COM objects to get around this issue. Regards Huggie
  23. My first question would be... Have you read the manual? This normally clears up lots of the issues. Regards Huggie
  24. You could use something like cURL or fsockopen Regards Huggie
  25. You're right, 'by' is a reserved word... MySQL 3.23, 4.0, 4.1 Reserved Words MySQL 5.0 Reserved Words MySQL 5.1 Reserved Words Regards Huggie p.s. Make sure you mark this topic as solved
×
×
  • 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.