Jump to content

joquius

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by joquius

  1. do something like $str = file_get_contents ($your_file_url); preg_match ("/<table[^\\\\]*\/table>/i", $str, $table); echo $table[0];
  2. Well, I would advise using a regular expression to match a name, or, if you have the list before hand, simply make an array: $array = ("/Player1/","/Player2/","/PlayerN/"); and then $text = preg_replace ($array, "<a href=\"\">$1</a>", $text);
  3. you need to: 1. let the function define that tag OR 2. replace the tag with the output of the function
  4. You can use file(), and then search for the line with foreach or array_search or something and then rebuild the file with the edited line.
  5. printf() is an output function, it will output wherever it is
  6. foreach ($flabels as $value) { //storing all the different checkboxes within the array $flabels foreach ($flabels as $value) { printf('<input type="checkbox" name="D_xfield1[]" value="%s" /> %s<br />',$value,$value); } I don't really get this, why are you looping this twice?
  7. can't you just set the page to direct to go.php?name=soandso&otherstuff=blah and just input it from some fields or data on the page? (inputting the values with javascript of course)
  8. $array = explode ("/", $_SERVER['HTTP_REQUEST']); $user = $array (count ($array) - 1); // extremely lazy this is if it's a "shared" domain, with a directory/page
  9. Well I gave the function the full path from the base dir accessible on the server. What's strange is that I have to give quite a specific spectrum for it to return anything at all. I wonder if it's to do with the number of files.
  10. I'm merely using glob as a replacement for readdir
  11. well all you need is to get the domain name from a http request, and match that with the database information. Lets says johnnysdomain is in the url requested of your host, you look that up in the database where you inputted the domain name originally. If you notice: [code] $host_name = explode (".", $_SERVER['HTTP_HOST']); // quite lazy [/code] $host_name[0] or $host_name[1] will get you the domain name and you just have to match that to the database (key 0 may be www, ftp, etc.)
  12. you might want to put the strings in quotes. Also, just wondering, why is $id defined twice? and I hope $action is set somewhere...
  13. I suppose you could just do SELECT FROM `table` WHERE `field1` LIKE '%eggs%' OR ...
  14. I'm not too familiar with glob() but for some reason, when I do the following: for example, a directory has a file named "file12.txt" glob ("/dir/file*");  my result is null however with glob ("/dir/file1*"); my result is the file I can't figure out why this is happening, but I thought I'd ask before defecting to readdir()
  15. In the mail() function. $success = mail($EmailTo, $Subject, $Body, "From: <$From>"); The one you have from in at the moment, just change that to $header which you can just define with the from: and content and stuff before hand.
  16. Yes yes that's exactley it. When $a != $b && $a != $c ONLY when both statements are true it throws the error (in your case)
  17. the header field (the fourth and last)
  18. SELECT DISTINCT `field` FROM... this is what you mean?
  19. It's like "He didn't send AND he didn't receive" whereas at the moment "He didn't send and receive (impossible to negate)"
  20. When you have != , make the || an && Notice that at the moment the person could have sent the message, but only one part of the if has to be negative to get a true result.
  21. $mail_header  = "MIME-Version: 1.0" . "\r\n"; $mail_header .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
  22. Just check before whether the query is going to have an affect rather than checking after. Query the DB, check the results, and act accordingly, deleting when the conditions you approve of exist.
  23. There are loads of free ones just "Search for them on Google."
  24. Did you read my answer? Just check whether the line exists, doesn't, or more than one exist, then delete only if it exists once. I just wrote 'delete' and not the whole query which I felt would be redundant.
  25. Aha there's a function for that. God knows why...
×
×
  • 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.