Re: [PHP] Presence of a program (PHP)

2004-03-16 Thread Jyry Kuukkanen
On Tue, 16 Mar 2004, Brent Clark wrote:

> I have to make use of embedded pdf files in my page (management decision, please 
> dont argue with me on this one, not my choice).
> I there a function or somthing to detect the presence of adobe reader to make sure 
> the client has it installed, before
> continuing with displaying it in the browser.
> I was thinking of trying to do a find the adobe.exe file, but I dont think that to 
> smart solution.

Hello

I understand you are planning to display a PDF file inside a browser, yes?

I believe it would be a security major risk if a server side script was 
able to list available applications on the client side. This may be 
possible with M$-script technology, but I would be very worried if it was 
possible with PHP. Please correct me if I talk nonsense...

Maybe a link to Adobe's Acrobat Reader download page is your best bet.


-- 
Regards,
--Jyry
C|:-(C|:-/C|8-OC|8-/C|:-(

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] help with storing multiple values in session variables.

2004-03-16 Thread Vimala S.P.


Yes encode() function worked perfectely fine.

-vimala/.


On Mon, 15 Mar 2004, Richard Davey wrote:

> Hello Vimala,
>
> Monday, March 15, 2004, 11:55:47 AM, you wrote:
>
> VSP> Is there any way of passing unicode strings properly with href and get?
>
> I'm 99% sure you can pass unicode strings by simply URL Encoding them
> (see urlencode) before appending to the query string. Try it and see?
>
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Printing landscape

2004-03-16 Thread Michael Nolan
Luis Mirabal wrote:
actually, you can control your printer, look:

http://www.php.net/manual/en/function.printer-set-option.php
you have to do:
$handle = printer_open();
printer_set_option ($handle,  PRINTER_ORIENTATION ,
PRINTER_ORIENTATION_LANDSCAPE);
printer_close($handle);
you've got many interesting options with this function.

( These functions are only available under Windows 9.x, ME, NT4 and 2000.
They have been added in PHP 4.0.4.)
As one of the comments rightly says: "Should be pretty obvious, but in 
case there is any confusion... The printer in question is one that is 
connected to the _server_, not the _client_."

Mike

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Raditha Dissanayake

Hi,

On a busy site (where the milliseconds start to matter) the chances
are that the operating system has your include files cached so the
load time is probably not a factor. If you install some of the php
token caching systems (zend and others) the speed is even better.

Gentlemen I do believe I have been misunderstood. What I meant was that 
there are ways in which you can save pounds perhaps by the bucketfull 
with possibly much less effort. For example I recently ran into a $1000 
software where the most commonly used query was running against a table 
that had a non-numeric primary key. This same key was being used in 
multiple joins. Surely that can be optimized to get a huge gain in 
performance?


As to using header and footer includes I found that system really
frustrating trying to follow the html. What I have switched to is
templates where the site layout is a template and each php page
generates the content and passes it one include file that does the
final mix. this way my html developer has control over the html and
can edit it as one file most of the time.
Processing templates also consumes  a bit of extra clock cycles.

--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 16 Mar 2004 10:00:10 -0000 Issue 2649

2004-03-16 Thread php-general-digest-help

php-general Digest 16 Mar 2004 10:00:10 - Issue 2649

Topics (messages 180493 through 180528):

Re: PHP Certification
180493 by: Rasmus Lerdorf
180497 by: Ryan A
180503 by: Richard Davey

Re: Regex help (SOLVED)
180494 by: Michal Migurski

Pear Package...
180495 by: Scott Fletcher
180498 by: Evan Nemerson
180499 by: Greg Beaver
180501 by: Scott Fletcher
180502 by: Scott Fletcher

Re: tracking emails
180496 by: Rob Adams
180500 by: Ryan A
180504 by: Rob Adams

current url function
180505 by: Luis Mirabal
180507 by: Marek Kilimajer
180508 by: Luis Mirabal
180509 by: Richard Davey

dbg extension...
180506 by: Luis Mirabal
180516 by: Tom Rogers

e - comerce website
180510 by: if02005.students.del.ac.id

Re: Problem with mkdir() under windows.
180511 by: Luis Mirabal

Re: Printing landscape
180512 by: Luis Mirabal
180527 by: Michael Nolan

Efficieny: Include vs Array vs Function
180513 by: Rob Paxon
180519 by: Raditha Dissanayake
180520 by: Rob Paxon
180522 by: Tom Rogers
180524 by: Rob Paxon
180528 by: Raditha Dissanayake

Re: windows 2003 server configuration
180514 by: Nadim Attari

Licensing System
180515 by: Jakes

Anyone Can Help Me?
180517 by: Harry
180521 by: Clifford W. Hansen

how do i detect the exsistens of a network printer?
180518 by: Shay

Presence of a program (PHP)
180523 by: Brent Clark
180525 by: Jyry Kuukkanen

Re: help with storing multiple values in session variables.
180526 by: Vimala  S.P.

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
On Mon, 15 Mar 2004, Sheeraz fazal wrote:
> I need information about the php certification, from www.expertrating.com .
> Does this site has good market reputation?
> Does www.php.net has some plans to introduce certification path?

No plans from us, no.  Running a certification program is a lot of work 
and I would prefer to see developers develop, not try to manage a 
certification program.

As for the www.expertrating.com thing?  Never heard of it.  If a resume 
crossed my desk with a reference to something like that on it I would 
probably chuckle and think the person got bilked out of the $9.95 it 
apparently costs.  It may of course be very good, I have no idea, I just 
don't hold certification programs in very high regard in general.

-Rasmus
--- End Message ---
--- Begin Message ---
Give a good graphics guy some $$ and he'll make you one of the best
certificates that your $$ can buy...that does not mean that you can actually
program in the language thats written on the certificate...

When I was learning computers I studied COBOL, Hated it and cant remember
crap about it now...not even 2 lines...but my (old) certificate says I'm
pretty good at it :-)

Basically it all comes down to how good you can actually prove yourself in
your field..certificates most of the time are not worth the paper they are
printed on but look good once you hang it on the wall ;-)

Just my $0.2

Cheers,
-Ryan

*
HI,

I need information about the php certification, from www.expertrating.com .
Does this site has good market reputation?
Does www.php.net has some plans to introduce certification path?

Comments welcome.

Thanks,
Sheri,

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Sheeraz,

Monday, March 15, 2004, 4:05:42 PM, you wrote:

Sf> I need information about the php certification, from www.expertrating.com .
Sf> Does this site has good market reputation?
Sf> Does www.php.net has some plans to introduce certification path?

Unless they are internationally and industry recognised like the
Novell, Cisco, Oracle or Microsoft certificates it's probably not
worth the money (if any?) involved in obtaining it. You would be
better off spending your time working on a solid portfolio that
showcases both sites AND code that you've written. If you already have
those then I don't see how that expertrating thing can hurt, but don't
bank on it holding too much sway.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
>Thanks to everyone who gave me examples, links and suggested alternatives
>like explode(), but personally I thought explode too was a regex..:-(.

explode() is not, split() is.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Robert Cummings
On Tue, 2004-03-16 at 05:11, Raditha Dissanayake wrote:
> 
> >> As to using header and footer includes I found that system really
> >> frustrating trying to follow the html. What I have switched to is
> >> templates where the site layout is a template and each php page
> >> generates the content and passes it one include file that does the
> >> final mix. this way my html developer has control over the html and
> >> can edit it as one file most of the time.
> >>
>
> Processing templates also consumes  a bit of extra clock cycles.

You assume run time processing of templates :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Raditha Dissanayake
Robert Cummings wrote:

On Tue, 2004-03-16 at 05:11, Raditha Dissanayake wrote:
 

As to using header and footer includes I found that system really
frustrating trying to follow the html. What I have switched to is
templates where the site layout is a template and each php page
generates the content and passes it one include file that does the
final mix. this way my html developer has control over the html and
can edit it as one file most of the time.
   

Processing templates also consumes  a bit of extra clock cycles.
   

You assume run time processing of templates :)
 

point conceded.

Cheers,
Rob.
 



--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Anyone Can Help Me?

2004-03-16 Thread colpete
Hello,

Put this in your httpd.conf


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Apache will know how to handle php scripts then.
This note is displayed at the end of make install.  Use scroll lock on your key
board to page up to see.  If you have to.

Pete

php4 and mysql instant messenger at http://dim.whorules.org  please join or down
load.  New release coming out soon!

Quoting Harry <[EMAIL PROTECTED]>:

> Hi Guys,
> 
> I'm a beginner on PHP and i just installed it on FreeBSD with apache. I
> already follow instructions at manual install then i create test file like
> test.php4 with .I browse to this file with IE but it can't
> display PHP info but when i brwose that file, it appears page with text " phpinfo() ?>.
> 
> Anyone can help me?
> Thanks
> 
> 





This message was sent using IMP, the Internet Messaging Program.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] current url function

2004-03-16 Thread Marek Kilimajer
Luis Mirabal wrote:

i checked http://sk2.php.net/manual/en/features.http-auth.php, but it doesnt
shows how to see if i passed user:pass in the url. i try
http://user:[EMAIL PROTECTED]/ and dumped globals, and there is nothing... any
ideas?
variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'], but it 
is not necessary anyways. the browser will remember credentials once 
they are set so it is useless to keep them in the url. and IE with the 
latest patch will ignore user:pass@ part.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Calculate

2004-03-16 Thread Tommi Virtanen
Hi!

How I can calculate following:

I have table:
id(int) start_date(date)end_date(date)
001 2004-03-10  2004-03-12
002 2004-03-27  2004-04-02
003 2004-04-05  2004-04-06
Total count of date is 12. But how I can calculate count of
date per month?
regards,

gustavus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Presence of a program (PHP)

2004-03-16 Thread Marek Kilimajer
Brent Clark wrote:

Hi there

I have to make use of embedded pdf files in my page (management decision, please dont 
argue with me on this one, not my choice).
I there a function or somthing to detect the presence of adobe reader to make sure the 
client has it installed, before
continuing with displaying it in the browser.
I was thinking of trying to do a find the adobe.exe file, but I dont think that to 
smart solution.
Look at javascript - navigator.plugins array. But I would not rely on 
it. one might have a pdf reader available without browser plugin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Regex help - PLease

2004-03-16 Thread Brent Clark
Hi there

im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to start 
with 100 and may not have any other kind of 
letters or  characters. Only numbers

for example 
10064893

Kind Regards
And thank you

Brent Clark


[PHP] Regex help - PLease

2004-03-16 Thread Brent Clark
Sorry I to should have added this
this is what im going with so far

preg_match(/\d100.*/);

Kind Regards
Brent Clark


Re: [PHP] Regex help - PLease

2004-03-16 Thread Richard Davey
Hello Brent,

Tuesday, March 16, 2004, 12:39:27 PM, you wrote:

BC> im in desperate need of help for a reg expression to ONLY allow 8
BC> NUMBERS to start with 100 and may not have any other kind of
BC> letters or characters. Only numbers

BC> for example 
BC> 10064893

It's not a reg exp, but it will work:

if (is_numeric($val) == FALSE || strlen($val) <> 8 || substr($val, 0,
3) !== "100")
{
// $val doesn't match
}

Conversely:

if (is_numeric($val) == TRUE && strlen($val) == 8 && substr($val, 0,
3) == "100")
{
// $val does match
}

(Code not tested, but you get the idea I hope)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regex help - PLease

2004-03-16 Thread Rob Ellis
On Tue, Mar 16, 2004 at 02:39:27PM +0200, Brent Clark wrote:
> Hi there
> 
> im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to start 
> with 100 and may not have any other kind of 
> letters or  characters. Only numbers
> 
> for example 
> 10064893
> 

if (preg_match('/^100\d{5}/', $test))
print "ok\n";

- rob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] yahoo route my mail's to bulk folder

2004-03-16 Thread Ali Ashrafzadeh
hi and thank's my friend's
in a web application I send mail message to members using mail() function in HTML 
format but yahoo mail server route my messages to bulk folder , I want know if  there 
is any setting requiered in my script to send mail correctly, PHPINFO() function 
return 
sendmail_from = [EMAIL PROTECTED]
sendmail_path = /usr/sbin/sendmail -t -i 
Path to sendmail = /usr/sbin/sendmail -t -i
I  send my mail useing function below:
please tell me if you know better method to send mime mail 
function send_mail($to,$subject,$message){

  $headers  = "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/html; charset=windows-1256\r\n";

  $headers .= "From: Me <[EMAIL PROTECTED]>\r\n";
  $headers .= "Return-path: Me <[EMAIL PROTECTED]>\r\n";
  $headers .= "Reply-To: Me <[EMAIL PROTECTED]>\r\n";
//  $headers .= "Bcc: $to \r\n";

  if (mail($to, $subject, $message, $headers))
print("$to Send Ok!");
  else
print("$to Send Problem!");
}
best regards


Re: [PHP] PHP Certification

2004-03-16 Thread joel boonstra
On Mon, Mar 15, 2004 at 09:05:42AM -0700, Sheeraz fazal wrote:
> I need information about the php certification, from www.expertrating.com .
> Does this site has good market reputation?

I took 10 minutes yesterday and checked out one of their free tests on
computer literacy or something like that.  The questions were poorly
worded, rife with misspellings, and had illogical choices.  Some choice
snippets:

  "This exam is best viewed using Internet Explorere 5.0 or above"
  
  Q1:  "You have a mouse attached to your computer which suddenly stops
working. You quickly replace the mouse with another one which has
been manufactured by a different company. Will it work?"

(my options are "yes" and "no".  "there is no way to make an
 accurate guess" is not an option)

  Q27: "If you are looking for information about a certain subject on
the Internet, what is the quickest way to get started?"

  Q?:  "Where is the Calculator located in the Windows Program menu?"

(my options were 4 different Windows menu paths)

You can be the judge based on that, I suppose.  If their PHP "exam" is
anything like this one, though, the final certification will mean
nothing except that you gave them $10.

-- 
[ joel boonstra | gospelcom.net ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] yahoo route my mail's to bulk folder

2004-03-16 Thread Jason Wong
On Tuesday 16 March 2004 20:39, Ali Ashrafzadeh wrote:

> in a web application I send mail message to members using mail() function
> in HTML format but yahoo mail server route my messages to bulk folder

There can be any number of reasons. None of them having anything to do with 
PHP. For the most authoritative answer ask Yahoo's customer services.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
There is no satisfaction in hanging a man who does not object to it.
-- G.B. Shaw
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] An extension to CREATE zips??

2004-03-16 Thread Lance Lovette
Did you try this class?

http://www.phpconcept.net/pclzip/index.en.php 

> Is there function library capable of creating zip files and
> adding files to a zip archive under the windows/apache
> platform? After some  extensive browsing I can only turn
> up read-only access functions.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Certification

2004-03-16 Thread Ryan A

On 3/16/2004 2:50:52 PM, joel boonstra ([EMAIL PROTECTED]) wrote:
> On Mon, Mar 15, 2004 at 09:05:42AM -0700, Sheeraz fazal wrote:
> > I need information about the php certification, from www.expertrating.
> com .
> > Does this site has good market reputation?
>
> I took 10 minutes yesterday and checked out one of their free tests on
> computer literacy or something like that.  The questions were poorly
> worded, rife with misspellings, and had illogical choices.  Some choice
> snippets:
>
> "This exam is best viewed using Internet Explorere 5.0 or above"
>
> Q1:
> "You have a mouse attached to your computer which suddenly stops
> working. You quickly replace the mouse with another one which has
> been manufactured by a different company. Will it work?"
>
> (my options are "yes" and "no".
> "there is no way to make an
> accurate guess" is not an option)
>
> Q27:
> "If you are looking for information about a certain subject on
> the Internet, what is the quickest way to get started?"
>
> Q?:  "Where is the Calculator located in the Windows Program menu?"
>
> (my options were 4 different Windows menu paths)
>
> You can be the judge based on that, I suppose.  If their PHP "exam" is
> anything like this one, though, the final certification


True...the only good thing is they are going after the dolts for only 10$,
with new users
coming on the net everyday they are trying their luck. I've seen a couple of
sites like this
top--sites being one...NO1 bastards& spammers as I wrote and told them,
there was also a
site "selling" the installation of OSCommerce for $450 !!

Cant really blame these guys for trying , but I doubt they will get many
people as a person who
goes for their "PHP exam" would know programming and computers...which will
tell them pretty
soon this is a scam.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Zen-cart

2004-03-16 Thread Ryan A
Hey everyone,
Been looking for a catalog cart system to sell purses online for a client
that is either cheap or free and plugs into
2checkout for payment processing.
Saw a few good ones via google,hotscrips etc that go via mals-e and others
before coming to zenCart (zen-cart.com)
its free, quite a few features, and (according to the site) easy to
customize the design...

Anybody have any idea if its any good? pros? cons? recomendations?

Thanks,
-Ryan A

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Changes in php.ini have no effect

2004-03-16 Thread Harry Sufehmi
(sorry if this post is a double for you, but I didn't get it and it doesn't exist in 
the archive - so I assume it was never posted before)

The following is a question that seems obvious, but somehow manages to elude me until 
today ...  :-}  hopefully someone here could point out my stupidity in this case.

Problem:
Changes made in c:\winnt\php.ini doesn't have any effect even after restarting Apache.

Steps tried:
# looking for other copies of php.ini - none found
# entering the related values in Apache's httpd.conf file instead - works for some 
values, but not for others.
# entering the related values in Apache's .htaccess file - doesn't work at all

PHP version: 4.3.3
phpinfo() output - http://www.harrysufehmi.com/inf.php

If you at the output of phpinfo(), it stated that the configurations were read from 
c:\winnt\php.ini - but it got several different config, such as:

# php is installed at c:\php\php-4.3.3\ --- not c:\php4
# extension_dir is set to c:\php\php-4.3.3\extensions\ in php.ini --- but phpinfo() 
says different things
# php_gd2.dll is enabled, but not according to phpinfo()

Any pointer will be very much appreciated.


Thanks,
Harry

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] db design path based

2004-03-16 Thread Age Bosma
Hi,

I'm trying to build a new db for a website and I've got an idea on how 
it should work but I can't seem to figure out what the best way would be 
if it comes to the design of the tables in the db.
Maybe I'm just looking at the the wrong way...

I would like to make the website completely db driven but path based.
TO get rid of the ugly uri's like 
index.php?pad=blaat&naar=sjips&bestand=opti I would like to use 
mod_rewrite so the same page can be accessed using 
www.domain.nl/blaat/sjips/opti. This part isn't realy a problem.

The problem is how should this be implemented in the db?
In the db the different levels have to be known so "sjips" is a 
subcategory of "blaat" and "opti" is a subcategory of "sjips" agian.
In the db the name of each category and page has to be stored.
This has the be easily extendable because at first there might not be a 
subcategory of a subcategory. Imo there shouldn't be a different column 
or table for each category to list it's subs, am I right?
What I could be is created a table with e.g. 3 columns, one containing 
an unique id for each category and page, one containing each unique name 
of that category of page and one column containing the id of its parent.
I'm not sure if this would be a good thing to do from a coding point of 
view because you have to contact the db multiple times to get all the 
information about on specific category or page, wouldn't you?

It look like a simple concept imo but it might be the lack of sleep not 
getting me think strait anymore...
Am I overlooking something?
Am I creating problems which aren't there?

Cheers,

Age

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Switching First & Last Names in List

2004-03-16 Thread Jeff Oien
If I have a list like this:
Firstname1 LastName1
Firstname2 Lastname2
etc.
I can split the names by \n to put them into
an array which will then be output into an 
list for a form. But how do I reverse the names
so that the last name is first? Also, how do I
handle people with three names? Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] db design path based

2004-03-16 Thread Jay Blanchard
[snip]
I'm trying to build a new db for a website 
[/snip]

Perhaps a db list would be good for this question?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [PHP-WIN] help with _PHP_SELF and changing a paramter in URL...

2004-03-16 Thread Firman Wandayandi
Hi Leo,

Actually I do this with preg_replace().

A code might like this:

--- begin code ---

// if url taken from browser url address
$querystring = $_SERVER['QUERY_STRING'];
$newurl = preg_replace('/(var1)=([0-9].*)&(.*)$/', '\1=20&\3',
$querystring );

// if url taken from string
$url = http://www.foo.com/test.php?var1=20&var2=10
list(, $querystring) = explode('?', $url);
$newurl = preg_replace('/(var1)=([0-9].*)&(.*)$/', '\1=20&\3',
$querystring );

--- end code ---

Good Luck,
Firman

- Original Message -
From: "Leo Divinagracia" <[EMAIL PROTECTED]>
Cc: "[PHP-WIN]" <[EMAIL PROTECTED]>
Sent: Tuesday, March 16, 2004 8:35 PM
Subject: [PHP-WIN] help with _PHP_SELF and changing a paramter in URL...


> sorry, it's late gotta get some sleep, but this had been stumping me...
>
> have to change a value in the URL, say:
>
> www.foo.com/test.php?var1=10&var2=10
>
> i want to make that a clickable link but set var1 = 20.  i'm getting
> tired so i may not be searching php.net correctly...
>
> would i EREGI_REPLACE it or some other way?
>
> the link i want to set it is
>
> www.foo.com/test.php?var1=20&var2=10
>
> thanks...
>
> --
> Leo G. Divinagracia III
> [EMAIL PROTECTED]
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Neil Freeman
Take a look at explode()

www.php.net/explode

Neil

Jeff Oien wrote:
***
This Email Has Been Virus Swept
***
If I have a list like this:
Firstname1 LastName1
Firstname2 Lastname2
etc.
I can split the names by \n to put them into
an array which will then be output into an 
list for a form. But how do I reverse the names
so that the last name is first? Also, how do I
handle people with three names? Thanks.
Jeff Oien
--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Switching First & Last Names in List

2004-03-16 Thread Jay Blanchard
[snip]
If I have a list like this:
Firstname1 LastName1
Firstname2 Lastname2
etc.
[/snip]

do the split or explode for each item ...

if(3 == count($arrayFoo)){
   echo "" . $arrayFoo[2] . " "  . $arrayFoo[1] . " "
. $arrayFoo[0] . "";
} else {
   echo "" . $arrayFoo[1] . " " . $arrayFoo[0] .
"";
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] db design path based

2004-03-16 Thread Age Bosma
Jay Blanchard wrote:

[snip]
I'm trying to build a new db for a website 
[/snip]
Perhaps a db list would be good for this question?
True, but I figured this php list would be a good place as well because 
it also comes down to programming problems that might occur. Also people 
who use php will be dealing with db's a lot as well.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Richard Davey
Hello Jeff,

Tuesday, March 16, 2004, 3:24:57 PM, you wrote:

JO> If I have a list like this:
JO> Firstname1 LastName1
JO> Firstname2 Lastname2
JO> etc.

JO> I can split the names by \n to put them into
JO> an array which will then be output into an 
JO> list for a form. But how do I reverse the names
JO> so that the last name is first? Also, how do I
JO> handle people with three names? Thanks.

";
print_r($names);

array_walk($names, 'swap');

print_r($names);
echo "";
?>

The echo and print_r lines are to show you what it has done.
The $raw_names should be your list of names.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] yahoo route my mail's to bulk folder

2004-03-16 Thread Miles Thompson
At 10:00 PM 3/16/2004 +0800, Jason Wong wrote:
On Tuesday 16 March 2004 20:39, Ali Ashrafzadeh wrote:

> in a web application I send mail message to members using mail() function
> in HTML format but yahoo mail server route my messages to bulk folder
There can be any number of reasons. None of them having anything to do with
PHP. For the most authoritative answer ask Yahoo's customer services.


Ali,

Jason is right - Yahoo will be authoritave. Nevertheless, could it be you 
are using bcc:? Or sending so much mail to Yahoo accounts that Yahoo has 
decided it's bulk?

Miles

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Reading a image resource

2004-03-16 Thread Ewout de Boer
Is there a function to get the raw image data from a image resource ?
(resource created by imagecreatefrom)

I want to read and manipulate an image from a file and store it in a
database without the use of a temp. file




regards,
Ewout

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Rasmus Lerdorf
If you are that concerned about it, "pear install apc".  Your include
files will be cached in memory and the only cost per include file is a
single stat() system call and looking up the opcode cache in shared
memory.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Ben Ramsey
This works rather nicely, too:


$name_array = array();
$temp_array = explode("\n", $list);
foreach ($temp_array as $name) {
$name_array[] = explode(" ", $name);
}
print_r($name_array);
?>
$name_array is now a multi-dimensional array with the first and last 
names separated.  print_r should show you the values.

Richard Davey wrote:
Hello Jeff,

Tuesday, March 16, 2004, 3:24:57 PM, you wrote:

JO> If I have a list like this:
JO> Firstname1 LastName1
JO> Firstname2 Lastname2
JO> etc.
JO> I can split the names by \n to put them into
JO> an array which will then be output into an 
JO> list for a form. But how do I reverse the names
JO> so that the last name is first? Also, how do I
JO> handle people with three names? Thanks.

$raw_names = "richard davey
susannah davey
jeff oien
willy three names
jack van-der-meet";
$names = explode("\n", $raw_names);

echo "";
print_r($names);
array_walk($names, 'swap');

print_r($names);
echo "";
?>
The echo and print_r lines are to show you what it has done.
The $raw_names should be your list of names.
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] images

2004-03-16 Thread Maxi Yedid
hello

I'm using the following function from the php manual (user's posts) and get
the following error.

What I do is upload a file from the user and save it in the server; that's
working fine; what I want is to save a copy of the file in thumbnail size.


-
function resampimagejpg($forcedwidth, $forcedheight, $sourcefile, $destfile,$imgcomp)
   {
   $g_imgcomp=100-$imgcomp;
   $g_srcfile=$sourcefile;
   $g_dstfile=$destfile;
   $g_fw=$forcedwidth;
   $g_fh=$forcedheight;

   if(file_exists($g_srcfile))
   {
   $g_is=getimagesize($g_srcfile);
   if(($g_is[0]-$g_fw)>=($g_is[1]-$g_fh))
   {
   $g_iw=$g_fw;
   $g_ih=($g_fw/$g_is[0])*$g_is[1];
   }
   else
   {
   $g_ih=$g_fh;
   $g_iw=($g_ih/$g_is[1])*$g_is[0];
   }
   $img_src=imagecreatefromjpeg($g_srcfile);
   $img_dst=imagecreate($g_iw,$g_ih);

   imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih,$g_is[0], 
$g_is[1]);
   imagejpeg($img_dst, $g_dstfile, $g_imgcomp);
   imagedestroy($img_dst);
   return true;
   }
   else
   return false;
   }
--
** This is where I call the function:

  $archivo = $forma['imagen']['tmp_name'];
  echo("File Uploaded Information: " . $archivo . "");

  if(is_uploaded_file($archivo)) {
   $directo = "/home/public_html/img_products/";
   $archivito = $directo . $forma['imagen']['name'];

   $archivote = "/home/public_html/img_small_products/" .
$forma['imagen']['name'];  //

   echo "" . $archivito . "";
move_uploaded_file($forma['imagen']['tmp_name'],$archivito) ;

   resampimagejpg(100, 100, $archivito, $archivote, 0);
<<<= Here I call the function

--

This is the error I get:

Warning: imagejpeg(): Unable to open '/home/public_html/img_small_products/A2_6.jpg' 
for writing in /home/public_html/admin/products.php on line 286

any idea? Thanks!

max



Re: [PHP] Regex help - PLease

2004-03-16 Thread Pablo
On 03/16/2004 6:57 AM, Rob Ellis <[EMAIL PROTECTED]> wrote:

> On Tue, Mar 16, 2004 at 02:39:27PM +0200, Brent Clark wrote:
>> Hi there
>> 
>> im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to
>> start with 100 and may not have any other kind of
>> letters or  characters. Only numbers
>> 
>> for example 
>> 10064893
>> 
> 
> if (preg_match('/^100\d{5}/', $test))
> print "ok\n";

Unless you want to allow something like '10064893A' to match, use:

preg_match('/^100\d{5}$/', $test)

Pablo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] dbg extension...

2004-03-16 Thread Luis Mirabal
yes, i found that the extension functions only works in debug sessions, so i
replaced it by Xdebug, it is very cool, i recommend it!
http://www.xdebug.org/

luis.

"Tom Rogers" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi,
>
> Tuesday, March 16, 2004, 9:51:46 AM, you wrote:
> LM> hey guys, i have a question on dbg extension, i want to get debug
details
> LM> using the functions from php, ie. dbg_get_profiler_results, but they
return
> LM> nothing... i am developing on windows using apache and php 4.3, any
> LM> suggestions?
>
>
> You probably have to trigger the debugger by doing something like
> this:
>
> http://domain.com/test.php?DBGSESSID=123456
>
> --
> regards,
> Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] db design path based

2004-03-16 Thread Raditha Dissanayake

True, but I figured this php list would be a good place as well 
because it also comes down to programming problems that might occur. 
Also people who use php will be dealing with db's a lot as well.

Jay is right. This list is supposed to answer only questions like  my 
php code that queries a mysql db returned the following error... etc.



--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Ben Ramsey
>> JO> so that the last name is first? Also, how do I
>> JO> handle people with three names? Thanks.
I missed this part, so here's my take with the solution I provided (I'm 
including the print-out of the  tags):

foreach ($name_array as $person) {
$lastname_element = count($person) - 1; //index of last element
echo "" . $person[$lastname_element] . ", ";
echo $person[0] . "\n"; //zero (0) is the first name
}
Ben Ramsey wrote:

This works rather nicely, too:


$name_array = array();
$temp_array = explode("\n", $list);
foreach ($temp_array as $name) {
$name_array[] = explode(" ", $name);
}
print_r($name_array);
?>
$name_array is now a multi-dimensional array with the first and last 
names separated.  print_r should show you the values.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] Switching First & Last Names in List

2004-03-16 Thread Richard Davey
Hello Ben,

Tuesday, March 16, 2004, 4:16:01 PM, you wrote:

BR> This works rather nicely, too:
[snip]
BR> $name_array is now a multi-dimensional array with the first and last
BR> names separated.  print_r should show you the values.

It doesn't reverse the name (as required), which although you could
say "give me element 1 of each array to get the lastname", this doesn't
work with names such as "firstname middlename lastname" (like the OP
requested) :) because now the lastname is in element 2 so you'll have
to do some extra checking malarky to get it.

But yeah, there are a few million ways to skin this cat.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Calculate

2004-03-16 Thread Luis Mirabal
from sql?? if you are doing:

select ... count(date) ...from ... where ...

do:

select ... count(date) ...from ... where ... group by date

luis.

"Tommi Virtanen" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi!
>
> How I can calculate following:
>
> I have table:
> id(int) start_date(date) end_date(date)
> 001 2004-03-10 2004-03-12
> 002 2004-03-27 2004-04-02
> 003 2004-04-05 2004-04-06
>
> Total count of date is 12. But how I can calculate count of
> date per month?
>
> regards,
>
> gustavus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Switching First & Last Names in List

2004-03-16 Thread Richard Davey
Hello Ben,

Tuesday, March 16, 2004, 4:24:12 PM, you wrote:

BR> I missed this part, so here's my take with the solution I provided (I'm
BR> including the print-out of the  tags):

Heh :) just as I posted about it too.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
On Tue, Mar 16, 2004 at 02:35:57PM +0200, Tommi Virtanen wrote:
> How I can calculate following:
> 
> I have table:
> id(int)   start_date(date)end_date(date)
> 001   2004-03-10  2004-03-12
> 002   2004-03-27  2004-04-02
> 003   2004-04-05  2004-04-06
> 
> Total count of date is 12. But how I can calculate count of
> date per month?
> 
> regards,

I'm assuming this is in a MySQL table.  Is that correct?  This is
probably something that will better be answered on a MySQL list.

Assuming that it is MySQL, how are you deciding which month an item is
in?  What if it starts in March and ends in April?  Should it be
considered to be in March or April?

MySQL's COUNT[1], GROUP BY[2], and DATE_FORMAT[3] will be helpful to you.
Something like:

  SELECT COUNT(*) AS num, DATE_FORMAT(end_date, "%Y-%m") AS yearmonth
FROM yourtable 
GROUP BY yearmonth 
ORDER BY num;

might work[4].

[1] http://www.mysql.com/doc/en/GROUP-BY-Functions.html#IDX1452
[2] http://www.mysql.com/doc/en/SELECT.html
[3] http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1341
[4] This query assumes that end_date is sufficient to determine which
month something is "in".  Also, it relies on some potentially
MySQL-specific syntax.

joel

-- 
[ joel boonstra | gospelcom.net ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] e - comerce website

2004-03-16 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, March 15, 2004 6:08 PM said:

> Hai..

hi.

> I have a homework from my scholl. We must make a simple website of e
> - comerce use php. I just still confuse to use the session in this
> work. And I must make a different page for a administrator that have
> a full access and a just user. But I still don't know how to make it.
> There is an order and a checkout if we want to leave the website.
> Please help me, I just have time 1 week to finish it.

well i can't do your homework for you and you didn't ask any specific
questions so i'm not sure where to start. what exactly are you having a
problem with?



chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Chris W. Parker
Rob Paxon 
on Monday, March 15, 2004 9:24 PM said:

> Bear with me while I dish out some details.  My question concerns the
> efficiency of using multiple file includes versus storing segments of
> data in one include as arrays or functions.

have you considered the size of your includes? maybe cutting the size
down by splitting them into more concise files would help? in this way
you could more precisely include what you needed and leave the rest out.

just a thought.


chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Jason Sheets
> Rob Paxon 
>on Monday, March 15, 2004 9:24 PM said:
>
>> Bear with me while I dish out some details.  My question concerns the
>> efficiency of using multiple file includes versus storing segments of
>> data in one include as arrays or functions.
>
> have you considered the size of your includes? maybe cutting the size
> down by splitting them into more concise files would help? in this way
> you could more precisely include what you needed and leave the rest
> out.

Sometimes having less included files with more content is more efficient
than having a lot of small files, an example would be making a seperate
include for each function, this has its advantages especially in smarty's
case but can be inefficient because you must fetch each file from disk which
has overhead.

I'd suggest profiling your code, use the PEAR Benchmark class and use PHP's
memory usage functions to determine what parts of your code are consuming
the most resources and taking the longest amount of time to execute, then
try some experiments and profile each experiment to determine the most
efficient solution.

Different versions of PHP, different application frameworks, and
applications in general will respond to optimization techniques differently,
for example there is little sense in spending 40 hours optimizing variable
usage in a program to increase performance when 75% of the program is
database server bound, your time would be better spent optimizing the SQL.

In my commericial websites I have modified my application framework not to
connect to the database, start output buffering, start the session and do
other overhead if specific constants are declared.  For example if I have
contact.php that does some mailing stuff and requires Smarty I can define
TEMPLATE_ONLY and only templating related files will be included and
initialized.

Doing this optmization made pages roughly 50% faster that did not require
session or a database connection and also reduces the load on the sql server
because you are not connecting unless you actually need the connection and
still benefit from having a single connection call instead of connecting in
each function or file.

>
> just a thought.
>
>
> chris.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calculate

2004-03-16 Thread Jason Davidson


joel boonstra <[EMAIL PROTECTED]> wrote:
> 
> On Tue, Mar 16, 2004 at 02:35:57PM +0200, Tommi Virtanen wrote:
> > How I can calculate following:
> > 
> > I have table:
> > id(int) start_date(date)end_date(date)
> > 001 2004-03-10  2004-03-12
> > 002 2004-03-27  2004-04-02
> > 003 2004-04-05  2004-04-06
> > 
> > Total count of date is 12. But how I can calculate count of
> > date per month?
> > 
> > regards,
> 
> I'm assuming this is in a MySQL table.  Is that correct?  This is
> probably something that will better be answered on a MySQL list.
> 
> Assuming that it is MySQL, how are you deciding which month an item is
> in?  What if it starts in March and ends in April?  Should it be
> considered to be in March or April?
> 
> MySQL's COUNT[1], GROUP BY[2], and DATE_FORMAT[3] will be helpful to you.
> Something like:
> 
>   SELECT COUNT(*) AS num, DATE_FORMAT(end_date, "%Y-%m") AS yearmonth
> FROM yourtable 
> GROUP BY yearmonth 
> ORDER BY num;
> 
> might work[4].
> 
> [1] http://www.mysql.com/doc/en/GROUP-BY-Functions.html#IDX1452
> [2] http://www.mysql.com/doc/en/SELECT.html
> [3] http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1341
> [4] This query assumes that end_date is sufficient to determine which
> month something is "in".  Also, it relies on some potentially
> MySQL-specific syntax.
> 
> joel
> 
> -- 
> [ joel boonstra | gospelcom.net ]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
Hi All,

 

I have a function that gets a single field from a mssql db. That field
contains data that is then parsed out to represent a survey's results.

 

The function;

function quesresults(){

$query = "SELECT sur_ans

   FROM au_survey";

$result = MSSQL_QUERY($query) or die("Can not execute query
$query. ");

$row = mssql_fetch_array($result);

$thearray = explode('__', $row); - This is line 40

$i = 1;

foreach($thearray as $topelement){

foreach(explode('--', $topelement) as $element){

echo $element;

echo "";

}

echo "question $i"; 

echo "";

$i++;

}

}

 

When I call the function I get;

Notice: Array to string conversion in \WWW\mypath\srvyclass.inc.php on line
40
Array
question 1

 

What am I missing?

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Re: objects in session

2004-03-16 Thread Justin Patrin
Marc Serra wrote:

Hi,

I got problem when i want to save object in session.

 

I got my first page when I create my object and save it to session:

 



Require 'test.inc.php';

Session_start();

 

$test = new test();

$test->Load($_Get['id']);

$_SESSION['save'] = $test;

?>

 

In my second page I want to retrieve my object



 

Require 'test.inc.php';

Session_start();

echo get_class($_SESSION['test']);

?>

 

When I do get_class($_SESSION['test']); I got the message
"__PHP_Incomplete_Class" instead of "test"
 

Can you explain me where I can have made an error.

 

What's going on here is that you haven't redefined your class for PHP in 
the second page. When PHP saves your object, it saves only its data, not 
its functions and such. Are you sure you're defining your object 
correctly? Have you tried instantiating a test() object in the second page?

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Web based php development tool

2004-03-16 Thread Justin Patrin
Joseph Ross Lee wrote:

Anybody here who could recommend a web based php dev tool for editing php
sources online? Thanks! I'm having a hard time finding a nice one. Thanks in
advance guys!
I have a simple php-based online text editor (which deals with 
directories and such) if you'd like to take a look at it. It doesn't 
have ANY fancy editing features, just text editing. It does allow for 
lots of file manipulation, though. ;-)

Then again, you might be able tof find something much better E-mail 
me if you'd like a copy.

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Array to String conversion error

2004-03-16 Thread Chris W. Parker
Alex Hogan 
on Tuesday, March 16, 2004 9:48 AM said:

> $row = mssql_fetch_array($result);
> 
> $thearray = explode('__', $row); - This is line 40

$row is an entire array. you don't explode an entire array, you only
explode the contents of an element of an array.

print_r($row) will give you some clues.

you'll need to access a specific element within the array. like:

$thearray = explode('__', $row[0][0]);

> What am I missing?

unless i'm wrong, the above.



chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] array $_POST problem

2004-03-16 Thread Joey Kelly
Hello,

I have a SuSE 9.0 Linux server running PHP and Apache2 (my phpinfo() data is 
at http://redfishnetworks.com/~jkelly/test.php), and my problem is this:

I've got a sticky problem that I need to solve. I've just turned on 
register_globals in my PHP php.ini file, and therefore have to run my form 
variables through $_POST:

$variable = $_POST[$variable];
echo $variable;

The problem I'm having is that the script Im trying to refactor worked great 
before I turned register_globals off. The script posts an array, and I can't 
seem to figure out how to $_POST the array.

Here is the script with register_globals OFF (this is on my old server, by the 
way, running SuSE 7.3), as you can see the script works fine with 
register_globals off:
http://joeykelly.net/materials.php

Here is the script with register_globals ON:
http://redfishnetworks.com/~jkelly/materials.php
Notice the huge nested array at the bottom when you click [SUBMIT]? That's my 
trouble.

In both cases, changing the extension from .php to .phps shows you the source 
code. As you can see, above the form I've tried several attempts to access 
the data, all of which seem to fail.

My question: What am I doing wrong? I suspect that I'm having trouble with 
nested arrays, etc.. The thing that bothers me is that the data is available 
(see the array printout at the bottom?).

If I can't make this work, I'm going to have to resort to munging a bunch of 
scalars ($quantity1, $quantity2, etc.), which to me is an awful kludge that 
I'd rather not sign my name to.

Thanks for any help.




-- 


Joey Kelly
< Minister of the Gospel | Linux Consultant >
http://joeykelly.net


"I may have invented it, but Bill made it famous."
 --- David Bradley, the IBM employee that invented CTRL-ALT-DEL

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: behind the scenes coding?

2004-03-16 Thread Justin Patrin
Dustin Wish With Indco Networks wrote:

 

I have been looking everywhere for any tips or tutorials on posting to
separate websites and parsing the return values for input into a mysql db.
I understand parsing html pages, but not how to post to a form on a
different site and once the values are returned parse and redirect. I have
read alittle about using CURL to perform some of this, but no real help
there. 

 

I need to post to a login script, then once the page is processed, I will
parsed the returned page for the data. any help please?
 
Try PEAR::HTTP_Client
http://pear.php.net/package/HTTP_Client
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] array $_POST problem

2004-03-16 Thread Richard Davey
Hello Joey,

Tuesday, March 16, 2004, 6:16:34 PM, you wrote:

JK> I have a SuSE 9.0 Linux server running PHP and Apache2 (my phpinfo() data is
JK> at http://redfishnetworks.com/~jkelly/test.php), and my problem is this:

JK> I've got a sticky problem that I need to solve. I've just turned on
JK> register_globals in my PHP php.ini file, and therefore have to run my form
JK> variables through $_POST:

If you don't know in what way PHP sends the POST data, then the best
solution is simply to view it:

";
  print_r($_POST);
  echo "";
?>

(Or you can var_dump the whole thing)

By looking at the structure like this you'll soon see how to access
the values inside of it rather than second-guessing all the time.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] array $_POST problem

2004-03-16 Thread Chris W. Parker
Joey Kelly 
on Tuesday, March 16, 2004 10:17 AM said:

> The problem I'm having is that the script Im trying to refactor
> worked great before I turned register_globals off. The script posts
> an array, and I can't seem to figure out how to $_POST the array.

the script posts an array, and you can't figure out how to $_POST the
array?



> Here is the script with register_globals OFF (this is on my old
> server, by the way, running SuSE 7.3), as you can see the script
> works fine with register_globals off:
> http://joeykelly.net/materials.php

why don't you just turn register_globals off again?




chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] array $_POST problem

2004-03-16 Thread Chris Boget
You're the Joey Kelly who runs the LUG in NoLA, yes?

> I've got a sticky problem that I need to solve. I've just turned on
> register_globals in my PHP php.ini file, and therefore have to run my form
> variables through $_POST:
> $variable = $_POST[$variable];
> echo $variable;

Or you can use extract();

> The problem I'm having is that the script Im trying to refactor worked
great
> before I turned register_globals off. The script posts an array, and I
can't
> seem to figure out how to $_POST the array.

It seems like the array is posted just fine.

> In both cases, changing the extension from .php to .phps shows you the
source
> code. As you can see, above the form I've tried several attempts to access
> the data, all of which seem to fail.

How is it failing?  Looking at the source, you are definitely on the right
track.

> My question: What am I doing wrong? I suspect that I'm having trouble with
> nested arrays, etc.. The thing that bothers me is that the data is
available
> (see the array printout at the bottom?).

Upon post, you need to get materials as such:

$materials = &$_POST['materials'];

to list out the quantity, you can do any the following:

foreach( $materials['quantity'] as $quantity ) {
  echo $quantity . '';
}
foreach( $materials['description'] as $description ) {
  echo $description . '';
}

for( $i = 0; $i < 5; $i++ ) {
  echo $materials['description'][$i] . '::' . $materials['quantity'][$i] .
'';
}

Personally, I'd rename your form elements to:

$materials[$item][quantity]
$materials[$item][price]
$materials[$item][description]

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Changes in php.ini have no effect

2004-03-16 Thread Ford, Mike [LSS]
On 16 March 2004 15:10, Harry Sufehmi wrote:

> Problem:
> Changes made in c:\winnt\php.ini doesn't have any effect even after
> restarting Apache. 
> 
> Steps tried:
> # looking for other copies of php.ini - none found
> # entering the related values in Apache's httpd.conf file
> instead - works for some values, but not for others.
> # entering the related values in Apache's .htaccess file - doesn't
> work at all 
> 
> PHP version: 4.3.3
> phpinfo() output - http://www.harrysufehmi.com/inf.php
> 
> If you at the output of phpinfo(), it stated that the
> configurations were read from c:\winnt\php.ini

No, it actually states:

Configuration File (php.ini) Path  C:\WINNT

which means that it's looking in C:\WINNT for your php.ini file, but hasn't
found one -- if it found a php.ini there, that line would have read:

Configuration File (php.ini) Path  C:\WINNT\php.ini

As you're on Windows, my guess is that the old hidden extension trick is in
play and you've actually got a file called something like php.ini.txt -- try
turning off the Windows option that hides recognised extensions, and taking
another look.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
> $row is an entire array. you don't explode an entire array, you only
> explode the contents of an element of an array.
> 
> print_r($row) will give you some clues.
> 
> you'll need to access a specific element within the array. like:
> 
> $thearray = explode('__', $row[0][0]);

That was it... Thanks Chris.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] mappath and unmappath function

2004-03-16 Thread Luis Mirabal
does someone knows a function to map a server path to a fs path, and a
function that does the inverse? i mean, if you have /var/www/html/script and
applies function unmappath, it returns /script and if apply mappath to
/script it returns /var/www/html/script. somebody has something like this?

thanx
luis.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mappath and unmappath function

2004-03-16 Thread Jay Blanchard
[snip]
does someone knows a function to map a server path to a fs path, and a
function that does the inverse? i mean, if you have /var/www/html/script
and
applies function unmappath, it returns /script and if apply mappath to
/script it returns /var/www/html/script. somebody has something like
this?


Start here http://us3.php.net/dirname

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Changes in php.ini have no effect

2004-03-16 Thread Harry Sufehmi

On 16/03/2004 at 18:18 Ford, Mike [LSS] wrote:
>On 16 March 2004 15:10, Harry Sufehmi wrote:
>> Problem:
>> Changes made in c:\winnt\php.ini doesn't have any effect even after
>> restarting Apache.
>>
>> PHP version: 4.3.3
>> phpinfo() output - http://www.harrysufehmi.com/inf.php
>>
>> If you at the output of phpinfo(), it stated that the
>> configurations were read from c:\winnt\php.ini
>
>No, it actually states:
>Configuration File (php.ini) Path  C:\WINNT
>which means that it's looking in C:\WINNT for your php.ini file, but hasn't
>found one -- if it found a php.ini there, that line would have read:
>Configuration File (php.ini) Path  C:\WINNT\php.ini
>As you're on Windows, my guess is that the old hidden extension trick is in
>play and you've actually got a file called something like php.ini.txt --

Good one but I just checked (from command prompt) and indeed php.ini is there (not 
php.ini.txt), double-checked as well just to make sure.

Thanks for the reply anyway.



Thanks,
Harry


--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya

v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP]

2004-03-16 Thread James E Hicks III
How do I get this to work? the input box is only showing 

He said, 





James Hicks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ?=

2004-03-16 Thread Frank M. Kromann
Asuming the content is generated by php, take a look at htmlentities().
http://php.net/htmlentities

- Frank

> How do I get this to work? the input box is only showing 
> 
> He said, 
> 
>  frown" size="50">
> 
> 
> 
> James Hicks
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Vail, Warren


Warren Vail



-Original Message-
From: James E Hicks III [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 


How do I get this to work? the input box is only showing 

He said, 





James Hicks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Chris W. Parker
James E Hicks III 
on Tuesday, March 16, 2004 11:08 AM said:

>  with a frown" size="50">

i came across this same problem recently. http://php.net/htmlentities

" becomes "



chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Jay Blanchard
[snip]
How do I get this to work? the input box is only showing 

He said, 


[/snip]

Escape the quotes.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Jay Blanchard
[snip]
Escape the quotes.
[/snip]

How about addslashes() and stripslashes() ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Changes in php.ini have no effect

2004-03-16 Thread Ford, Mike [LSS]
On 16 March 2004 19:01, Harry Sufehmi wrote:

> On 16/03/2004 at 18:18 Ford, Mike [LSS] wrote:
> > On 16 March 2004 15:10, Harry Sufehmi wrote:
> > > Problem:
> > > Changes made in c:\winnt\php.ini doesn't have any effect even
> > > after restarting Apache. 
> > > 
> > > PHP version: 4.3.3
> > > phpinfo() output - http://www.harrysufehmi.com/inf.php
> > > 
> > > If you at the output of phpinfo(), it stated that the
> > > configurations were read from c:\winnt\php.ini
> > 
> > No, it actually states:
> >Configuration File (php.ini) Path  C:\WINNT
> > which means that it's looking in C:\WINNT for your php.ini file,
> > but hasn't found one -- if it found a php.ini there, that line
> >would have read: Configuration File (php.ini) Path 
> > C:\WINNT\php.ini 
> > As you're on Windows, my guess is that the old hidden extension
> > trick is in play and you've actually got a file called something
> > like php.ini.txt -- 
> 
> Good one but I just checked (from command prompt) and
> indeed php.ini is there (not php.ini.txt), double-checked as
> well just to make sure.

H'm!  Permissions problem?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Vail, Warren
how about

http://www.php.net/manual/en/function.htmlspecialchars.php

not quite as stringent as

http://www.php.net/manual/en/function.htmlentities.php

Warren Vail


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:21 AM
To: Jay Blanchard; James E Hicks III; [EMAIL PROTECTED]
Subject: RE: [PHP] 


[snip]
Escape the quotes.
[/snip]

How about addslashes() and stripslashes() ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
On Tue, Mar 16, 2004 at 09:43:28AM -0800, Jason Davidson wrote:
> Most likely im not understanding your question.. but, if you are trying
> to calculate the total rows by month..
> SELECT whatever FROM table WHERE MONTH(your_date) = '03';
> 
> and use num_rows or row_count or whatever the php mysql function is

I didn't post the original message; I was responding to Tommi, who asked
about calculating the "count of date per month".

Your method will have all rows returned to PHP, and require PHP to count
the rows afterward.  If you would do this:

  SELECT COUNT(whatever) FROM table WHERE MONTH(your_date) = '03';

then your result set will only have one row (the number of matching
rows), and you don't need to do any additional counting work.

However, all of that is for the OP, not for me, so I'm CCing the list
back in.

-- 
[ joel boonstra | gospelcom.net ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Chris W. Parker
Vail, Warren 
on Tuesday, March 16, 2004 11:14 AM said:

>  work?\", with a
> frown" size="50">

escaping does not work.


chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Hidayet Dogan
Replacing with " HTML entitiy may be enough.

For ex:

";
?>
Or 

Good luck,
 Hidayet Dogan
  [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
--
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

On Tue, 16 Mar 2004, Chris W. Parker wrote:

> Vail, Warren 
> on Tuesday, March 16, 2004 11:14 AM said:
>
> >  > work?\", with a
> > frown" size="50">
>
> escaping does not work.
>
>
> chris.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Vail, Warren
Ahh, because it's raw html and not in php.

one choice would be to encapsulate it within php

" size="50">

or

" size="50">

or stay with RAW HTML and use the correct 



Warren Vail


-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:55 AM
To: Vail, Warren; James E Hicks III; [EMAIL PROTECTED]
Subject: RE: [PHP] 


Vail, Warren 
on Tuesday, March 16, 2004 11:14 AM said:

>  work?\", with a
> frown" size="50">

escaping does not work.


chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] local (config) value not overriding master

2004-03-16 Thread Fredrik de Vibe
Hi

On the system I'm working on atm, php is set up with a non-modifiable
php.ini, but I can make php config changes in httpd.conf. The changes
I make are reflected in the "local value" row in the output from
phpinfo() while the values from php.ini are in the "master value" row.

This seemed to be working fine until I tried to override the
disable_functions value. The master value has ini_set disabled, I have
removed it from the local value's disabled_functions (phpinfo() agrees
on this), but I still can't use ini_set (it is still disabled).

I might be missing something important here (probably am), but I can't
see why (tried googling and going through the docs, but I couldn't see
any reference to this). Can anybody shed some light here?

Thanks in advance.


-- 
- Fredrik

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] determine logged in user

2004-03-16 Thread Ashley
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.

Thanks in advance,
Ashley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] determine logged in user

2004-03-16 Thread Jay Blanchard
[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] determine logged in user

2004-03-16 Thread Ashley
This is not what I am looking for.  I do not want a username/password 
dialog box.  I want it to determine the username from who is logged into 
the computer and not to prompt for a username and password.  I already 
knew how to generate a dialog box for this, but I want this to be done 
behind the scenes.

Ashley

Jay Blanchard wrote:

[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Sessions - One Server, Many Terminals

2004-03-16 Thread Damon Abilock
I'm having a problem related to PHP sessions in a school computer lab
environment.  I have a script that uses sessions to keep track of a user and
their work on the system.  It is being used by a school in a computer lab in
which the students just have terminals -- they all access the same server
computer to run programs and do not have hard drives of their own.  They are
running software called "ClassLink" (see www.classlink2000.com) in this lab
(I'm not sure if that is really an important detail or not).

The problem is that everyone that students accessing the script on these
different terminals start seeing eachother's work, which implies that the
session information is not unique to each terminal (I expect that if I
printed out the session ID on all of these different terminals, they would
all be the same).

Is there anything that I can do about this?  How do I get my script to
recognize that it is being accessed by different terminals, even though it
is really only one physical computer (the server that all of these terminals
have a view into)?  Is there any other solution?

Cheers,
Damon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] determine logged in user

2004-03-16 Thread Justin Patrin
Ashley wrote:

This is not what I am looking for.  I do not want a username/password 
dialog box.  I want it to determine the username from who is logged into 
the computer and not to prompt for a username and password.  I already 
knew how to generate a dialog box for this, but I want this to be done 
behind the scenes.

Ashley

Jay Blanchard wrote:

[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth
Try looking in the $_ENV array. Might be in there.

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: determine logged in user

2004-03-16 Thread Rob Adams
"Ashley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can PHP determine the username of the person currently logged into a
> Windows 2K machine?

On the machine running the client (web browser) or the machine running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote the
username to a file that PHP read.  I can't really think of a clean way of
doing it.

  -- Rob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]
Can PHP determine the username of the person currently logged into a
Windows 2K machine?
[snip]
On the machine running the client (web browser) or the machine running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote the
username to a file that PHP read.  I can't really think of a clean way of
doing it.
[snip]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Thanks for the info guys.  I guess that I will just make a login screen 
of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?
[snip]

On the machine running the client (web browser) or the machine running 
the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote 
the
username to a file that PHP read.  I can't really think of a clean way of
doing it.
[snip]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login screen 
of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?


[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.


[snip]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?


[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.


[snip]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
Here you go:

http://marc.theaimsgroup.com/?l=php-dev&m=107732506523441&w=2

Have fun,
   red
Ashley wrote:

Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info 
which
are saved in the enviroment to the server to make sure the user is 
known
by the server as well.

Another way could be to check wether the REMOTE_ADDR has 
authentificated
to the samba-server within a spec. timespan.

Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?




[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.




[snip]





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Thanks for the pointer, I will see what I can do with it.  This is 
actually the same scenario that I am in.

Ashley

Red Wingate wrote:

Here you go:

http://marc.theaimsgroup.com/?l=php-dev&m=107732506523441&w=2

Have fun,
   red
Ashley wrote:

Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you 
run
a bash script ( on autostart for example ) and pass the login-info 
which
are saved in the enviroment to the server to make sure the user is 
known
by the server as well.

Another way could be to check wether the REMOTE_ADDR has 
authentificated
to the samba-server within a spec. timespan.

Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?




[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.




[snip]






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Apache directive to "expand unqualified host names"?

2004-03-16 Thread Phil Frisbie, Jr.
Matt wrote:

Hello,

I am looking for an Apache directive to automatically expand an
unqualified host name in a web browser client.  Here's an example of
what I mean by this:
User, in web browser, enters (these are all hypothetical examples):

http://automobiles/trucks/

 actually fully qualifies to
.  I want the Apache server to convert
the text entered above to the following once the browser loads the web
page:
http://automobiles.transportation.com/trucks/

I understand that one can configure an Apache server to do this,
probably with an Apache directive?  If so, which one?
Is this on an Intranet where you would resolve 'automobiles' to an IP address?

Thanks for any help,
-Matt
--
Remove the obvious text (including the dash) to email me.
--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Optimise two mysql queries to one query

2004-03-16 Thread dr. zoidberg
Hello,

$a = mysql_query("Select a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Select * FROM t WHERE subcategory=$x")
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.

TNX

--
Please do not CC me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Optimise two mysql queries to one query

2004-03-16 Thread Justin Patrin
Dr. Zoidberg wrote:

Hello,

$a = mysql_query("Select a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Select * FROM t WHERE subcategory=$x")
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.

TNX

SELECT p.a AS pa, p.b AS pb, c.a AS ca, c.b AS cb
FROM t AS p LEFT JOIN t AS c ON c.subcategory = p.a
WHERE p.category=1
ORDER BY p.category
This should give you what you want, but the two queries might be better 
speed wise

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re:

2004-03-16 Thread Ligaya Turmelle
try the escape character (\).  Note the previous question from "Character
question" by David Westbrooks.  Posted on 3/13/04.

Respectfully,
Ligaya Turmelle

"James E Hicks III" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How do I get this to work? the input box is only showing
>
> He said,
>
>  frown" size="50">
>
>
>
> James Hicks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re:

2004-03-16 Thread Chris W. Parker
Ligaya Turmelle 
on Tuesday, March 16, 2004 2:28 PM said:

> try the escape character (\).  Note the previous question from
> "Character question" by David Westbrooks.  Posted on 3/13/04.

escaping html does not work. note the previous ten+ messages that came
through before yours in this thread. posted on 3/15/04.



chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re:

2004-03-16 Thread Justin Patrin
Ligaya Turmelle wrote:

try the escape character (\).  Note the previous question from "Character
question" by David Westbrooks.  Posted on 3/13/04.
Respectfully,
Ligaya Turmelle
"James E Hicks III" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
How do I get this to work? the input box is only showing

He said,

a

frown" size="50">



James Hicks
Why are so many people telling this poor person to escape their quotes? 
That WILL NOT WORK in HTML. The correct way to do this is to use 
htmlspecialchars() or htmlentities(). In fact, this should always be 
done on dynamic values in an input or any other HTML data that should be 
displayed literally, such as for within textareas.

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread memoimyself
Damon,

Sessions have to do with requests being sent by browsers to the web server. Each time 
you close all the windows of your browser on your computer and start the browser 
again, a new session is started. I suspect that since all your users are essentially 
using 
the same web browser (since their monitors and keyboards are not really separate 
computers, but peripherals on the same machine), a browser window open on one 
terminal is keeping alive a session started by another user on another terminal when 
she or he first started the browser. Does that make sense? Anyway, if that's your 
case, 
then I don't believe there's anything that can be done.

Erik


On 16 Mar 2004 at 13:04, Damon Abilock wrote:

> I'm having a problem related to PHP sessions in a school computer lab
> environment.  I have a script that uses sessions to keep track of a user and
> their work on the system.  It is being used by a school in a computer lab in
> which the students just have terminals -- they all access the same server
> computer to run programs and do not have hard drives of their own.  They are
> running software called "ClassLink" (see www.classlink2000.com) in this lab
> (I'm not sure if that is really an important detail or not).
> 
> The problem is that everyone that students accessing the script on these
> different terminals start seeing eachother's work, which implies that the
> session information is not unique to each terminal (I expect that if I
> printed out the session ID on all of these different terminals, they would
> all be the same).
> 
> Is there anything that I can do about this?  How do I get my script to
> recognize that it is being accessed by different terminals, even though it
> is really only one physical computer (the server that all of these terminals
> have a view into)?  Is there any other solution?
> 
> Cheers,
> Damon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] $_FILE

2004-03-16 Thread Bruno Santos
Hello.

   I've read in a book that we can access several file properties (when 
uploading a file) in two ways:

1st with the array $_FILE
2nd with $HTTP_POST_FILES
i've used the 1st, but my program give many erros, and when using the 
2nd, everything was fine.

the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4.
Can someone tell me why does not work ???
cheers

--
-
   .-'-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: $_FILE

2004-03-16 Thread Luis Mirabal
it is not $_FILE, it is $_FILES :P

luis.

"Bruno Santos" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hello.
>
> I've read in a book that we can access several file properties (when
> uploading a file) in two ways:
>
> 1st with the array $_FILE
> 2nd with $HTTP_POST_FILES
>
> i've used the 1st, but my program give many erros, and when using the
> 2nd, everything was fine.
>
> the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4.
> Can someone tell me why does not work ???
>
> cheers
>
> --
> -
>.-'-.
>  .' `.
> : :
>:   :
>:  _/|  :   Bruno Santos
> :   =/_/  : [EMAIL PROTECTED]
>  `._/ | .'
>   (   /  ,|...-'Pagina Pessoal
>\_/^\/||__   http://feiticeir0.no-ip.org
> _/~  `""~`"` \_
>  __/  -'/  `-._ `\_\__
>/jgs  /-'`  `\   \  \-.\
>
>
>"Written very small on the back poket of a girl's jeans
>- 'If you can read this, you're WAY too close.'"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Rob Paxon
Jason Sheets wrote:
Sometimes having less included files with more content is more efficient
than having a lot of small files [...]
I'd think in my case, this is true.  Generally, nothing is in these main 
include files that aren't needed by every page.

I'd suggest profiling your code, use the PEAR Benchmark class and use PHP's
memory usage functions to determine what parts of your code are consuming
the most resources and taking the longest amount of time to execute, then
try some experiments and profile each experiment to determine the most
efficient solution.
Profiling is something I've been doing a lot of in the past week or so, 
via various debuggers.  I wasn't aware of a PEAR Benchmarking class, 
I'll have to check it out.

In my commericial websites I have modified my application framework not to
connect to the database, start output buffering, start the session and do
other overhead if specific constants are declared.  For example if I have
contact.php that does some mailing stuff and requires Smarty I can define
TEMPLATE_ONLY and only templating related files will be included and
initialized.
Doing this optmization made pages roughly 50% faster that did not require
session or a database connection and also reduces the load on the sql server
because you are not connecting unless you actually need the connection and
still benefit from having a single connection call instead of connecting in
each function or file.
I have done similar things.  For instance, sessions are only useful to 
me for people who are actually logged in, so I recently dumped my custom 
PHP sessions handler and made my own session system.  It takes a lot 
less code than my handler and only connects to the database if the user 
sends over a session id.  The database connection is then closed if the 
proceeding script doesn't need it or it is opened later if needed, in 
the case of no session.  It creates a session only through the log-in 
script.  This way, sessions are only created and read for those who 
choose to log in, which is obviously far, far less than %50 of visitors. 
 In the end, it works out to the database only being opened when needed 
and I've found this to make dramatic difference, even on my sorry old 
local enviroment.

I'm glad to see this topic got so many different responses.

Thanks fellas
- Rob Paxon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] File Upload problems

2004-03-16 Thread Bruno Santos
Can someone tell me why this is happening ?

i've tryed everything, since changing file, directory permissions, 
owner, etc 

i upload a file and, i give this erros

someone has any ideia ???

File Type: text/plain

*Warning*: move_uploaded_file(teste.txt): failed to open stream: 
Permission denied in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *51*

*Warning*: move_uploaded_file(): Unable to move '/tmp/phpXBWdts' to 
'teste.txt' in */usr/local/apache2/htdocs/projecto/examples/upload.php* 
on line *51*
Could not move file to destination directory

Cheers,

Bruno Santos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] session problem (i think)

2004-03-16 Thread Nick Rout
I am running Apache/2.0.48 (Gentoo/Linux) mod_ssl/2.0.48 OpenSSL/0.9.6k PHP/4.3.4

I have a drupal site set up, http://rout.dyndns.org/cagc

Since some time on Sunday i have had the following error appear at the
bottom of the page:

Warning: Unknown(): A session is active. You cannot change the session module's ini 
settings at this time. in Unknown on line 0

I then cannot login to the site. Some of the site functionality is there
(ie you can view the basic pages etc, but anything that needs a login to
acheive is no good)

When I search google I seem to find that this is a php error, although I
cannot see a fix anywhere.

Can anyone tell me where to look in order to sort this out. I am a php
newbie, so if there is any other info I need to provide please let me
know.
-- 
Nick Rout <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2004-03-16 Thread Chris Shiflett
--- "Vail, Warren" <[EMAIL PROTECTED]> wrote:
> Ahh, because it's raw html and not in php.
> 
> one choice would be to encapsulate it within php
> 
>  this to work?\", with a frown";?>" size="50">

The problem with this is that PHP is server-side, so the following is sent
to the browser:



Thus, the same problem exists on the client-side, because the output is
identical.

To reiterate what others have stated, escaping quotes is good for PHP, and
HTML entities are good for HTML.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] creating a mailbot in php

2004-03-16 Thread Leonard B Burton
Greetings,

I have been trying to come up with a script in PHP to take an email and do a little 
parsing and upload the data into a mysql database.  However I have had a couple of 
glitches.

Would someone be so nice to send me the code to just get it to do something (like 
update a counter or anything) simple that I will be able to tell if the email is 
getting  to the script or not?

My host has an option that allows you to easily make an alias [by way of an html form] 
that will send emails to certain files and I can not tell if it is not working or if 
my script is not working.  I have tried to read around and could not figure it out.  I 
wish I could RTFM but I cant find one.  The few pages I found on the net do not give a 
good enough explaination.  Thanks,

Leonard Burton
Wilmington, NC
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >