php-general Digest 2 Feb 2005 10:37:10 -0000 Issue 3263

2005-02-02 Thread php-general-digest-help
php-general Digest 2 Feb 2005 10:37:10 - Issue 3263 Topics (messages 207863 through 207881): Re: Escaped characters 207863 by: Richard Lynch Re: Problem with SELECT SQL_CALC_FOUND_ROWS 207864 by: Richard Lynch File upload difference between browsers 207865 by:

Re: [PHP] fsockopen

2005-02-02 Thread Bostjan Skufca @ domenca.com
Last two examples are fine as connection is obviously established, it is the communication with server that is causig an error. Read http protocol documentation. You do not want such a degree of control over communication you can just use file_get_contents($url); where $url is

[PHP] regular expresion

2005-02-02 Thread php
I want to parse a html file for instance body paaa /p baaa hhh /b paaa eee /p iaaa /i /body and I want to create a regular expresion wich is able to extract entire text from enclosed tags WITHOUT a particular

[PHP] how create system users with php

2005-02-02 Thread Umar Draz
Hi dear members!! i want a script that i can add system user through php. For example i have FreeBSD 5.3 for adding a user in freebsd i use this command pw useradd username -g groupname -d /home/username -m now i want creating user through php what kind of script will be required

[PHP] PHP Memory limit exceeded

2005-02-02 Thread Ben-Nes Yonatan
Hi all, I got a problem with uploading files which encounter the memory limit when their size is not even close to the memory limit itself, let me explain. My server is as follows: 1. PHP 4.3.9 2. DB - Postgresql 7.4 3. Apache 1.3.26 Here is my code that i made for testing the problem (along

AW: [PHP] regular expresion

2005-02-02 Thread Mirco Blitz
Hi, Use strip_tags() instead of regex. http://www.php-center.de/en-html-manual/function.strip-tags.html Greetings Mirco -Ursprüngliche Nachricht- Von: php [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 2. Februar 2005 09:25 An: php-general@lists.php.net Betreff: [PHP] regular

Re: [PHP] cal_days_in_month() missing, how can I tell if it exists

2005-02-02 Thread Ben Edwards
On Tue, 1 Feb 2005 18:57:12 -0600, James Kaufman [EMAIL PROTECTED] wrote: On Tue, Feb 01, 2005 at 08:47:29PM +, Ben Edwards wrote: I have been implementing a system on a different ISP than I normally use and have got:- Fatal error: Call to undefined function: cal_days_in_month() in

[PHP] Multiline data Insert Into table from a generated form?

2005-02-02 Thread Alp
Hi experts, I'd like your advice on the following as to how to approach/resolve. I'm generating a form based on a user input number, say 3, where 3 lines for input for a few fields are created. What would be the appropriate way to append these 3 seperate lines into the table all at one go? I have

Re: [PHP] Multiline data Insert Into table from a generated form?

2005-02-02 Thread Mike Smith
Code: print 'table width=545 border=0 cellspacing=0 cellpadding=0 align=centertr'; print 'form action=test1.php method=POST'; $i = 1; while ($i = $tour_days) { print 'input type=hidden name=tourdays value='.$tour_days.''; print 'input type=hidden name=tourid'.$i.'

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Robin Vickery
On Wed, 02 Feb 2005 01:24:18 -0500, Angelo Zanetti [EMAIL PROTECTED] wrote: Does this setup sound secure enough and a solution that can work? What kind of encryption should I be using? Point out any areas where you think I might be missing something or going wrong. Take Richard's advice

[PHP] Re: how create system users with php

2005-02-02 Thread M. Sokolewicz
shell_exec('pw useradd username -g groupname -d /home/username -m'); however, you'd need to be running as root, or atleast need to su to root; which is quite a security hazard Umar Draz wrote: Hi dear members!! i want a script that i can add system user through php. For example i have

Re: [PHP] Getting two queries into one result set

2005-02-02 Thread Shaun
Hi guys, Thanks for your replies but neither UNION or REGEXP can be used with SHOW TABLES... Any ideas? Jochem Maas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Marek Kilimajer wrote: Shaun wrote: Hi, I have a query where I select all table names where the table name has

RE: [PHP] Getting two queries into one result set

2005-02-02 Thread Jay Blanchard
[snip] Thanks for your replies but neither UNION or REGEXP can be used with SHOW TABLES... [/snip] SHOW TABLES is such a limited query and allows for such primitive conditionals that you would probably have better results doing two queries and looping them into the same output -- PHP General

Re: [PHP] Getting two queries into one result set

2005-02-02 Thread Marek Kilimajer
Shaun wrote: Hi guys, Thanks for your replies but neither UNION or REGEXP can be used with SHOW TABLES... Any ideas? It's time to change your table design. Use one pid table and add another column that would hold the number. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Getting two queries into one result set

2005-02-02 Thread Graham Cossey
You don't say how many tables you have, how they are named or anything outside of the query itself. Assuming that not all your tables are named PID_* how about simply doing SHOW TABLES LIKE '%PID_%' and selecting appropriate results within the php script using strstr or regular expressions?

Re: [PHP] PHP Memory limit exceeded

2005-02-02 Thread Marek Kilimajer
Ben-Nes Yonatan wrote: Hi all, I got a problem with uploading files which encounter the memory limit when their size is not even close to the memory limit itself, let me explain. My server is as follows: 1. PHP 4.3.9 2. DB - Postgresql 7.4 3. Apache 1.3.26 Here is my code that i made for

Re: [PHP] Getting two queries into one result set

2005-02-02 Thread Tom
Graham Cossey wrote: You don't say how many tables you have, how they are named or anything outside of the query itself. Assuming that not all your tables are named PID_* how about simply doing SHOW TABLES LIKE '%PID_%' and selecting appropriate results within the php script using strstr or

Re: [PHP] Re: how create system users with php

2005-02-02 Thread Marek Kilimajer
M. Sokolewicz wrote: shell_exec('pw useradd username -g groupname -d /home/username -m'); however, you'd need to be running as root, or atleast need to su to root; which is quite a security hazard I recomend sudo. You can set strict restrictions on the executed commands and its arguments. Umar

[PHP] stripos kills my script but strpos is fine?

2005-02-02 Thread Michael
I'm trying to use stripos as a faster and less resource-intensive alternative to preg_match with the i flag, but I'm getting some strange behavior. Here's a test script that demonstrates the problem: --- ?php $days = array(Mon, Tue, Wed, Thu, Fri, Sat, Sun); foreach ($days as $d) { echo

Re: [PHP] Escaped characters

2005-02-02 Thread Brian Dunning
Thanks! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Fighting user's cache with an updated image

2005-02-02 Thread Dave
PHP General, The Situation: I have a form on my web page which uses PHP to upload an image into a user's directory. Because I use the uploaded image in a variety of places in my web site, my script renames the file to conform to naming conventions I use on the site. Users can keep one

RE: [PHP] Fighting user's cache with an updated image

2005-02-02 Thread Chris Ramsay
Check out: http://uk2.php.net/manual/en/function.header.php Where you will find: ?php // Date in the past header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // always modified header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // HTTP/1.1 header(Cache-Control: no-store, no-cache,

[PHP] DomElement oddness

2005-02-02 Thread Chris Boget
Consider the following: This function - function setAttribute( $nodeName, $attributeName, $attributeValue ) { $domElement = $this-DOMDocument-get_elements_by_tagname( $nodeName ); if( $domElement ) { echo 'ObjectData: pre' . print_r(

[PHP] Link to content of Directory

2005-02-02 Thread Marquez Design: Steve Marquez
Greetings all, I am currious if someone could point me to a script to list the content of a directory, then link to each file in that directory. Example: The directory contains 80 .GIF files. I want to create a page that will have links to each file. Is this possible? Thank you very much,

Re: [PHP] DomElement oddness

2005-02-02 Thread Chris Boget
Consider the following: Never mind. I'm retarded. :p Sorry, folks. Nothing to see here but an empty brain cavity. Move along. :) thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Link to content of Directory

2005-02-02 Thread Steve Buehler
At 10:52 AM 2/2/2005, Marquez Design: Steve Marquez wrote: Greetings all, I am currious if someone could point me to a script to list the content of a directory, then link to each file in that directory. Example: The directory contains 80 .GIF files. I want to create a page that will have links to

[PHP] What's wrong with this rewrite rule?

2005-02-02 Thread Chris W. Parker
Hello, I've been messing with a certain rewrite rule for about 30 minutes now and it's driving me insane. I've got plenty of other rewrite rules working perfectly. Here is the rule in question. RewriteRule ^detail\.asp\?product_id=([\w-]+)$ product.php?id=$1 The URL I'm testing this with is:

[PHP] Prepend policy

2005-02-02 Thread Sdäv
Hey guys, i was wondering if there is any way to make prepend (php.ini option) work as an include once and not an STD include. Tnx Sdäv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Question

2005-02-02 Thread a_pyramidin
I have corrected your document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Prepend policy

2005-02-02 Thread Richard Lynch
Sdäv wrote: Hey guys, i was wondering if there is any way to make prepend (php.ini option) work as an include once and not an STD include. Well, it's for sure gonna get included once, right? If you're worried about it getting included again... I'm not sure of the semantics of: ?php include

Re: AW: [PHP] regular expresion

2005-02-02 Thread Stian Berger
Hi! strip_tags() would not solve his problem, although that was my first thought as well. To skip tags, including content, where content contains certain words is possible. But to me the problem occurs with nested tags. What do you want to do when you meet tables? Here is an example that

Re: [PHP] stripos kills my script but strpos is fine?

2005-02-02 Thread Richard Lynch
Michael wrote: I'm trying to use stripos as a faster and less resource-intensive alternative to preg_match with the i flag, but I'm getting some strange behavior. Here's a test script that demonstrates the problem: --- ?php $days = array(Mon, Tue, Wed, Thu, Fri, Sat, Sun); foreach ($days

Re: [PHP] Multiline data Insert Into table from a generated form?

2005-02-02 Thread Alp
Thank you Mike for your quick reply. I will try to incorporate it into the function I'm using and let you know the result. The function code is also given below. Alp function add_to_database( $tourid, $dayno, $fromto, $bld, $descrip, $dberror) { //user connection section--begin

[PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread M. Sokolewicz
the problem is actually really easy You're not asking it on an apache list (this is a PHP list... so why should anyone here know anything about mod_rewrite for apache?) sorry if I sounded rude, but that's just the way I feel about it Chris W. Parker wrote: Hello, I've been messing with a

[PHP] Is it possible compile a php script to native binary like perlcc ?

2005-02-02 Thread Unreal HSHH
Hi, Is it possible compile a php script to native binary like perlcc ? That can run the binary and no depend on php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how create system users with php

2005-02-02 Thread Richard Lynch
Umar Draz wrote: i want a script that i can add system user through php. For example i have FreeBSD 5.3 for adding a user in freebsd i use this command pw useradd username -g groupname -d /home/username -m now i want creating user through php what kind of script will be required You

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread John Nichel
Argghhhreturn receipts -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Memory limit exceeded

2005-02-02 Thread Richard Lynch
Ben-Nes Yonatan wrote: $data = INSERT INTO test_files (bin_data, filename, filesize, filetype) VALUES ('$data', '$imagefile[name]', '$imagefile[size]', '$imagefile[type]'); // creating the sql for the insert, i called the received value also $data cause i dont want to keep the previous

Re: [PHP] regular expresion

2005-02-02 Thread Richard Lynch
php wrote: I want to parse a html file for instance body paaa /p baaa hhh /b paaa eee /p iaaa /i /body and I want to create a regular expresion wich is able to extract entire text from enclosed tags

RE: [PHP] Is it possible compile a php script to native binary like perlcc ?

2005-02-02 Thread Jay Blanchard
[snip] Is it possible compile a php script to native binary like perlcc ? That can run the binary and no depend on php. [/snip] See http://www.priadoblender.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Need help with ereg regular expression

2005-02-02 Thread KHS
Hi, I'm trying to extract a string using 'ereg()' but it doesn't seem to find some strings. I am using php version 4.3.10 in cli mode. Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Here is a snip of my code: $line = fgets($fp); $line =

RE: [PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread Chris W. Parker
M. Sokolewicz mailto:[EMAIL PROTECTED] on Wednesday, February 02, 2005 10:22 AM said: the problem is actually really easy You're not asking it on an apache list (this is a PHP list... so why should anyone here know anything about mod_rewrite for apache?) sorry if I sounded rude, but

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Richard Lynch
Angelo Zanetti wrote: thanks for the info. With regard to the setup it will be something more or less like this: DON'T DO IT!!! I want to generate my own keypair. The private key I keep secure, offline, on the machine that does the admin (charging, refunds etc). The public key is used

Re: [PHP] Prepend policy

2005-02-02 Thread John Nichel
Sdäv wrote: Hey guys, i was wondering if there is any way to make prepend (php.ini option) work as an include once and not an STD include. You could use the prepended file to do your includes prepend includes.inc.php includes.inc.php -- ?php include_once ( foo.php ); include_once ( bar.php );

Re: [PHP] Is it possible compile a php script to native binary like perlcc ?

2005-02-02 Thread John Nichel
Unreal HSHH wrote: Hi, Is it possible compile a php script to native binary like perlcc ? That can run the binary and no depend on php. Yes. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Need help with ereg regular expression

2005-02-02 Thread Mikey
Argghhhreturn receipts I just mailed the guy and gave him a friendly nod - they are off now :-) Mikey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread Richard Lynch
KHS wrote: Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Here is a snip of my code: $line = fgets($fp); $line = trim($line); $regexp = '^#include(:? | | )([^ ]+)[ ]'; //$regexp = '^#include( | | )[^ ]+[ ]'; //Same result as above

Re: [PHP] Is it possible compile a php script to native binary like perlcc ?

2005-02-02 Thread Richard Lynch
Unreal HSHH wrote: Is it possible compile a php script to native binary like perlcc ? That can run the binary and no depend on php. Not truly, but Google for PHP Compiler and you should find some alternatives that may fit your needs. Fair Warning: Some will be commercial, some won't. -- Like

Re: [PHP] stripos kills my script but strpos is fine?

2005-02-02 Thread Michael
Richard Lynch wrote: Michael wrote: I'm trying to use stripos as a faster and less resource-intensive alternative to preg_match with the i flag, but I'm getting some strange behavior. snip problem description AFAIK, stripos should behave exactly like strpos except case-insensitively. So in the

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread KHS
Richard Lynch wrote: KHS wrote: Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Here is a snip of my code: $line = fgets($fp); $line = trim($line); $regexp = '^#include(:? | | )([^ ]+)[ ]'; //$regexp = '^#include( | | )[^ ]+[ ]'; //Same

[PHP] imap_mail_compose function in PHP5

2005-02-02 Thread Bronislav Klucka
Hi, i've got problem with imap_mail_compose function, I have this code: $envelope[from]= [EMAIL PROTECTED]; $envelope[to] = [EMAIL PROTECTED]; $envelope[cc] = [EMAIL PROTECTED]; $body[1][type] = TYPETEXT; $body[1][subtype] = plain;

[PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread Michael
Chris W. Parker wrote: Hello, I've been messing with a certain rewrite rule for about 30 minutes now and it's driving me insane. I've got plenty of other rewrite rules working perfectly. Here is the rule in question. RewriteRule ^detail\.asp\?product_id=([\w-]+)$ product.php?id=$1 You're insisting

RE: [PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread Chris W. Parker
Michael mailto:[EMAIL PROTECTED] on Wednesday, February 02, 2005 11:54 AM said: You're insisting that the path to rewrite start with d. It's not going to start with d, it's going to start with /. As in /detail.asp... Easy thing to miss, though... Actually that's not why. None of my

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread Richard Lynch
KHS wrote: Richard Lynch wrote: KHS wrote: Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Perhaps: ?php $text = trim(str_replace(#include, , $text)); preg_match('[]?(.*)[]?', $text, $answer); echo $answer[1]; ? -- Like Music?

RE: [PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread phpnews
On Wed, 2 Feb 2005 12:09:43 -0800, Chris W. Parker [EMAIL PROTECTED] said: Michael mailto:[EMAIL PROTECTED]on Wednesday, February 02, 2005 11:54 AM said: You're insisting that the path to rewrite start with d. It's not going to start with d, it's going to start with /. As in

[PHP] Using SSL with PHP5's socket_* functions

2005-02-02 Thread dan
Hello, all - I am a bit new to PHP, especially sockets, so what I am asking may very well be comparing apples to oranges. I am writing a function to interact with an SSL server, but I see no way of how I can communicate over SSL. I expected to be able to enter an address such as

RE: [PHP] Credit card storing, for processing

2005-02-02 Thread Brandon Thompson
WowI was hoping someone would respond with a little balance to that reactionary doomsday speech. Don't get me wrong...those are some very valid points that need to be considered, but my gosh... The key-pair idea is very good. I've done systems in the past for clients that work in a similar

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Brian Dunning
The SIMPLEST way to do this is to charge their credit card with a recurring charge when they sign up, and then just THROW AWAY their credit card number. Your credit card processing vendor then has to remember their credit card number, not you. I agree. This is the way I've worked for years, and

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Brian Dunning
It's FAR less dangerous to implement what you are suggesting than it is to simply pay for your dinner with a credit card. I agree with this. There is way too much paranoia about credit cards online. 99% of stolen credit card numbers are acquired by phishing and the other 1% by uncrumpling

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Jason Barnett
Brian Dunning wrote: It's FAR less dangerous to implement what you are suggesting than it is to simply pay for your dinner with a credit card. I agree with this. There is way too much paranoia about credit cards online. 99% of stolen credit card numbers are acquired by phishing and It depends

[PHP] PEAR::SOAP returns objects instead of associative arrays

2005-02-02 Thread William Lovaton
Hello, I just found out that since version 0.7, PEAR::SOAP returns stdClass objects instead of associative arrays. http://pear.php.net/package-changelog.php?pacid=87release=0.7.3 What is the reason for this? I _need_ to get associative arrays, how do I revert to the old behavior? -William --

[PHP] RE: How to make binary strings useful?

2005-02-02 Thread Jerry Miller
Here's the code (with the domain name removed) that doesn't work, despite the poor documentation of the variable types: ? $dir = /home/domain_name/www/binary/; $dh = opendir ($dir); do { $file = readdir ($dh); } while (!strncmp

Re: [PHP] Credit card storing, for processing

2005-02-02 Thread Brian Dunning
It depends on the exact situation, but a lot of times the vendors that process a fraudulent credit card purchase end up eating that loss. I can testify to this by experience. I ate $10,000 on one run of phished transactions. the other 1% by uncrumpling receipts out of a wastebasket. There's no

[PHP] How to make binary strings useful?

2005-02-02 Thread Jerry Miller
Is there an example of the UNIX od utility written in PHP? Is such a useful task even possible?? From what I've seen of strings, they're completely opaque, so what good does it do to be able to read binary-safe strings from a file??? Even the deprecated (why) $str{$inx} notation apparently

[PHP] PEAR::SOAP returns objects instead of associative arrays

2005-02-02 Thread William Lovaton
Hello, I just found out that since version 0.7, PEAR::SOAP returns stdClass objects instead of associative arrays. http://pear.php.net/package-changelog.php?pacid=87release=0.7.3 What is the reason for this? I _need_ to get associative arrays, how do I revert to the old behavior? -William --

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 02:18, John Nichel wrote: Argghhhreturn receipts Use a *real* mail client -- one that ignores those stupid things. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet

[PHP] newbie question ; calling php script with parrameters from html

2005-02-02 Thread Sagaert Johan
can i use this kind of construction in my html code ? a href=test.php?selection=highSelect high/a if yes , how do i retrieve the passed string in the php code Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to make binary strings useful?

2005-02-02 Thread Jerry Miller
There's a FAQ section entitled PHP and Other Languages, C isn't even listed among them! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 03:44, KHS wrote: On the other hand, I think you could safely do: $regex = ^#include(.*)$; and get what you want by using trim on the captured expression. no this would leave me with , , and marks. Then string replace those characters. Or am I missing

AW: [PHP] newbie question ; calling php script with parrameters from html

2005-02-02 Thread Mirco Blitz
Hi, There are multiple Ways of getting that string. If your PHP-Server has globals=on in php ini you will recive that string in $selection variable. If not you recive it in $_GET[selection] So I use a function to handle POST and GET Variabels. function getpost_ifset($test_vars) {

RE: [PHP] newbie question ; calling php script with parrameters from html

2005-02-02 Thread Chris W. Parker
Sagaert Johan mailto:[EMAIL PROTECTED] on Wednesday, February 02, 2005 2:38 AM said: can i use this kind of construction in my html code ? a href=test.php?selection=highSelect high/a Yes. if yes , how do i retrieve the passed string in the php code ?php $value =

Re: [PHP] How to make binary strings useful?

2005-02-02 Thread Chris
I've written complete file parsers in PHP, and the only snag I've run into is dealing Signed integers (and larger). Jerry Miller wrote: Is there an example of the UNIX od utility written in PHP? Is such a useful task even possible?? From what I've seen of strings, they're completely opaque, so

Re: [PHP] Re: How to make binary strings useful?

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 07:00, Jerry Miller wrote: There's a FAQ section entitled PHP and Other Languages, C isn't even listed among them! Neither is Prolog, Pascal, ADA, ..., The point you seem to be missing is that PHP is geared mainly towards creating web pages, that's why ASP, Perl,

Re: [PHP] How to make binary strings useful?

2005-02-02 Thread Jerry Miller
That should help. Thanks. Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've written complete file parsers in PHP, and the only snag I've run into is dealing Signed integers (and larger). Jerry Miller wrote: Is there an example of the UNIX od utility written in PHP? Is

[PHP] Re: How to make binary strings useful?

2005-02-02 Thread DvDmanDT
It's a pretty big difference, so there's logic for that.. You can't really compare them.. Not in my opinion anyway.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com Jerry Miller [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] There's a FAQ section entitled PHP and

Re: [PHP] RE: How to make binary strings useful?

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 05:46, Jerry Miller wrote: Here's the code (with the domain name removed) that doesn't work, despite the poor documentation of the variable types: $filename = sprintf (%s%s, $dir, $file); Wouldn't $filename = $dir . $file; be easier? printf

[PHP] Re: How to make binary strings useful?

2005-02-02 Thread DvDmanDT
You should use ord() on each of the $cont{} ones.. printf (%02x %02x %02x %02x, ord($cont{0}), ord($cont{1}), ord($cont{2}), ord($cont{3})); That'll probably work much better.. .. PHP != C++, or C for that matter.. C was designed to be as close as possible to ASM, but high-level.. PHP

[PHP] Re: How to make binary strings useful?

2005-02-02 Thread DvDmanDT
PHP files can be named whatever you want.. Just know that they are parsed on the serverside, not the client side.. Therefore, text/php would be pretty stupid to do.. And I don't know what you mean be that script thing, you probably don't even understand what PHP is when you make that statement..

[PHP] Using SELECT IN with arrays

2005-02-02 Thread W Luke
Hi. I'm trying to execute a query which does a SELECT IN on an array...here's how it stands: $doms = implode( ',', $domarray ); $d=$_GET['d'] $qmailsql = SELECT mq.id, mq.user, mq.domain, mq.sender, mq.arrive_time, mq.subject, mq.body_preview, mq.relay FROM mail_quarantine AS mq WHERE //??

Re: [PHP] Using SELECT IN with arrays

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 07:58, W Luke wrote: $doms is a master array of a user's domains. $d is a comma-seperated and unexploded list of domains to filter the SELECT down with. (error checking is already in place) 1) make both $d and $doms into array 2) use array_intersect() to find

[PHP] problems with session timeout

2005-02-02 Thread Pedro Henrique Calais
hey everybody, I'm with the following problem: my PHP scripts takes a very long time to execute (about 3 hours) because it has has system call to a perl script that is very time consuming. in IE (haven't noticed this in Mozilla or Konqueror) the execution of the PHP script doesn't finish, due

[PHP] Is there a function to c if a php function exists

2005-02-02 Thread Ben Edwards (lists)
I have been implementing a system on a different ISP than I normally use and have got:- Fatal error: Call to undefined function: cal_days_in_month() in /home/hosted/www.menublackboard.com/public_html/dev/classes/validator.class.php on line 134 I found a reference to this an the web and it

Re: [PHP] problems with session timeout

2005-02-02 Thread Jason Wong
On Thursday 03 February 2005 10:05, Pedro Henrique Calais wrote: I'm with the following problem: my PHP scripts takes a very long time to execute (about 3 hours) because it has has system call to a perl script that is very time consuming. in IE (haven't noticed this in Mozilla or Konqueror)

Re: [PHP] Using SELECT IN with arrays

2005-02-02 Thread W Luke
On Thu, 3 Feb 2005 08:37:44 +0800, Jason Wong [EMAIL PROTECTED] wrote: $doms is a master array of a user's domains. $d is a comma-seperated and unexploded list of domains to filter the SELECT down with. (error checking is already in place) 1) make both $d and $doms into array 2) use

Re: [PHP] Is there a function to c if a php function exists

2005-02-02 Thread The Disguised Jedi
The function is called function_exists. Honestly, just look at the manual dude On Tue, 01 Feb 2005 20:33:11 +, Ben Edwards (lists) [EMAIL PROTECTED] wrote: I have been implementing a system on a different ISP than I normally use and have got:- Fatal error: Call to undefined

[PHP] Re: Is there a function to c if a php function exists

2005-02-02 Thread Jason Barnett
Ben Edwards wrote: ... So something like function_exists( cal_days_in_month() ) http://www.php.net/manual/en/function.function-exists.php And to check if a specific extension is enabled: http://www.php.net/manual/en/function.extension-loaded.php -- Teach a man to fish... NEW? |

[PHP] Headers already sent error

2005-02-02 Thread Tim Burgan
Hello, I'm receiving an error Cannot modify header information - headers already sent by XXX. In my php, I have a heap of code, then use header(Location: blah.php); to redirect the user. I get this error on the webhost, but not on my local host. I've searched and found that this can be caused

Re: [PHP] Headers already sent error

2005-02-02 Thread Robby Russell
On Thu, 2005-02-03 at 12:59 +1030, Tim Burgan wrote: Hello, I'm receiving an error Cannot modify header information - headers already sent by XXX. In my php, I have a heap of code, then use header(Location: blah.php); to redirect the user. I get this error on the webhost, but not on

[PHP] Re: What's wrong with this rewrite rule?

2005-02-02 Thread Matthew Weier O'Phinney
* Michael [EMAIL PROTECTED]: Chris W. Parker wrote: and it's driving me insane. I've got plenty of other rewrite rules working perfectly. Here is the rule in question. RewriteRule ^detail\.asp\?product_id=([\w-]+)$ product.php?id=$1 You're insisting that the path to rewrite start with

Re: [PHP] Multiline data Insert Into table from a generated form?

2005-02-02 Thread Alp
Hi Mike, PHP returns a parse error indicating the line number for the while (.) ! Code now is: function add_to_database( $tourid, $dayno, $fromto, $bld, $descrip, $dberror) { //user connection section--begin $username=root; $password=; $database=nazardane; $link =

Re: [PHP] Multiline data Insert - Resolved

2005-02-02 Thread Alp
Hi Mike, Resolved it. Well, actually your code is a 'for' rather than a 'while' which I realized a bit late. :-) And there were two fullstops that needed to be a comma. Now it works. Thanks a lot for your guidance. Alp Alp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Mike,

[PHP] Reading a .doc or .rtf file in php

2005-02-02 Thread sunil
I have got a task of reading a .doc(word document) using php. But while reading doc file, some meta character like boxes and some other characters also appears. I will be highly obliged to you if you send me the code for reading a .doc file using php. Any help appriciated.

Re: [PHP] Headers already sent error

2005-02-02 Thread Chris
Tim Burgan wrote: Hello, I'm receiving an error Cannot modify header information - headers already sent by XXX. In my php, I have a heap of code, then use header(Location: blah.php); to redirect the user. I get this error on the webhost, but not on my local host. I've searched and found that