Jump to content

Gooner

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gooner's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That works brilliantly. Thank you so much for your time and expertise.
  2. Hi I have searched the forums for 2 hours and cannot find what I am looking for. Apologies if the answer is already here. I need to write a php regular expression that will change any text within square brackets to a link. Example "Some text here. But look, a part ref number of [AK123] and another one just here [AK124]. that is all." From this text, I need to add <a href> tags to the above, so that AK123 and AK124 link to http://www.mysite.com/ak123.php and http://www.mysite.com/ak123.php respectively. I also need the square brackets to go (the brackets are there to indicate the text that needs linking). The result I need is: "Some text here. But look, a part ref number of AK123 and another one just here AK124. that is all." Can anyone help on this one? Many Thanks
  3. Anyone got any clues on this one?  :(
  4. Hi I am pulling my hair out over this problem, and am getting to the stage where I'm gonna scream. All these pages work perfectly on IE6, Firefox, Netscape etc, but I have come across a problem when testing them on IE7. Here's the problem: I have a web based system where a user logs into the site. Upon signing in, a number of $_SESSION variables get populated with data, so that the subsequent pages know that he is allowed to visit them, and who he is. One of these variables is: $_SESSION['username'] At the top of all subsequent pages, the php script reads: <?php session_start(); if (!isset($_SESSION['username'])) { header("Location:unauthorised.php"); exit; } ?> This effectively checks to see if the user is logged in, and if not, sends them to the "unauthorised" page. This check works fine. However, on one of these subsequent pages, I have a link that opens a new window with some information, using the standard <a tag. This is the link : <a href="new_page.php" target="_blank">Click here</a> Now, this "new_page.php" also has the script that checks to see if the user logs in. This new page is displayed fine. HOWEVER, and this is my problem........ When I close this new window (using IE7 - it works fine in other browsers), and am left with the original page with the link on it, my session data seems to disappear.  If I click on refresh, I'm taken to my "unauthorised" page. WHY IS THIS HAPPENING IN IE7 ?????? So, to recap......... 1) User logs in and session variable stores $_SESSION['username'] 2) User goes to new page (page checks to see if logged in - which he is) 3) User click on link on this page which opens new window (using target="_blank"). 4) This new window displays fine (page checks to see if logged in - which he is) 5) Close this new window, leaving the original page with the link on 6) Refresh the page (or click the link again) and all session data is lost - sent to unauthorised page This is only a problem in IE7. Can someone please suggest a workaround for this issue.  I'm almost positive it's a IE7 fault, but am amazed that there aren't loads of people with this issue posting on forums. Many many thanks for any help you can give
  5. Anyone have any ideas on this one? Anyone experienced any prob with IE7 and PHP sessions? Thanks
  6. Hi I have just installed IE7 onto my PC, and for some reason Session data doesn't seem to work correctly.  It works fine on IE6, but since the upgrade thing have gone awry. I have traced the error to this line of code, which is used to delete all file within the temp folder on the site. [code]foreach (glob('temp/*.*') as $filename) { unlink($filename); }[/code] This seems to delete session variables. Can anyone see why this is happening, and is only happening on IE7? Many Thanks
  7. Aha... sussed it thanks. Navicat, a program I use to edit the database, DIDN'T have the right charset.  I have now put it right and everything is fine. Thanks for your help.
  8. Thanks for your replies. I ahve checked the charset on the table using phpMyAdmin and it states it's using English - iso-8859-1. I'm not sure what you mean about the word processing issues. This database has never been near one and none of the values come from word (they were actually manually entered into the database).
  9. The page is using "charset=iso-8859-1". The str_replace does solve the problem (although I can't actually type the Â, I have to copy & paste it). The field is set to "text" in the database. Any other suggestions, as I'd rather not use the str_replace option. Thanks
  10. Hi I have a field in a MySQL database that reads:  "abcde:1 bag - £" (without the quotes) I am returning this value (which is stored as text in the database) as follows: I split the result into an array, using the : as the delimiter. So, $array[0] = "abcde" and $array[1] = "1 bag - £" The problem I have is that when I echo the $array[1] value i get the following displayed: 1 Bag - £ Where does this  come from, and how can I not display it? Thanks for your help.
  11. [!--quoteo(post=370880:date=May 3 2006, 08:26 AM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ May 3 2006, 08:26 AM) [snapback]370880[/snapback][/div][div class=\'quotemain\'][!--quotec--] if you set the permissions on the folder, it will not make all the files under it the same. The new files you ad are getting the new permission, but the existing ones are not. You have to do a recursive chmod to make sure all the files and folders in the directory get the permissions. If you are trying to do this thru your FTP client, you will have to make sure you click all files and folder if your client even has that option. If you are doing it thru ssh then you have to use -R(make sure it is capital) to make all the files and folders that permission. Ray [/quote] Thanks Ray I use SecureFX as an FTP client. I select all the files in the directory as you stated, and changed them all to 777. It did them all, EXCEPT one PDF that was uploaded via the script I wrote. This file owner is apache (group = apache), whereas the rest have the owner user1. I deleted all the PDF files in the directory, changed the directory to 777 and re-uploaded them. All files were now 777. (same outcome as above). I now used my PHP script to upload a NEW file into this directory, but when I checked the permissions on this NEW file, they read 644 - even though the directory is set to 777. Any ideas why this is happening? Thanks again.
  12. [!--quoteo(post=370861:date=May 3 2006, 07:38 AM:name=Umasankar Subramanian)--][div class=\'quotetop\']QUOTE(Umasankar Subramanian @ May 3 2006, 07:38 AM) [snapback]370861[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, If you are using a Linux server, The Problem is File permission Only.. Change that folder permission as 777. [/quote] It IS a Linux server (VPS), running Fedora, and the folder where the PDF files are contained HAS a setting of 777. The problem remains however..... I can overwrite files uploaded by my script (owner = apache), but files that were FTP'd into the directory won't overwrite (owner = user). Thanks for your time
  13. Hi I have recently changed web hosting from a local compnay to a VPS system (linux based). Everything is still working fine with my site, except one thing. I use a page on my site to upload PDF files into a directory (these pdf files can then be accessed via a browser). This was working fine on my old server, but now there seems to be an issue with files that already exist. If I upload a file called hello.pdf and there is already a file called hello.pdf in that directory, I want it to overwrite the original file (like it did on the old server). The trouble is, it won't overwrite them. If I upload a file that doesn't already exist, it uploads fine (yes, I have write permissions on the directory). If I then try to overwrite THIS file, again, it works fine. The trouble is when I try to overwtite a pdf file that was moved from the old server. The new files I upload have an owner and group both set as "apache". The existing files have a different user and group, which I think is what is causing the problem. Can anyone suggest a way I can get round this? I'd rather not delete and re-upload all the PDF files, as there are too many. Is there a way of "batch changing" all of the owner/group details within a directory, or is there a way in PHP that I can force it to overwrite the existing files that belong to a different user/group. Any help really appreciated. Thanks.
×
×
  • 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.