[PHP] dates problem

2001-09-08 Thread Nikola Veber
I'm having a prowith determing a time interval. I need to find out how many seconds, minutes, days have passed since a cpecific date (1.1.1980.), but when I pass that dade to a time stamp , I get 1983.315529200. How am I suposed to handle the year (1983.) o there is smething else ? I think the

RE: [PHP] Ordering a query

2001-09-08 Thread Matthew Loff
You could insert a ternary operation... ($order?$order:defaultfield) Is the same as: if($order) echo $order; else echo defaultfield; ... $result = mysql_query(SELECT articles.title,vote.votes,vote.total,articles.date,staff.firstname,artic les.content,articles.id FROM

[PHP] manage a mail archive

2001-09-08 Thread crorepati
Hello, We are using ezmlm mailing list on our server. We want to make the mailing list archive available on our website. How can we do this ? any help will be highly appreciable. thanks cp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP] [-= Your Vacation Winning =-]

2001-09-08 Thread Tessy103
You have been specially selected to qualify for the following: Premium Vacation Package and Pentium PC Giveaway To review the details of the please click on the link with the confirmation number below: http://wintrip.chn.net or http://wintrip.my163.com Confirmation Number#Lh340 Please confirm

[PHP] a general perl like pares of the query string...

2001-09-08 Thread Aaron Moore
Ok if you have a query string from like file.php?bob=managerphil=employ how do i split the bob=manager and phil=employ dynamically? because i may have 2 or 3 elements and i just want to sepearte them all and access them via an array such as if ($var[bob] = manager) etc so a loop that would

[PHP] include problem

2001-09-08 Thread mail
Hi I have a little Problem with include.I want to include a txt file in every php file on the server but some php files are in other directories and dont include this txt file. Example : Url for the txt file : www.domain.com/include/incl.txt So www.domain.com/index2.php includes the txt file

[PHP] optimize question

2001-09-08 Thread Michele Schiavo
Is most performant for out a sting use echo or print ? and if I have more print command ex: print aaa, print ; Is best use a single command with a very long string ? Thank's michele Schiavo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP] creating ZIP file from mySQL content?

2001-09-08 Thread BRACK
I have a site where ppl can upload their text-based ideas in real time, so that I have new records in db every day. When I did uploading by hands and had over 200 files on that site I distributed all site content in downloadable for of zipped win-help formate. Well, I don't think that I can

[PHP] session_name causes break

2001-09-08 Thread Christian Haines
hi all, has anyone else had problems with specifying session_name causing data not being input into session variables? For example: session_name(test); session_start(); session_register(count); count++; causes count not to increment whereas session_start(); session_register(count); count++;

[PHP] Re: a general perl like pares of the query string...

2001-09-08 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aaron Moore) wrote: Ok if you have a query string from like file.php?bob=managerphil=employ how do i split the bob=manager and phil=employ dynamically? because i may have 2 or 3 elements and i just want to sepearte them all and access

Re: [PHP] manage a mail archive

2001-09-08 Thread B. van Ouwerkerk
You can use MySQL. Take a look at the ezmlm homepage, and check the ezmlm mailinglist archive.. Pulling data out of a MySQL table is easy.. if you don't know how, just look at some tutorials (www.devshed.com) more links can be found at www.php.net Bye, B. At 20:28 8-9-01 +, crorepati

[PHP] cURL support

2001-09-08 Thread Daniel Baldoni
G'day folks, I have a site just about ready to go on-line. All my local testing has worked like a dream - but the cURL support on the hosting provider is partially broken. Actually using curl_init()...curl_exec() etc. on my box to contact remote URIs (both over HTTP and HTTPS) has worked from

[PHP] Problem with Encoding

2001-09-08 Thread Harry Lau
I want to include a string into a PNG by ImageTTFText(), where some of the chars are encoded in BIG5. I have found the revalent TTF for BIG5. The output really gives some Traditional Chinese chars, but the chars are not those I want. (I think this problem also exist in Shift-JIS encoding.)

[PHP] Re: manage a mail archive

2001-09-08 Thread crorepati
hello How do I retrieve the messages from the list archive and how do i store the data in text files/database . Pl. help me out. thanks cp B. van Ouwerkerk writes: You can use MySQL. Take a look at the ezmlm homepage, and check the ezmlm mailinglist archive.. Pulling data out

[PHP] Smarty + JavaScript

2001-09-08 Thread Alexander Deruwe
Hey all, If anyone else out there is using Smarty as templating engine, how do you put JavaScript into the template? It seems to barf on the opening and closing braces of every JS function, rendering JS totally useless. I must be missing something. ad. -- PHP General Mailing List

[PHP] Re: a general perl like pares of the query string...

2001-09-08 Thread Aaron Moore
Well hers teh perl version of the the parser... how do i convert this to php $tmp = $ENV{'QUERY_STRING'}; @pairs = split(//, $tmp); foreach $item (@pairs) { ($key, $content) = split(/=/,$item,2); $content =~ tr/+/ /; $content =~ s/%(..)/pack(c,hex($1))/ge; $fields{$key} = $content; } --

Re: [PHP] Re: a general perl like pares of the query string...

2001-09-08 Thread Rasmus Lerdorf
http://php.net/parse_str On Sat, 8 Sep 2001, Aaron Moore wrote: Well hers teh perl version of the the parser... how do i convert this to php $tmp = $ENV{'QUERY_STRING'}; @pairs = split(//, $tmp); foreach $item (@pairs) { ($key, $content) = split(/=/,$item,2); $content =~ tr/+/ /;

[PHP] query string - count for records with keywords

2001-09-08 Thread sgibbs
I'm trying to get a count of the number of records in a database that have the keyword cat, for example. Below is the original code; I added the query with count at the bottom of this code but it doesn't seem to be working. I just get a return of 4 which doesn't correspond correctly with the

[PHP] Sterilize user input function

2001-09-08 Thread Kevin
I am looking for general a function to that would render user input harmless. I would write my own but don't know what to strip from the input that could make it potentially damaging on linux boxes. I need to accept email and phone numbers. Thanks in advance, Kevin -- PHP General Mailing

Re: [PHP] Re: a general perl like pares of the query string...

2001-09-08 Thread Aaron Moore
Wow... ok now i get it.. thanks guys Aaron Moore Michael Kimsal [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Aaron, CC Zona wrote before that: If track_vars is on (always true if version = 4.0.3), then the global vars $HTTP_GET_VARS['bob'] and

Re: [PHP] Mod-function?

2001-09-08 Thread Rasmus Lerdorf
It is an operator in PHP: % ie. echo 3 % 2; -Rasmus On Sat, 8 Sep 2001, Ville Mattila wrote: Hi folks, I found this kind of formulae which should calculate the distance between two points on earth: tc1=mod(atan2(sin(lon1-lon2)*cos(lat2),

[PHP] header(Location:...) is redirect: looking for full link

2001-09-08 Thread Chrisy
hi, The long explanation is below the summary. SUMMARY page1.php Header(location:page2.php) page2.php HTML link to page3.php page3.php REFERER=page1.php But in page3 i WANT to see page2.php as REFERER. So i suppose i must change something in page1. But what?

[PHP] Seperating a textarea into 3 different variables

2001-09-08 Thread Richard Kurth
I have a problem I am trying to set up a credit card form for worldpay And in the address field that I have to send to them it has to go in a textarea textarea cols=30 rows=4 name=address/textarea So when you fill this in it would look like this address city state Now this works fine for

[PHP] preg_replace_callback()

2001-09-08 Thread Arash Dejkam
Hi, What is a callback in preg_replace_callback(...) ? how can I use it ? can anybody give me an example ? Thanks, Arash -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list

[PHP] cookie error

2001-09-08 Thread Aaron Moore
when i submit a form and try to have it post a cookie in the php thing i get this error message: Warning: Cannot add header information - headers already sent by (output started at /usr/local/www/data/vi2dev/root/layout/functions.php:167) in /usr/local/www/data/vi2dev/root/admin/manager.php on

Re: [PHP] cookie error

2001-09-08 Thread Julie Meloni
Saturday, September 08, 2001, 5:40:46 PM, you wrote: AM when i submit a form and try to have it post a cookie in the php thing i get AM this error message: AM Warning: Cannot add header information - headers already sent by (output AM started at

[PHP] Re: Unresolved Mistery Error in PHP

2001-09-08 Thread Richard Lynch
You probably have differing versions of MySQL compiled into PHP and what you are actually *running* on your computer. Re-compile PHP and be sure to use --with-mysql=/path/to/your/mysql/source That source *MUST* match your running MySQL server. Watch the configure output messages, and be sure you

[PHP] Re: how to use fileatime() if the file name contains empty char?

2001-09-08 Thread Richard Lynch
You may need to escape it with file\\ name for the shell... Only I woulda thought PHP would take care of that... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little

[PHP] Re: Module/PHP conflict

2001-09-08 Thread Richard Lynch
You'll have to get a new version of php_dbg.dll from PHPEd, I think... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -

[PHP] Re: output using ClibPDF is blank - RESENT in ASCII

2001-09-08 Thread Richard Lynch
take out the header, and see if you have any error messages. I'm also willing to bet that cdpf_open() returns some special values for error -- Your code should check that. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy

[PHP] Re: private functions

2001-09-08 Thread Richard Lynch
You'll have to use the function to find out if the function is defined. http://php.net/function_exists You may want to mess with method_exists and try to define it as a method rather than a global function, which is what I think you are doing at this point. -- WARNING [EMAIL PROTECTED] address

[PHP] Re: independent PHP4 on shared Apache?

2001-09-08 Thread Richard Lynch
You can probably do a CGI install and only put the directives in your .htaccess or inside your httpd.conf VirtualHost block. For the Module, there's no way to Load/Unload for different Hosts. You could do the LoadModule and only have the AddType in *your* Host, but the Module itself would be

[PHP] Re: files

2001-09-08 Thread Richard Lynch
There's a Un*x utility for automagically doing this, but it leaves the new file blank, almost for sure... man logrotate Can we safely assume no *other* PHP script is going to be trying to write to this chat file while you're messing with it? If not, you really need to move to a database

[PHP] Re: dates problem

2001-09-08 Thread Richard Lynch
Use the MySQL function to_seconds or whatever it is. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message

[PHP] Re: optimize question

2001-09-08 Thread Richard Lynch
You probably won't be able to measure the difference unless you are doing 10,000 print statements... Optimize the things that are slow, not the things that are already fast. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music?

[PHP] Re: PHP and MySQL

2001-09-08 Thread Richard Lynch
Options: Increase the settings in MySQL that limit how many databases can be open at once. Decrease the number of Apache children running. Basically, as long as you have more Apache children than MySQL connections available, you can get this message. Actually, have a few spare MySQL

[PHP] Re: creating ZIP file from mySQL content?

2001-09-08 Thread Richard Lynch
http://php.net/zlib -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Brack [EMAIL

[PHP] Re: header(Location:...) is redirect: looking for full link

2001-09-08 Thread Richard Lynch
Add *ANOTHER* variable in the header(Location:) code that says redirect=1 In your page3, do: if($redirect){ $menuID = $foo; } else{ $menuID = $bar; } Where foo comes from the location, but bar comes from page2. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL

[PHP] Re: query string - count for records with keywords

2001-09-08 Thread Richard Lynch
That '4' you see is that this is the FOURTH thing you've asked MySQL to do in this script. You need to use http://php.net/mysql_result or other similar function to get your actual answer. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out?

[PHP] Re: Session variables

2001-09-08 Thread Richard Lynch
You'll have to define what you mean by "currently online". Do you mean actually waiting this moment for HTML to finish streaming to their browser? Or do you just mean, in my session files and not timed out yet? Probably the easiest way to do that would be to use

[PHP] Re: error with socket

2001-09-08 Thread Richard Lynch
Compare PHP versions from your computer ?php phpinfo();? and http://php.net/socket -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time:

[PHP] Re: How to use environment variables in php.ini?

2001-09-08 Thread Richard Lynch
http://php.net/getenv http://php.net/setenv Why you want to set them in the Environment instead of just regular variables is beyond me. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm

[PHP] Re: php/mysql search. need help

2001-09-08 Thread Richard Lynch
There are various sounds like modules such as soundex and metaphone and suchlike. These can ameliorate bad spelling. Another option, if you have a limited number of types available, is to give the user a popup menu rather than free-form box to type in. In general, the fewer ways you can provide

[PHP] Re: cURL support

2001-09-08 Thread Richard Lynch
Compare your ?php phpinfo();? with theirs and see what cURL differences there are... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time:

[PHP] Re: Seperating a textarea into 3 different variables

2001-09-08 Thread Richard Lynch
Use something like this to find out what character is *REALLY* in the stuff coming from worldpay: for($i = 0; $i strlen($worldpay_address); $i++){ $char = $worldpay_address[$i]; if (($ord = ord($char)) 32){ echo $char[$ord]; } else{ echo $char; } } Another

[PHP] Re: PHP and MySQL

2001-09-08 Thread Pieter Philippaerts
Unfortunately, I can't access these settings. It's not our computer that hosts our website. Regards, Pieter Philippaerts Richard Lynch [EMAIL PROTECTED] wrote in message 01e501c138ce$f3008300$6401a8c0@Lynchux100">news:01e501c138ce$f3008300$6401a8c0@Lynchux100... Options: Increase the settings

Re: [PHP] Sterilize user input function

2001-09-08 Thread Kevin
I think my question could be restated to: What characters are potentially lethal in user input. I can do the regex. But don't know what to parse out of the strings. would removing \ / . do the trick? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

[PHP] Homesite php

2001-09-08 Thread Andonny
Hi, Does the new version of homesite still have the same result with php. When I used to change anything in Design View and then went back to Edit View the ? became ?gt. Does this still happen??? Thanks Andonny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail:

Re: [PHP] Sterilize user input function

2001-09-08 Thread John Lim
It really depends on what you use the user input for. If you are just storing into a database and splashing it out to a html page later, htmlspecialchars( ) is adequete protection. If this is a filename, then checks for the prefix http://; and '..' and quotes in the file name, and a base

[PHP] mySQL / PHP Join Question

2001-09-08 Thread Dana Holt
I have a query that uses a LEFT JOIN, but the two tables have some columns with the same name. How can I tell the columns from each table apart? It seems that the joined table overwrites the values from the other table. Anyone know? Thanks. -- Dana Holt / [EMAIL PROTECTED] -- PHP General

[PHP] insert space to a string (newbie)

2001-09-08 Thread Andras Kende
Hi, I have a simple question... How can a space inserted to a string after the 3rd char ?? washington - was hington Thanks :) Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To

Re: [PHP] insert space to a string (newbie)

2001-09-08 Thread rm
Maybe something like: $word=washington; $length=strlen($word); $a=substr($word,0,3); $b=substr($word,3,$length-3); $string=$a. .$b; print $string; you might want to test for the length of $word first to make sure $word has more than 3 characters --- Andras Kende [EMAIL PROTECTED] wrote:

Re: [PHP] insert space to a string (newbie)

2001-09-08 Thread Ryan Fischer
You wrote: I have a simple question... How can a space inserted to a string after the 3rd char ?? washington - was hington $str = 'washington'; $str = ereg_replace('^(.{3})(.*)$', '\\1 \\2', $str); -- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/ -- PHP General

Re: [PHP] Re: Seperating a textarea into 3 different variables

2001-09-08 Thread Richard Kurth
Hello Gaylen, I am not sure what worldpay uses as an operating system but this work just perfect. Thanks Saturday, September 08, 2001, 6:09:08 PM, you wrote: Gaylen Fraley Is this under Windows? If so, it's probably passing \r\n : carriage Gaylen Fraley return/line feed. Check for both.

[PHP] Re: preg_replace_callback()

2001-09-08 Thread Richard Lynch
A callback is when you execute a function, and you provide to it a name of *another* function, which it will call on some data in the middle of its task. It's a very handy way to provide extreme flexibility in functional languages. For example: function my_array_walk($array, $function){

Re: [PHP] Re: run a script for any HTTP request (was: run a script on access to a directory)

2001-09-08 Thread Geoff Caplan
Enrique On Fri, 7 Sep 2001, Enrique Vadillo wrote: I am thinking now that i'd like to make it possible that for ANY http request received by my Apache i'd like to have a php script executed first I do this all the time - it offers all kinds of advantages. This link explains why and how