Jump to content

lilleyp

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lilleyp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Regex functions are going to be too expensive for what I'm trying to do (supposed to be significantly slower than strpos() See:http://lzone.de/articles/php-string-search.htm ). I'd much prefer a solution to strpos....
  2. Apologies, It is actually there, but not obvious, the value of $String is: select cat_table, cat_key, cat_field_status, cat_field_location from bp_object_type where object_type = 'AP'
  3. Hi, I'm having trouble finding single quotes in a string using strpos, strpos is returning the incorrect position. The code parses SQL statements and extracts any parameters (e.g. where field = 'Parameter'). The SQL parameters are encapsulated in apostrophies (or single quotes). The code looks like this: $SingleQuote = "'"; //have tried escaping this but the results are teh same $StartPos = strpos($String,$SingleQuote,$ctr); if($StartPos === false) { //no further processing required } else { $EndPos = strpos($String,$SingleQuote,$StartPos + 1); } kl($String . " -> " . $SingleQuote . ' -> ' . $StartPos . ' -> ' . $EndPos); //this is my own function that basically exits the application. ....returns this result select cat_table, cat_key, cat_field_status, cat_field_location from bp_object_type where object_type = 'AP' -> ' -> 135 -> 138 The first apostrophe is at position 105, not 135 and the second at 108 not 138. I've tested the above code by using other characters and it works perfectly. I've also tried using addslashes and the result is the same. I really want to use the strpos function as it is (I'm lead to believe) the fastest of all the string searching functions and there will be a large number of calls to this function at any given time. Any help is greatly appreciated. Thanks in advance We are using v4.3.9 here at work
  4. Thanks Thorpe, I've been using Ubuntu at home (php 5.2.5) . However, at work we use Red Hat Enterprise version (php 4.3.9) which is administered outside of my area, unfortunately they have little knowledge of php config options (as do I to some extent). It is work I require this for.... Your advice worked beautifully on my home pc.... now I guess I'll set up another linux partition on my home pc and load php 4.3.9 (and other work apps Oracle XE etc) into it and test it there before I start lobbying work to install it.... then telling them how to do it!!! Thanks again.....
  5. Hey look I'm only a n00bie running Ubuntu so I may be corrected here, from the terminal window change to the php source directory (where php was originally installed) and enter the following from the prompt: I think that's it.... I actually have another post that I have just put up seeking clarification to the ./configuration command... there may be some responses there that may help as well.... good luck
  6. Hi, This may seem like a dumb question, we have an old version of php running here at work (4.3.9). I want to install the gd library and have been advised that I need to run the following command to configure php (amongst other changes to php.ini). I've only recently become familiar the ./configure command, but I'm concerned as phpinfo() currently shows the Configure Command as: If i now run "./configure --with gd" will it wipe out the existing configuration ?. I need to be carefull here as we already have a number of php apps developed and running, so I can't afford to get this wrong..... Is there anywhere that this command is documented, particularly as it relates to php ? Thanks in advance.
  7. Thanks for the feedback guys, I've done a scan of the phpinfo() and there is no reference to "gd" anywhere in the file. So not being a linux guru I guess the basic question now is can I rerun the "./configure...." command as it is stated in the phpinfo() file and incorporate the "--with-gd" or do I just run the "./configure --with-dg" or is this a lot more complicated than that.... Thanks in advance
  8. Ok, I'm going nuts here.... I'm doing some work for my company coding PHP using version (wait for it...) 4.3.9. While I've been lobbying to get this upgraded I have to put up with the fact that I'm stuck with it for a while longer. The problem I have is that I need to use the graphics functions contained in the gd library. From what I have read the gd library is supplied as standard in version 4.3.x. So I presume there is nothing further to install. Therefore I have requested our DBA's to uncomment out the extension path directive (I don't have access to the php.ini file) and uncomment out the "extension=php_gd2.dll". I then asked them to email me the php.ini file... extracts for the various sections now look as follows: ; Directory in which the loadable extensions (modules) reside. extension_dir = "./" .... and ;extension=php_filepro.dll extension=php_gd2.dll ;extension=php_gettext.dll The DBAs also did an Apache restart... but it still doesn't work. We are running Red Hat Linux Enterprise edition (not sure of version, but it is not the latest). I also asked the DBA's to do a "find" for php_gd2.dll, but they couldn't find this file on the server!, this I find confusing as I would have thought if gd was supplied as standard that this file would be somewhere!!!! Can someone also answer the question as to what I'm supposed to see in phpinfo() that indicates that this has been installed and is running. Thanks in advance
×
×
  • 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.