Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

Everything posted by cags

  1. No real difference to joe92's pattern, just a slightly different take of... preg_replace('/£\d+(?:\.\d{2})/', "<tag>\0</tag>", $title); I think it should work, though I did just get up, so it's not tested
  2. It's because the redirected url also matches the pattern (since .* matches everything). You should be able to do something like this to avoid that... RewriteCond %{HTTP_HOST} !www.domain.com$ [NC] RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).domain.com [NC] RewriteCond %{REQUEST_URI} !^partners/ [NC] RewriteRule (.*) partners/%1/$1 [P,L] Should only rewrite patterns that done begin with the partners/ directory
  3. What happens if you remove 'http://domain.com/' from the start of the substitution, leaving you with... RewriteEngine On Options +FollowSymLinks RewriteBase / RewriteCond %{HTTP_HOST} !www.domain.com$ [NC] RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).domain.com [NC] RewriteRule (.*) partners/%1/$1 [P,L]
  4. Excellent, glad it's working. I must admit I've had strange caching issues with .htaccess before, I'm not entirely sure what causes them.
  5. @PFMaBiSmAd I just realised the OP has used at least 3 different timestamps in this thread, we were probably checking different values.
  6. It's 06:05AM GMT not 05:05 GMT isn't it?! 2006-09-01 06:05:00AM GMT
  7. Thinking about it, I don't think underscore is a valid subdomain character, that could well be the problem. I think they have to be [a-zA-Z0-9-].
  8. The full error message should tell you where the error is occuring. For some reason PHP is trying to declare fputcsv twice. If you have a user-defined function with this name simply change it, because it is an official function already (Since PHP 5.1.0). Otherwise more information is needed.
  9. As PFMaBiSmAd already mentioned, it's not a problem with the format it's a problem with the timezone. Regardless of whether you do it with Regex, String functions or whatever you will have the same issue when converting between timestamp and date formats. Example: echo date('Y-m-d H:i:s', 1157087100 ); Output (on my system): 2006-09-01 06:05:00 Which as you can see uses the same timestamp as you used, but doesn't give the same value as either what your getting or what you think the answer should be. A unix timestamp is stored as UTC ie ~GMT. When you use date it converts this value to whatever that time translates to in the current timezone of the server. If this is a one time thing you will just have to calculate the difference between your timezone and the required result and add/subtract the value as appropriate.
  10. Doing it item at a time like that would likely cause the file to go missing which is why I suggested just copying the $_FILES array, but even that likely will make the file disappear, you might have to save the image to a temp directory in the first script in order to keep access to it.
  11. I don't understand the question, the code you currently have seems to achieve what you seem to want. Obviously it's not though otherwise you wouldn't have posted. Please give an example in this format.... Requested URL = the address your typing in to test it Actual file URL = the address of the file you wish to show, including the query string Desired Addressbar URL = the value you wish to appear in the address bar, only applies if it's different to Requested URL Problem = whichever one of these things is not occurring, and what the value your getting is
  12. The simplest solution would perhaps be to insert them into a SESSION on the first script. session_start(); if(isset($_POST['submit'])) { $_SESSION['files'] = $_FILES; $_SESSION['title'] = $_GET['title']; $_SESSION['comment'] = $_GET['comment']; } Then on the other script just access them using the $_SESSSION array.
  13. Your nested loops firstly loop through each checked item. Then for each checked item the inner loop sets `datereturned` equal to the value of the current checkbox. Thus when the loops are finished the value of every row with a `borrowid` id that was checked will equal the value of the last item in the retur[] array.
  14. To clarify what thorpe and Dennis1986 are saying, it's not possible to to simply use a mailto link as the action on a form and make it send an e-mail, pre-fill in an e-mail etc. If you are using a form in that manner you will need to submit to a script on your page and use the mail function to send the actual e-mail, thus bypassing the users e-mail client. Alternatively you have a standard anchor link on your page with that title, which will open their e-mail client, this does not use a form at all. For more detailed help we need more information to put the code you posted into context. Alternatively you can pick a ready made script for a few $'s if you wanted to for example Simple Feedback Form, or there are plenty of free tutorial about this around.
  15. Is your site by any chance running in a Frame, or being ran on a host using Frame Redirect?
  16. If your after a ready made solution... Simple PHP Feedback Form
  17. Hm.. what happens without the first redirect, I tested that second part locally and it seems to work fine. Try redirecting to a page on your server that echo's out $_SERVER['REQUEST_URI'], that way you should get an idea why it's not matching.
  18. Try... RewriteEngine On Options +FollowSymlinks Options All -Indexes RewriteBase / RewriteCond %{HTTP_HOST} ^www\.domain.com [NC] RewriteRule ^(.*) http://domain.com/$1 [L,R=301] RewriteBase / RewriteCond %{REQUEST_URI} !^/exception1\.php$ RewriteCond %{REQUEST_URI} !^/exception2\.php$ RewriteRule ^.+$ http://otherdomain.com [L,R=301]
  19. What URL are you testing it with? What's the outcome? Are all files being forwarded including the ones you wish to be exceptions?
  20. The only thing I can thing of is perhaps you need a space between '\\n' and (`type`.
  21. SET ccount = count+1 I'm fairly sure those two column names should match....
  22. If you wish id=something to stay in the URL, then you will have to ensure that any URL you redirect to has... "id={$_GET['id']}" So for every link on the page that links to something else within the profile you would have.... echo '<a href="/profile.php?page=fave&id=' . $_GET['id'] . '" />';
  23. You certainly can't go about it like that. Once you call return, a function (in this case method) is finished. The second return statement will never get ran. I can't really give any advice towards a solution, because I really don't understand what you are trying to do. If you need more than one item to come back from a getter in that manner, you will either have to pass the variables in as reference types rather than value types, or you will have to add all items you wish to return to an array and return the array.
  24. You could either make sure you are sending the e-mail as HTML, by adding the correct headers, something like.. $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=utf8\r\n"; Or you could try using html_entity_decode.
  25. What value are you passing for $where? Have you tried using actual JOIN syntax rather than SELECTingfrom two tables and using a WHERE clause? Have you not thought about SELECT INTO ... OUTFILE syntax rather than manually messing around creating a CSV?
  • 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.