[PHP] Re: problems setting up php5 on apache2 (WinXP Pro)

2004-09-10 Thread Richard Harb
I have no experience with PHP5 so far but this subject was asked before often enough with PHP4 - so the advice should still be valid... I generally didn't put any files in the %SYSTEMROOT% folder (which usually translates to C:\WINDOWS on a default installed WinXP machine) but instead I put the

Re: [PHP] string function that adds before and after

2004-06-25 Thread Richard Harb
-Original Message- From: Gabe Sent: Friday, June 25, 2004, 9:06:15 PM Philip Olson wrote: There's a number of functions in PHP that will give me the position of the *first* instance of the matched string, but it doesn't look like the function would keep searching after the first match.

Re: [PHP] TIFF display problem...

2004-06-24 Thread Richard Harb
Are you certain there are no other characters being sent (introduced by the addition) in the 'body' beside the image? Will you get any output (characters and all) if you request the image file directly - without embedding it into a page using img src or whatever? While I have used only the

Re: [PHP] TIFF display problem...

2004-06-24 Thread Richard Harb
Argh, I see your problem was already solved (answers haven't been listed as one thread, so I missed em). Oh well. -Original Message- Sent: Thursday, June 24, 2004, 11:58:15 AM Are you certain there are no other characters being sent (introduced by the addition) in the 'body' beside the

Re: [PHP] imagecolortransparent IE

2004-06-16 Thread Richard Harb
That's sort of a known issue with our oh so standards compliant favourite browser... Search google for ie png transparency and though shall be enlighted. Richard -Original Message- Hi, I have been working to create a program that takes a user-uploaded background image, a little

Re: [PHP] Limit the number of characters in a string

2004-06-12 Thread Richard Harb
actually it is: substr($string, 0, 100); http://www.php.net/substr -Original Message- From: php-general Sent: Friday, June 11, 2004, 3:17:15 PM substr( xxx, 1, 100) Hi Anyone know how to clip the number of characters in a string? For instance, I have a string carrying a long piece of

Re: [PHP] Re: search engine optimization and php

2004-06-08 Thread Richard Harb
http://www.w3.org/TR/html401/struct/global.html#h-7.4.4 -Original Message- From: electroteque Sent: Tuesday, June 8, 2004, 11:58:30 PM On the topic of meta tags, can these be sent via the header or not ?? :\ -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]

Re: [PHP] dynamic table

2004-05-26 Thread Richard Harb
$i = 0; while ($myrow = mysql_fetch_array($sql)) { if (++$i % 5 == 0) echo 'tr'; ... Note: if used repeatedly do not increment the $i again in the loop. HTH Richard -Original Message- From: nabil Sent: Wednesday, May 26, 2004, 2:28:28 PM Hiya, How can i draw a new

Re: [PHP] export mysql to excel

2004-05-14 Thread Richard Harb
You could get yourself the mySQL ODBC driver and 'Get External Data' in Excel ... Richard -Original Message- From: CurlyBraces Technologies ( Pvt ) Ltd Sent: Friday, May 14, 2004, 7:18:17 AM hi , i want to export data in mysql to excel . but problem is mysql runs in the linux

Re: [PHP] Does this directory detection script work for you?

2004-05-09 Thread Richard Harb
Hello, I see one potential problem with this detection in one special case. This will only occur if you use Apache's feature PATH_INFO. There $current_page will be inaccurate as the scriptname might be /index.php but the URL could be /index.php/path/to/mypage or just /index/path/to/mypage -

Re: [PHP] using cookies

2004-05-09 Thread Richard Harb
-Original Message- From: David T-G Sent: Sunday, May 9, 2004, 6:09:06 AM Hi, all -- I guess I need a primer on cookie usage. I've read the manual regarding setcookie and have gone back to look at everything having to do with cookies on this list in the past few months (it seems that

Re: [PHP] $myobject-$$varname doens't work ??

2004-05-09 Thread Richard Harb
Try echo $obj-$varname; -Original Message- From: greg Sent: Sunday, May 9, 2004, 9:21:52 AM Hello, I was just trying this but it doesn't work : ?php class a { public $foo = hello world; } $obj = new a(); $varname = foo; echo $obj-$$varname; $bar = this is working;

Re: [PHP] Showing only part of string

2004-05-07 Thread Richard Harb
I guess the easiest way to do this would be to use a regular expression: if (preg_match(/title(.*)\/title/i, $string, $m)) { $found = $m[1]; } echo $found; Richard Friday, May 7, 2004, 12:11:02 PM, thus was written: Hi List, $string = This is a test string to titleSHOW ONLY THIS

Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Richard Harb
What about allowing your UK server to access the database of your USA Server? You could open a port to that specific IP address only, ... Then authenticating users on the UK server would work like a charm. You could even create a 'shared' database for basic session information. I think if

Re: [PHP] Re: Active PHP Sessions

2004-05-07 Thread Richard Harb
Friday, May 7, 2004, 3:40:06 PM, thus was written: I've read stuff like that also. However, if I choose to do this, I must write all the session handling myself, correct? Well, yes and no: You could still use the default session handler and just add a function/whatever to the top of the page

Re: [PHP] Class Help Extended

2004-05-06 Thread Richard Harb
More often than not it's a good thing to assign 'default' values to class variables like that. In this case though I've observed that common practice is to get the user/pass values from a config file and pass them along as variables when creating an instance of the class. Classes are most

Re: [PHP] Looking for Advanced PHP Developers

2004-05-05 Thread Richard Harb
... and onsite would be where ? Thursday, May 6, 2004, 2:03:04 AM, thus was written: Hello, I'm looking for advanced PHP Developers. the responsibilites will include the following: - Being able to architecture huge web applications ( 1 Million lines of code or bigger) - Ability to

Re: [PHP] sessions failing to persist

2004-05-02 Thread Richard Harb
If the sample of code is the whole page... where do you actually start your session? I didn't see a session_start() anywhere. AFAIK the $_SESSION var doesn't exist until you do just that. session_is_registered(): mabe I'm reading the documentation wrong, but I interpret this function as

Re: [PHP] re-keying an array

2004-04-30 Thread Richard Harb
Yes and no (in this case). Yes, it'll be evaluated in each iteration and no, I don't think you'd gain that much in this case because the evaluation would only take place twice. Though I don't know how expensive array_slice vs. creation of another variable and assigning a value to it is But

Re: [PHP] re-keying an array

2004-04-30 Thread Richard Harb
Uh, I was wrong... Foreach evaluates only once at initialisation... You can even unset the array once into the loop and it still works perfectly well (not that I recommend this as good practice or whatever, just did some checking to be sure :) Richard Friday, April 30, 2004, 9:55:14 AM, thus

Re: [PHP] PHP Apache Version

2004-04-30 Thread Richard Harb
Friday, April 30, 2004, 3:21:41 PM, thus was written: Is there a version of Apache 2+ that now works with PHP? snipped Yes there is. Works without problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Register globals off, still not secure?

2004-04-30 Thread Richard Harb
Friday, April 30, 2004, 5:37:15 PM, thus was written: Hi, Even with register globals off isn't it possible to have a webpage like this: Not sure what you are asking. You can have a webpage like this. And I guess it even does what it should - print the information. html head /head h2Hello,

Re: [PHP] Installing sendmail in win9X/Me

2004-04-30 Thread Richard Harb
Google: searched for windows mail server came up with http://www.pmail.com/ as first link. Incidentially I know this program ... easy to set up and use. hth Friday, April 30, 2004, 7:05:53 PM, thus was written: Hi, My english is very poor. I need install sendmail in windows 9X/Me for use

Re: [PHP] re-keying an array

2004-04-29 Thread Richard Harb
http://www.php.net/manual/en/function.array-values.php ? Richard Friday, April 30, 2004, 3:48:06 AM, thus was written: been RTFMing for about 10 minutes, and can't find the function to re-key an array. In other words, I want an array of items to remain in their current order, but have the

Re: [PHP] making changes on arrays

2004-04-29 Thread Richard Harb
Hi, that's something I tripped over myself when I started out :) foreach takes one element after another from the array and copies it into that new variable - in your case $value ... you can modify it all you want - the value 'still' being in the array will not be affected. you could operate

Re: [PHP] substrings

2004-04-25 Thread Richard Harb
$color = '#aabbcc'; if (strlen($color) == 7) { echo ' r: ' . substr($color, 1, 2); echo ' g: ' . substr($color, 3, 2); echo ' b: ' . substr($color, 5, 2); } elseif (strlen($color) == 4) { echo ' r: ' . str_repeat(substr($color, 1, 1), 2); echo ' g: ' . str_repeat(substr($color, 2,

Re: [PHP] From IIS to Apache

2004-04-24 Thread Richard Harb
Though this isn't stricly a PHP question - here we go: It sounds as if IIS didn't really go away... There's a nice utility out there that lets you know what ports are active and in use ... It's called Active Ports (duh!) and is a small download from http://www.ntutility.com (section

Re: [PHP] OK SQL experts...

2004-04-23 Thread Richard Harb
AFAIK phpMyAdmin uses backticks for table/field names, not single quotes ... Friday, April 23, 2004, 5:22:35 PM, thus was written: I tried it both ways - didn't make any difference (phpmyadmin adds the single quotes when I was trying to use its sql function to debug, so I figured what the

Re: [PHP] PHP modifying data from DB?

2004-04-23 Thread Richard Harb
Have a look at strtotime() in addition to date() Richard Friday, April 23, 2004, 8:20:14 PM, thus was written: I have a field in a DB that contains a date. The format of the date is: 04/08/2004 However, when I retrieve the date from DB using PHP, it displays the following: 2004-04-08

Re: [PHP] Question about the mail() php function

2004-04-23 Thread Richard Harb
If I had to take a wild guess I'd say that there's no mail server on your machine that would be capable of accepting email for delivery. And that Warning is PHP's effort to tell you just that. Hint: google - and I bet most other search engines - give you plenty of sites providing good information

Re: [PHP] Adding includes to files

2004-04-22 Thread Richard Harb
You could either include the files without assigning the contents to a variable - but that would display those right away: ?php include('nav/top_nav.html'); ? or you could read the contents of the file like: ?php $display_block .= is_readable('nav/top_nav.html') ?

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Richard Harb
did you check the online manual for those funcitons yet? I have found the user notes to be a wealthy ressource on that matter. This topic also came up very recently on this list so checking the archives might solve it. Richard Thursday, April 22, 2004, 10:34:23 PM, thus was written: Hi, I

Re: [PHP] example from meloni not working

2004-04-18 Thread Richard Harb
From what I've seen you didn't actually transmit the first query to the database. You assigned the query string to the variable $sql ... but didn't submit with: mysql_query($sql); hth richard Sunday, April 18, 2004, 7:41:47 PM, thus was written: A basic ht counter script from Meloni's book on

Re: [PHP] Regexp hyperlink

2004-04-18 Thread Richard Harb
A while ago I've been looking at some piece of code of the tikiwiki project to see how they did some of their magic... Basically they run through the whole text and if they found something that was translated they made a hash and replaced the actual text with it and stored the link in an assoc

Re: [PHP] session var puzzle

2004-04-18 Thread Richard Harb
Hi, As I have no idea what those var contain .. what does a print_r() of it give you? print it right when you assign it to the session var to check if it actually contains a value. like: print_r($Data['ID']); and maybe even print_r(intval($Data['ID'])); I suspect that this $Data['ID'] is empty

Re: [PHP] Array Problem

2004-04-17 Thread Richard Harb
That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } HTH Richard Friday, April 16, 2004, 11:00:49 PM, you wrote: Hi I have i Problem i got a variable a=2351 now i need to create an array out of this variable a[0]=1

Re: [PHP] Array Problem

2004-04-17 Thread Richard Harb
Saturday, April 17, 2004, 7:38:46 PM, Arthur Radulescu wrote: That's how you could do it ... $ar = array(); $len = strlen($a); for ($i = 0; $i $len; ++$i) { $ar[] = $a{$i}; } If I remember well strlen is used for checking the length of a string... It does ... I didn't look

Re: [PHP] Encrypting Source

2004-04-16 Thread Richard Harb
Two come to mind: - Zend Encoder costs $, but is widely supported as it 'only' needs zend optimizer to decode - Turck MMCache/phpcoder on sf.net open source but not available on most webhosters. though IMHO the cache alone is worth looking into There may be other solutions /me steps back

Re: AW: [PHP] smarty

2004-04-16 Thread Richard Harb
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Could we please close the thread already? I think in the previous week there's been everything said what there's been to say. whoever is still interested in reading the same arguments over and over should please take a look at the archives. I value

Re: [PHP] session timeout

2004-04-16 Thread Richard Harb
Friday, April 16, 2004, 4:35:30 PM, you wrote: Hello Marek, I had similar trouble with my PHP application. I used an .htaccess file with the same line. But it still did not work. I guess I even tried ini_set() function. I have a question with this point : I can only answer part of

Re: [PHP] Using ' to access session variables?

2004-04-16 Thread Richard Harb
If used outside any strings (like in your $query example) $_SESSION[foo] -- here foo technically is a constant and php ought to produce a notice $_SESSION['foo'] -- is the correct way as there is no doubt that foo is a string When used inside a string the

Re: [PHP] OOP variables

2004-04-15 Thread Richard Harb
http://www.php.net/manual/en/language.oop.php states: [quote] In PHP 4, only constant initializers for var variables are allowed. To initialize variables with non-constant values, you need an initialization function which is called automatically when an object is being constructed from the class.

Re: [PHP] Session confusion again :( - Thanks!

2004-04-15 Thread Richard Harb
Actually for me it isn't unclear at all: The (super-) global variables are created when php starts working on your script. That pesky function/ini parameter (register_globals=on) is just a replacement for an extract() on each of the global vars just then. Whatever you do later with any of the

Re: [PHP] Re: PHP editor

2004-04-15 Thread Richard Harb
Finally somebody else who does it that way Unfortunately most of the $ signs usually get messed up... So ... which ocr program do you use / recommend for that? :) Thursday, April 15, 2004, 2:12:44 PM, you wrote: I code with pencil and paper then scan it with OCR ;-)) snipped / -- PHP

Re: [PHP] automatic doc generation for classes

2004-04-13 Thread Richard Harb
Well, since you already mentionned it: Why not use phpdoc? I use it on a regular basis: it's pretty good. (Yes, it works like a charm on a windows box with enough memory) Richard Tuesday, April 13, 2004, 9:10:23 PM, you wrote: does anybody have any good recommendations for anything to do auto

Re: [PHP] Command line include path?

2004-04-13 Thread Richard Harb
If all else fails, try setting the include path in your project: http://at.php.net/manual/en/function.set-include-path.php (check out the comments section) hth Richard Tuesday, April 13, 2004, 10:45:23 PM, you wrote: I'm getting started with PEAR's DB_DataObject and am trying to follow along

Re: [PHP] php 5 install

2004-04-10 Thread Richard Harb
That's just one of those annoying out of office messages... I could translate it .. but if the sender didn't care I guess it's not important enough for him to provide an english translation himself. Saturday, April 10, 2004, 11:17:44 PM, you wrote: anybody know how to put that in english?? i

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Richard Harb
Not quite sure what you mean... So I assume the data was written into the worng fields. If that is the case you could modify your insert query: INSERT INTO table (id, name) VALUES ('$id', '$name') hth Richard Friday, April 9, 2004, 4:11:05 PM, you wrote: Hi, I am getting 2 values from a

Re: [PHP] Finding value in multi-dimensional array

2004-04-09 Thread Richard Harb
do a print_r() for the structure. -- print_r($_SESSION[OBJ_user]); and look at the page source. at each level ... if is says array refer to it with ['property'] if obj (stdClass or otherwise) use - that arrow thingy I am not sure what the arrows in you desc mean, whether it's key/value pair of

Re: [PHP] Finding value in multi-dimensional array

2004-04-09 Thread Richard Harb
No problem .. Let's see: if($_SESSION['OBJ_user']-modSettings['listings']['active'] == '1') { That should be it ... Sidenote: use single quotes whenever the string needn't be evaluated (i.e. is a variable itself) you save a couple cycles every time. hth Richard Friday, April 9, 2004, 10:32:25

Re: [PHP] regular expressions

2004-04-09 Thread Richard Harb
Saturday, April 10, 2004, 2:02:04 AM, you wrote: I'm trying to 'clean up' some text that is extracted from a web directory, and I need to use (I think) preg_replace or ereg_replace, etc. I've read a bunch of tutorials, but none of them seem to cover the particular thing I want to do. Here's

Re: [PHP] require_once '../config.php'; doesn't work?

2004-04-09 Thread Richard Harb
Depends on where the executed script is located ... And it always depends on the script that is called - if you give a relative path like you did here. if the script you called would be http://www.example.com/news/2004-04-10/mypage.php then config.php would have to be in /news if your layout is

Re: [PHP] html forms class in php

2004-04-08 Thread Richard Harb
Then again you can just put the pear stuff into a subdirectory of your project site / whatever. for PHP 4 = 4.3.0 you could have a look at: http://www.php.net/manual/en/function.set-include-path.php for older versions you can use ini_set (@see same url) I've seen it done - works just as well.

Re: [PHP] smarty

2004-04-08 Thread Richard Harb
Well, I can't say that it's a 'good' tutorial, it's a little messy, but it's along the lines of how I am using it ... If you want to have a look, I put together a page and some explanations and stuffed it into an archive (162Kb) You can downlad it at http://www.wegotit.at/sm_demo.zip If you're

Re: [PHP] Compare Case Insensitive?

2004-04-08 Thread Richard Harb
let's see: eregi() preg_match() strtolower() ... either one could help you probably fastest is convert the user string to lower case and compare ... or upper case .. your choice. Damn. so many options. Thursday, April 8, 2004, 5:21:15 PM, you wrote: How can I compare a variable submitted by a

Re: [PHP] simple mysql_result() question

2004-04-07 Thread Richard Harb
Uhm .. I usually do: SELECT COUNT(id) FROM users WHERE name='$username' AND password='$password' if (username is found) // hopefully it's unique found ya else sorry This way you aleays have a value returned... HTH Richard Thursday, April 8, 2004, 3:29:11 AM, you wrote: hello, I am

Re: [PHP] very large and long if statement

2004-04-07 Thread Richard Harb
Thursday, April 8, 2004, 3:59:39 AM, you wrote: I have this very large and long if statement: if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date'] !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county'])

Re: [PHP] problems with md5()

2004-04-07 Thread Richard Harb
could it be that the field in the database is of type varchar(25) ? looks like it's too small to hold the complete hash: that one always consists of 32 characters. Thursday, April 8, 2004, 6:35:47 AM, you wrote: hello, I have a database containing usernames and md5 encrypted passwords. When

Re: [PHP] smarty

2004-04-06 Thread Richard Harb
Tuesday, April 6, 2004, 5:33:03 PM, you wrote: hi all has anyone used smarty before? what do you think of it? I think it's pretty nice to seperate your script (code) from your design. i would like to hear your comments and if you have any alternatives let me know. Hi, I've used it on a few

Re: [PHP] Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Richard Harb
Monday, April 5, 2004, 11:23:29 PM, you wrote: I am trying to use fewer resources and processes when making database connections in my scripts, so, upon the first call to make a DB connection, I store the Link Resource ID in a constant variable that can be accessed by all other functions that

Re: [PHP] includes

2004-04-05 Thread Richard Harb
Monday, April 5, 2004, 4:47:52 PM, you wrote: Hello all, I have a problem. My directory list is similar to this: root tmpl inc forums snipped My question is in the test_form and message forums. How do I do the include files to read from the tmpl and inc?? I can get the

Re: [PHP] mysql_query problem with multi dim arrays

2004-04-05 Thread Richard Harb
Tuesday, April 6, 2004, 1:21:52 AM, you wrote: hi... i cant cut and paste my exact mysql query because it takes the '' stuff out doubles the $'s and the ,'s in the whole thing (dont know why but anyways...)... i have a query that goes something like this: mysql_query(insert into

[PHP] Sorting array of objects

2004-04-04 Thread Richard Harb
Hi there, Supposed I have an array of objects, like: $this[$i]-property1 $this[$i]-property2 is there any 'cheap' way to sort the array according to the values of property1? The only way I thought I would be able to accomplish this is to transform this into an assoc array or something like it