Jump to content

TOgakangaroo

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TOgakangaroo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. While writting this post I realized the problem but I still don't have a solution - I need a lookbehind of variable width - all the text that follows a line that contains a certain format, how do I do I get around this limitation? Here are the contents of my previous post with my example: Hi guys, I'm going nuts with this problem. Im simply trying to pull out the contents of a string following a certain string type. Here's my sample program: <?php $str = "Date: Thu 20-Mar-2008 13:41:37 Location: PHILADELPHIA User: ABCDE Please change densitites to 12.88 for tank 1353 for rec # 1234 and for all shipments from 3/19/08 to present. I did change tank density. Thanks "; $pattern = '/(?<=(User:\s*\w*\S)).*/sm'; if(preg_match($pattern, $str, $matches)) {printpre($matches); } else { printpre("Matches Not Found"); } function printpre($var) {print("<pre>");print_r($var);print("</pre>");} ?> To my understanding, $pattern should match all text preceeded by (User:<some spaces><some letters><some whitespace>) which should be the whole message part of the search string (following the 'User: ' line). The results however: "Matches not found". Oddly, the following works: $pattern = '/(?<=(User: \w\w\w\w\w\s)).*/sm';
  2. As an update, I checked all my permissions. The user used by IIS on this site has full permissions for all directories and sub-directories and files in c:\program files\php\ . Please Help!
  3. PHP 5.2.5 IIS 5.1 (Although on the production machine it will be IIS 6.0) Oracle 10.2.0.1 Express Edition (On the production machine: Oracle 10g) Hello, Ok, first my final goal - I'm trying to get phpBugTracker running using the Oracle Database that we already have as a back-end. What I've down so far: Downloaded and ran the PHP installer from http://www.php.net/downloads.php Installed the DB and OLE package for pear, hear is pear list: I can get php scripts that do not reference the database to run both through the web server and through php.exe on the command line. However, I cannot for the life of me get pear.db working. And I get different errors depending on whether I run it by accessing the server or from the command line Here is my test program: Command Line Output: Output when accessed through a browser: I should mention that I ran go-pear.php so my php.ini file contains the line Any ideas? Please hlep!
  4. Thanks for the replies and the links I am starting to wonder if this might be a php problem first and foremost (after all it DOES insert fine when I go through the $_POST) My thought is that there is some sort of header placed on it when the data is sent through HTTP Post and PHP applies different rules to it when it is placed in $_POST.  The question then becomes what is it exactly that is done to the data and how do I make PHP do that to my data as well. I have not read your links yet and am just posting some ideas.  That second link actually looks quite promising. I am pretty sure that everything the database is set to work on UTF-8 (the sysadmin spent all last week making these changes) however if PHP is not then I don't understand why it would work ok in the $_POST variable. Anyways, thanks a lot for the help.  I'll post a big thanks back on here if it works. (And an angry letter to THE INTERNET if it doesn't)
  5. I posted this in the MySQL forum but upon thinking about it, this should probably go here I am working on a large project which involves among other things storing names with international characters in MySQL tables.  This data is typically delivered via spreadsheets so I have written a utility to do upload a file and do just that.  I am running into the problem currently that certain characters (i.e. the spanish e with an accent) will not import correctly causing the rest of the name to be cut off. So for example, running $term =  'México'; mysql($database_info, "INSERT INTO tblSomeTable VALUES $term"); will store only 'M'. If I hardwire the term into the query mysql($database_info, "INSERT INTO tblSomeTable VALUES 'México'"); It doesn't cut off but does insert gibberish One intersting thing that I've found is that everything works out fine when the variable is passed through the HTTP Post Method mysql($database_info, "INSERT INTO tblSomeTable VALUES $_POST['name']"); where $_POST["name"]='México' from a form imput this inserts correctly. My intuition is that I need to set PHP to use the same encoding that HTTP POST uses but I don't know  if that's true nor exactly how to do that.  Has anybody run into this problem before/can help me out? Thanks a lot for your help.
  6. Hello, I am working on a large project which involves among other things storing names with international characters in MySQL tables.  This data is typically delivered via spreadsheets so I have written a utility to do upload a file and do just that.  I am running into the problem currently that certain characters (i.e. the spanish e with an accent) will not import correctly causing the rest of the name to be cut off. So for example, running $term =  'México'; mysql($database_info, "INSERT INTO tblSomeTable VALUES $term"); will store only 'M'. If I hardwire the term into the query mysql($database_info, "INSERT INTO tblSomeTable VALUES 'México'"); It doesn't cut off but does insert gibberish One intersting thing that I've found is that everything works out fine when the variable is passed through the HTTP Post Method mysql($database_info, "INSERT INTO tblSomeTable VALUES $_POST['name']"); where $_POST["name"]='México' from a form imput this inserts correctly. My intuition is that I need to set PHP to use the same encoding that HTTP POST uses but I don't know  if that's true nor exactly how to do that.  Has anybody run into this problem before/can help me out? Thanks a lot for your help.
×
×
  • 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.