[PHP] Re: [PEAR-DEV] Please Help me..MySQL

2003-07-24 Thread Sebastian Bergmann
Mohsen Pahlevanzadeh wrote:
 Hi dears.

  Please post such questions to mailto:[EMAIL PROTECTED]

  Your posting has no reference to PEAR whatsover.

  Greetings,
Sebastian

-- 
Sebastian Bergmann
http://sebastian-bergmann.de/   http://phpOpenTracker.de/

Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

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



[PHP] Re: Problem with MySQL Query

2003-07-24 Thread Mikael Jansson
Hi Phil,
What I can see in your question there is a missing space between fieldname
type and the operator !=

I tested on my machine and it works fine when using both != and 
operators, but it will not work with the NOT operator.

Hope the missing space will do some good.

br

/Mikael

Phillip Blancher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Problem with mySQL Query
This is the query I have:

$dbqueryshipping1 = select * from tempuserpurchase where
(usersessionid=\$User_Shopping_Id\) and day=\1\ and type!=\Meal+Plans\
;

What I want to do is to select everything from tempuserpurchase that matchs
the user session and the day, so long as type is not Meal Plans

However it is not excluding Meal Plans

Any Suggestions.

Thanks in advance,

Phil


__


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003




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



Re: [PHP] Re: I'm really getting annoyed with PHP

2003-07-24 Thread Wendell Brown
On Wed, 23 Jul 2003 14:48:03 -0600, Kevin Stone wrote:

Beauford, here's a login routine that I wrote using Sessions and Header
redirects.  It is my interpretation of what you are trying to do.  I'm not
saying this is the only way to do it but it works well for me.  Compare it
to what you're doing to see if you're doing anything wrong.

page-whatever.php
? // -- line 1
session_start();
$thispage = http://www.yourdomain.com.$_SERVER['REQUEST_URI'];
$_SESSION['return-to'] = $thispage;
if($_SESSION['valid_user'] !== true)
{
// Access Denied!  Redirect to the login screen.
header(Location: http://www.yourdomain.com/login.php;);
exit;
}

Ok, I have a question.  Where is $_SESSION['valid_user'] getting set
(or unset)???  

Have you checked to see if your IF statement at the top of the script
is working like you think it should be??  Try putting an echo in
instead of the header() call and see if you get the output you think
you should.

I suspect this isn't a redirect isn't working issue at all but a the
if isn't working like I thought it would issue.  :)


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



Re: [PHP] Re: I'm really getting annoyed with PHP

2003-07-24 Thread Wendell Brown
On Thu, 24 Jul 2003 02:05:58 -0500, Wendell Brown wrote:

Ok, I have a question.  Where is $_SESSION['valid_user'] getting set
(or unset)???  

Oooops.  I thought that was the code that he was talking about.  I
missed your lead in.  Sorry!!!


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



[PHP] Load in a dedicated server

2003-07-24 Thread desa15
Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
apache 1.3

The load average of my server is ever above 0.20 to 0.60 whith the same
users

When i turn off register globals and turn on safe mode in php.ini and
restart the apache daemon to take the changes, the load averge is ever 0.90
to 1.20

I not found anything about this params affect the optimization, is posible
???
any can help me ??


Best rtegards, and excuse my broken english




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



RE: [PHP] arguments against moving site from Linux/Apache/PHP server toWindows/IIS/PHP needed

2003-07-24 Thread SLanger
Go with the costs. If you have a running system on apache + php + mysql 
see how much it costs to support that platform. Meaning how high are the 
costs to maintain it. Inclusive administration and deployment of apps. 
Then compare the costs of maintaining a IIS Windows PHP Mysql setup under 
the same circumstances and than add to that the cost of migrating. 
Don't forget to compare upgrade costs in apache and IIS. 
The sums should make it clear.
But don't forget to see why they want to migrate. There might be a good 
reason to do so and you shouldn't be blocking that just because you like 
linux better.

Regards 
Stefan Langer 

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



[PHP] Difference between equal $_SERVER variables?

2003-07-24 Thread Ivo Fokkema
Hi list,

Just out of curiosity I would like to know if anyone can tell me the
difference between some $_SERVER variables that generate the same output (in
my test-file at least).

For instance, what is the difference between $_SERVER['HTTP_HOST'] and
$_SERVER['SERVER_NAME']? Can they generate different output under some
circumstances? They're always the same with me. Any recommendations on which
to use?

I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
different?

TIA,


--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands



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



RE: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 20:24, Beauford.2005 wrote:
 It's obvious though that PHP can not handle it. This is why I am forced
 to use javascript. I have already spent a week on this and am not going
 to waste any further time. I have posted all my code and if someone can
 see a problem I'll look at it, but it just ain't worth the effort at
 this point.

Again, post a script which displays the problem. I've only seen little
snippets which do not consitute a working example. It will be seen by
many and fixed within minutes.

I have had this functionality active every day for years over many
different version of PHP in many different environments. The good news
is that the problem is not with PHP. That means it's the code, which is
easy to fix.


-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



[PHP] a stupid question

2003-07-24 Thread Joe
how to check the filetype of remote file
because is_dir(), is_file() can't work on remote file
thx a lot



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



[PHP] Please help!!! thx a lot~~~

2003-07-24 Thread Joe
I have written a php to show file in directories.
The problem is due to is_dir() can't opearate on remote files. What should I
do in order to fix it.
thx a lot~~~


begin 666 list.php
M/#]P:' -B @)9I;5N86UE/2=L:7-T+G!H[#0H@(=L;V)A; D8W5R
ME]D:7([#0H@(1C=7)R7V1ICTG+B[#0H@(EF*ES4V5T*1?1T54*28F
M:7-3970H)%]'151;)W!A=@G72DI#0H@( @(1C=7)R7V1ICTD7T=%5%LG
M%T:==.PT*([EMAIL PROTECTED];5N/7-TG)P;W,H)-UG)?9ER+O)RDI#0H@
M( @(1P87)E;G1?9ER/7-U8G-T[EMAIL PROTECTED]E]D:7(L,PD;5N*3L-B @
M96QS90T*( @( D%R96YT7V1ICTD8W5RE]D:7([#0H-B @:68H:7-?
M9ER*1C=7)R7V1IBDI#0H@('L-B @( @:68H)1H/6]P96YD:7(H)-U
MG)?9ER*2D-B @( @PT*( @( @( @(1O=71P=71;,%U;,%T](CQ!
M($A2148]7(D9FEL96YA;64_%T:#TD8W5RE]D:7)(CXN/]!/B([#0H@
M( @( @( @)]U='!U=%LQ75LP73TB/[EMAIL PROTECTED])%1CU(B1F:6QE;F%M93]P
M871H/21P87)E;G1?9ER7(^+BX\+T$^(CL-B @( @( @( D8V]U;G1E
MCTR.PT*( @( @( @('=H:6QE*@D9FEL93UR96%D9ER*1D:DI(3T]
M9F%LV4I#0H@( @( @( @PT*( @( @( @( @( @96-H;R B)9I
M;4@:7,@82 B+F9I;5T7!E*1F:6QE*2XB/)R/B([#0H@( @( @( @
M( @([EMAIL PROTECTED])RXG?'PD9FEL93T])RXN)RD-B @( @( @( @
M( @('L-B @( @( @( @( @('T-B @( @( @( @( @(5LV4@
M:68H:[EMAIL PROTECTED]@( @( @( @( @(![#0H@( @( @
M( @( @( @( @( D;W5T'5T6R1C;W5N=5R*RM=6S!=/2(\02!(4D5
M/5PB)-UG)?9ER+R1F:6QE7(^)9I;4\+T$^(CL-B @( @( @( @
M( @('T-B @( @( @( @( @(5LV4-B @( @( @( @( @('L-
MB @( @( @( @( @( @( @(1O=71P=71;)-O=6YT97(K*UU;,%T]
M(CQ!($A2148]7(D9FEL96YA;64_%T:#TD8W5RE]D:7(O)9I;5(CXD
M9FEL93PO03XB.R @( @( @( @( @( @( @( @( -B @( @( @
M( @( @('T-B @( @( @(!]#0H@( @('T-B @?0T*(!F;W)E86-H
M*[EMAIL PROTECTED],@)ET96TI#0H@( @( @9F]R96%C:@D:71E;2!AR D
KW1R*0T*( @( @( @( @96-H;R DW1R+B(\8G(^(CL-B @#0H_/@``
`
end


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



[PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread Joe
any alternative method is also welcome

Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
 I have written a php to show file in directories.
 The problem is due to is_dir() can't opearate on remote files. What should
I
 do in order to fix it.
 thx a lot~~~






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



[PHP] Please help!!!~~thx a lot

2003-07-24 Thread Joe
I have just started to learn php and written a php to list the files. But
there is a problem, seen the is_dir() function can't work on remote files.
Therefore, it couldn't check the filetype of subdirectories.
Would anyone tell me what should I do.
Thx a lot


begin 666 list.php
M/#]P:' -B @)9I;5N86UE/2=L:7-T+G!H[#0H@(=L;V)A; D8W5R
ME]D:7([#0H@(1C=7)R7V1ICTG+B[#0H@(EF*ES4V5T*1?1T54*28F
M:7-3970H)%]'151;)W!A=@G72DI#0H@( @(1C=7)R7V1ICTD7T=%5%LG
M%T:==.PT*([EMAIL PROTECTED];5N/7-TG)P;W,H)-UG)?9ER+O)RDI#0H@
M( @(1P87)E;G1?9ER/7-U8G-T[EMAIL PROTECTED]E]D:7(L,PD;5N*3L-B @
M96QS90T*( @( D%R96YT7V1ICTD8W5RE]D:7([#0H-B @:68H:7-?
M9ER*1C=7)R7V1IBDI#0H@('L-B @( @:68H)1H/6]P96YD:7(H)-U
MG)?9ER*2D-B @( @PT*( @( @( @(1O=71P=71;,%U;,%T](CQ!
M($A2148]7(D9FEL96YA;64_%T:#TD8W5RE]D:7)(CXN/]!/B([#0H@
M( @( @( @)]U='!U=%LQ75LP73TB/[EMAIL PROTECTED])%1CU(B1F:6QE;F%M93]P
M871H/21P87)E;G1?9ER7(^+BX\+T$^(CL-B @( @( @( D8V]U;G1E
MCTR.PT*( @( @( @('=H:6QE*@D9FEL93UR96%D9ER*1D:DI(3T]
M9F%LV4I#0H@( @( @( @PT*( @( @( @( @( @96-H;R B)9I
M;4@:7,@82 B+F9I;5T7!E*1F:6QE*2XB/)R/B([#0H@( @( @( @
M( @([EMAIL PROTECTED])RXG?'PD9FEL93T])RXN)RD-B @( @( @( @
M( @('L-B @( @( @( @( @('T-B @( @( @( @( @(5LV4@
M:68H:[EMAIL PROTECTED]@( @( @( @( @(![#0H@( @( @
M( @( @( @( @( D;W5T'5T6R1C;W5N=5R*RM=6S!=/2(\02!(4D5
M/5PB)-UG)?9ER+R1F:6QE7(^)9I;4\+T$^(CL-B @( @( @( @
M( @('T-B @( @( @( @( @(5LV4-B @( @( @( @( @('L-
MB @( @( @( @( @( @( @(1O=71P=71;)-O=6YT97(K*UU;,%T]
M(CQ!($A2148]7(D9FEL96YA;64_%T:#TD8W5RE]D:7(O)9I;5(CXD
M9FEL93PO03XB.R @( @( @( @( @( @( @( @( -B @( @( @
M( @( @('T-B @( @( @(!]#0H@( @('T-B @?0T*(!F;W)E86-H
M*[EMAIL PROTECTED],@)ET96TI#0H@( @( @9F]R96%C:@D:71E;2!AR D
KW1R*0T*( @( @( @( @96-H;R DW1R+B(\8G(^(CL-B @#0H_/@``
`
end


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



RE: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Ow Mun Heng
This is taken from mantis.. NOt sure if it'll help but take a look at the
t_use_iis field


function print_header_redirect( $p_url, $p_die=true ) {
$t_use_iis = config_get( 'use_iis');

if ( ON == config_get( 'stop_on_errors' )  error_handled()
) {
return false;
}

if ( OFF == $t_use_iis ) {
header( 'Status: 302' );
}
header( 'Content-Type: text/html' );
header( 'Pragma: no-cache' );
header( 'Expires: Fri, 01 Jan 1999 00:00:00 GMT' );
header( 'Cache-control: no-cache, no-cache=Set-Cookie,
private' );
if ( ON == $t_use_iis ) {
header( Refresh: 0;url=$p_url );
} else {
header( Location: $p_url );
}

if ( $p_die ) {
die; # additional output can cause problems so let's
just stop output here
}

return true;
}

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Beauford.2005 [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 6:13 AM
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] I'm really getting annoyed with PHP


FYI. I did this login page for another website last month and I used the
code from it to do this one. The other one works perfectly. I checked
that code again today and there is ABSOLUTELY no differnce. I even used
the same variables and session names. The only difference between the
two sites is that the one that works is running IIS on Windows 2000
Server. The broken one is on a Linux box running Apache. Both PHP and
MySQL are the same versions. Remember also that the Header redirect is
working in the redirect.inc page, which is even more confusing.

I have really given up on it. It just ain't gonna work - no matter what
I do. I thought I finally had it working again, but of course - another
f*** up.

Can you explain this? Along with my other code I used a little piece of
javascript to do the redirect, and lo and behold it worked. But now my
paths are all screwed up. I just don't get it.

In the example I tried, the page I am redirected to has a form on it.
When I click submit it should go to the page specified in the action,
which is season_write.php.

FORM onSubmit=return checkrequired(this) ACTION=season_write.php
action=post name=seasons

But for some reason it tries to go to /setup/season_write.php. This is
not specified anywhere in any of my code. So where the hell it getting
this from. 

The more I use PHP the more I am becoming convinced I should be using
something else. This is just ridiculous.

SCRIPT LANGUAGE=JavaScript
!-- Begin
window.location=? echo $_SESSION['goto']; ?;
// End --
/script

-Original Message-
From: Ray Hunter [mailto:[EMAIL PROTECTED] 
Sent: July 23, 2003 5:44 PM
To: Beauford.2005
Subject: Re: [PHP] I'm really getting annoyed with PHP


Questions:

1. What verion of php are you running?
2. What version of apache are you running? Or other web server? 3. What
is your configuration for php? check phpinfo() 4. Is php built from
source or a binary (rpm, exe)? 5. What OS are you running on and what
version?


--
BigDog



On Thu, 2003-07-24 at 13:41, Beauford.2005 wrote:
 Yes, I'm still screwing around with this stupid redirection thing, and

 either I'm just a total idiot or there are some serious problems with 
 PHP. I have now tried to do it another way and - yes - you guessed it.

 It does not work.
 
 I mean really, it can not be this hard to redirect a user to another 
 page. If it is, then I must look into using something else as I just 
 can't be wasting days and days on one minor detail that should take 30

 seconds to complete.
 
 If anyone has some concrete suggestion on how to get this to work It 
 would be greatly appreciated. In the mean time I have given up on it 
 as I am just totally pissed off at it.
 
 TIA
 
 


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



Re: [PHP] a stupid question

2003-07-24 Thread Jacob Vennervald Madsen
Download it and then check it. But if you need to check a lot of files
that's probably to slow.

Jacob Vennervald

On Thu, 2003-07-24 at 06:03, Joe wrote:
 how to check the filetype of remote file
 because is_dir(), is_file() can't work on remote file
 thx a lot
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



: [PHP] Difference between equal $_SERVERvariables?

2003-07-24 Thread chenqi1

$_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME']are different in my
circumstance,I found that the $_SERVER['SERVER_NAME']is the same with the
ServerName value you set in httpd.conf.




   
  
Ivo Fokkema  
  
I.F.A.C.Fokkem[EMAIL PROTECTED] 
[EMAIL PROTECTED]   
  
   
  
[PHP] Difference between equal 
$_SERVER
   variables?  
  
2003-07-24 
  
16:20  
  
   
  
   
  






Hi list,

Just out of curiosity I would like to know if anyone can tell me the
difference between some $_SERVER variables that generate the same output
(in
my test-file at least).

For instance, what is the difference between $_SERVER['HTTP_HOST'] and
$_SERVER['SERVER_NAME']? Can they generate different output under some
circumstances? They're always the same with me. Any recommendations on
which
to use?

I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
different?

TIA,


--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands



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





[PHP] Re: people who has done a POS system before

2003-07-24 Thread sven
hi,
for mobiles: there is a wap-browser for windows-plattform:
http://www.winwap.org
ciao SVEN

Tan Ai Leen wrote:
 Hi,
 I was just wondering there is a emulator for us developers to develop
 programs for palm and handphone, etc. Is there a program that
 emulates the output from various printers on screen?

 Regards,
 Tan Ai Leen



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



[PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread sven
hi joe,
you want a server-script, that lists a dir on a client?
i think that's impossible. think of if you visit a website written in php
and in background your hdd is scanned? that's simply a security reason.
ciao SVEN

Joe wrote:
 any alternative method is also welcome

 Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
 [EMAIL PROTECTED]
 I have written a php to show file in directories.
 The problem is due to is_dir() can't opearate on remote files. What
 should I do in order to fix it.
 thx a lot~~~



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



Re: [PHP] Difference between equal $_SERVER variables?

2003-07-24 Thread Marek Kilimajer
server name - real name of the server, ie when you do a reverse dns 
lookup you get (usualy) this
http host - content of the Host: header, that is virtual host

Ivo Fokkema wrote:
Hi list,

Just out of curiosity I would like to know if anyone can tell me the
difference between some $_SERVER variables that generate the same output (in
my test-file at least).
For instance, what is the difference between $_SERVER['HTTP_HOST'] and
$_SERVER['SERVER_NAME']? Can they generate different output under some
circumstances? They're always the same with me. Any recommendations on which
to use?
I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
different?
TIA,

--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands




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


Re: [PHP] php function on php.net

2003-07-24 Thread Merlin
this is a reply on:

 I am wondering how on php.net the search for functions is done.
You
 can add
 any function just behind the php.net
 like php.net/phpinfo and it will point you right through it. I
know  how to
 redirect this as a 404 error in apache to another file, but then
the
 url is
 changing. In the php.net case the url stayes the same.
 Does anybody know how this is done?

reply:

Use a path relative to your httpdocs for your error document, e.g.
ErrorDocument 404 /myerrorpage.php
instead of
ErrorDocument 404 http://mysite/myerrorpage.php
David.

Unfortunatelly this is not what I mean.

Have a look on this:
http://www.globosapiens.net/hially
A php page is redirecting this 404 error to another page, but I would like
to have
the URL stay the same like it is done on php.net

Can anybody help?

Thanx,

Merlin

--
Worldwide Travel Community
http://www.globosapiens.net


--
lt;IFRAME
SRC=http://saratoga.globosapiens/associates/report_member.php?u=3color=EEE
EEE scrolling=no frameborder=0 TITLE=My travel articles width=330
height=155  ALLOWTRANSPARENCY=truea href=http://www.globosapiens.net;
title=Worldwide Travel CommunityaTravel Communitya/ /IFRAME

David Nicholson [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Hello,

This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at
21:15, lines prefixed by '' were originally written by you.
 Hi there,
 I am wondering how on php.net the search for functions is done.
You
 can add
 any function just behind the php.net
 like php.net/phpinfo and it will point you right through it. I
know
 how to
 redirect this as a 404 error in apache to another file, but then
the
 url is
 changing. In the php.net case the url stayes the same.
 Does anybody know how this is done?
 Thanx, Merlin

Use a path relative to your httpdocs for your error document, e.g.

ErrorDocument 404 /myerrorpage.php

instead of

ErrorDocument 404 http://mysite/myerrorpage.php

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)



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



Re: [PHP] Load in a dedicated server

2003-07-24 Thread Marek Kilimajer
Globals off should help you gain performance, but safe mode on is expensive.

[EMAIL PROTECTED] wrote:
Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
apache 1.3
The load average of my server is ever above 0.20 to 0.60 whith the same
users
When i turn off register globals and turn on safe mode in php.ini and
restart the apache daemon to take the changes, the load averge is ever 0.90
to 1.20
I not found anything about this params affect the optimization, is posible
???
any can help me ??
Best rtegards, and excuse my broken english






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


Re: [PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread Marek Kilimajer
What is remote in your circumstances? FTP, HTTP, ... ?

Joe wrote:

any alternative method is also welcome

Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
I have written a php to show file in directories.
The problem is due to is_dir() can't opearate on remote files. What should
I

do in order to fix it.
thx a lot~~~








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


[PHP] Re: closing windows

2003-07-24 Thread WebDevMagazine
hi
html
script language=javaScript
function execute()
{
 windows.close();


}
/script



?php

echo a href=javascript.execute() Close /a;


?

/html



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



Re: [PHP] a stupid question

2003-07-24 Thread Joe
thx

Jacob Vennervald Madsen [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
 Download it and then check it. But if you need to check a lot of files
 that's probably to slow.

 Jacob Vennervald

 On Thu, 2003-07-24 at 06:03, Joe wrote:
  how to check the filetype of remote file
  because is_dir(), is_file() can't work on remote file
  thx a lot
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 --
 Venlig hilsen / Best regards,
 Jacob Vennervald
 System Developer
 Proventum Solutions ApS
 Tuborg Boulevard 12
 2900 Hellerup
 Denmark
 Phone: +45 36 94 41 66
 Mobile: +45 61 68 58 51





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



[PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread Joe
I see the point but I just want to list the subfolder under my directory.
Could you please tell me how to distinguish a directory from a file in Unix
thx a lot

Sven [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
 hi joe,
 you want a server-script, that lists a dir on a client?
 i think that's impossible. think of if you visit a website written in php
 and in background your hdd is scanned? that's simply a security reason.
 ciao SVEN

 Joe wrote:
  any alternative method is also welcome
 
  Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
  [EMAIL PROTECTED]
  I have written a php to show file in directories.
  The problem is due to is_dir() can't opearate on remote files. What
  should I do in order to fix it.
  thx a lot~~~





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



Re: [PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread Joe
HTTP
my department disable the function of listing file
Marek Kilimajer [EMAIL PROTECTED]
???:[EMAIL PROTECTED]
What is remote in your circumstances? FTP, HTTP, ... ?

Joe wrote:

 any alternative method is also welcome

 Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
 :[EMAIL PROTECTED]

I have written a php to show file in directories.
The problem is due to is_dir() can't opearate on remote files. What should

 I

do in order to fix it.
thx a lot~~~










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



[PHP] Re: people who has done a POS system before

2003-07-24 Thread Tan Ai Leen
Actually I am looking for a emulator that works for printers, not phones



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



Re: [PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread Marek Kilimajer
Do you mean you cannot access the filesystem on your own server?

You can find out if /something is a directory by connecting to the web 
server and request the file/directory without a trailing slash. If it is 
a directory server will respond with 301 Moved Permanently response.

$is_dir=false;
$sock=fsockopen('server', 80);
fputs($sock,GET /something\r\n\r\n);
while (!feof($fp)) {
if(strpos(fgets($fp,128),301 Moved Permanently)) $is_dir=true;
}
fclose ($fp);
Joe wrote:

HTTP
my department disable the function of listing file
Marek Kilimajer [EMAIL PROTECTED]
???:[EMAIL PROTECTED]
What is remote in your circumstances? FTP, HTTP, ... ?
Joe wrote:


any alternative method is also welcome

Joe [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]

I have written a php to show file in directories.
The problem is due to is_dir() can't opearate on remote files. What should
I


do in order to fix it.
thx a lot~~~











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


Re: [PHP] Re: I'm really getting annoyed with PHP

2003-07-24 Thread Comex
 Ok, I have a question.  Where is $_SESSION['valid_user'] getting set
 (or unset)???

AFAICS, $_SESSION['valid_user'] is getting set by a previous page, it's a
*session*.

 Have you checked to see if your IF statement at the top of the script
 is working like you think it should be??  Try putting an echo in
 instead of the header() call and see if you get the output you think
 you should.

 I suspect this isn't a redirect isn't working issue at all but a the
 if isn't working like I thought it would issue.  :)


Err... that wasn't the original code... that was someone else's code that
worked...



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



[PHP] php4 vs php5

2003-07-24 Thread Robert Janeczek
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
to hear from core developers about which types (loops, math operations,
objects code) of code will show the differences so i could write my own
benchmark.

rash



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Comex
[EMAIL PROTECTED]
Lars Torben Wilson:
 On Wed, 2003-07-23 at 18:21, Daryl Meese wrote:
 Well, I know I am not running the latest version of PHP but I don't
 believe this is accurate.  I believe PHP case sensitivity is based
 on the os that processes the file.  Can anyone clear this up.

 Daryl


 OK: you're mistaken. If you're correct, it's a bug. I'm pretty sure we
 would have heard about it by now. :)

 But give it a try and post your results (I don't have a Win PHP box
 set up right now, myself).

PHP 4.3.2 and 5.0.0b1 on Windows

?php
$a = set;
print '$A is '; print isset($A) ? 'set' : 'unset'; print 'br';
print '$a is '; print isset($a) ? 'set' : 'unset';
?

$A is unset
$a is set



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Comex
[EMAIL PROTECTED]
Beauford.2005:
 It's obvious though that PHP can not handle it. This is why I am
 forced to use javascript. I have already spent a week on this and am
 not going to waste any further time. I have posted all my code and if
 someone can see a problem I'll look at it, but it just ain't worth
 the effort at this point.

Every single person who posted here thought that PHP could handle it.  If
header(Location: http://www.google.com;); doesn't work, there's something
wrong with your version of PHP.



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



Re: [PHP] php function on php.net

2003-07-24 Thread Ivo Fokkema
  Use a path relative to your httpdocs for your error document, e.g.
  ErrorDocument 404 /myerrorpage.php
  instead of
  ErrorDocument 404 http://mysite/myerrorpage.php
 Unfortunatelly this is not what I mean.
I think it is. When you use a relative path in the .htaccess, the URL will
not change, but you will be redirected. Therefor you can use
$_SERVER['REQUEST_URI'] in your 404-page to check what the visitor was
looking for.

HTH,

--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands



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



[PHP] Re: Has anyone successfully installed PHP 5?

2003-07-24 Thread Comex
[EMAIL PROTECTED]
Jonathan Villa:
 Has anyone installed PHP 5 on Windows or Linux using Apache 2?

Yes... on Windows.  But it's unstable, don't do it.



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



[PHP] Re: arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-24 Thread Jerry Artman
How about you can get a the world's fastest PC, a 64bit server that handles
8gig of memory that can run cicles around any wintel based machine and still
use all the *nix software without having rewrite anything for say $3k.
That's with 10/100/1000 ethernet ports. It already has hugely more installed
base than Linux (7 million) and can still run all your favorite MS software
even Windows OS if so inclined-- as an additional application. There is no
server/user license fees from the manufacturer. For bigger projects, thing
like Oracle are available. It doesn't require a whole new staff of certified
(READ $) staff to manage and maintain. In fact, $1k a year can buy you
30min 24/7 phone response and 4hr business hours on-site response time
factory service.

For $6k you can put fibre channel 1.25T of raid data. If you really need a
GUI for all the *nix stuff and perhaps don't care to unload or compile from
source, a Server option for $500 will give you all kinds of GUI interfaces
to the settings, again- unlimited users.


Jerry Artman
Budget and Reimbursement
[EMAIL PROTECTED]


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



[PHP] need help

2003-07-24 Thread dan montgomery
need to know which scripts I can get free or at low cost to create a hosting site and 
to make an e-mail site. The e-mail site need two features one is for free accounts and 
one is for paid accounts like yahoo.com. But there is one catch yahoo dosn't give as 
much space as I will for free I will be equal to the low end of yahoo.com and for only 
4.95 a year you get unlimited space this of course is unless you have put in info that 
has helped create this site. Or gave suggestions so as long as you have gave 
suggestions then you will get unlimited e-mail.



-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: [PHP] need help

2003-07-24 Thread skate
check out sourceforget.net, lots of web applications on there for hosting
management, and i believe there's a few email applications.

- Original Message -
From: dan montgomery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 12:55 PM
Subject: [PHP] need help


 need to know which scripts I can get free or at low cost to create a
hosting site and to make an e-mail site. The e-mail site need two features
one is for free accounts and one is for paid accounts like yahoo.com. But
there is one catch yahoo dosn't give as much space as I will for free I will
be equal to the low end of yahoo.com and for only 4.95 a year you get
unlimited space this of course is unless you have put in info that has
helped create this site. Or gave suggestions so as long as you have gave
suggestions then you will get unlimited e-mail.



 -
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread zerof
I'm using the redirect with php for a long time, with no problems.
I use it in all of my pages, including navigational menus.
The great problem with headers is the function exit if it is used to ends the call.
headers + exit, if used in any place, may cause some collateral efects.
-
zerof
-



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Comex
[EMAIL PROTECTED]
Zerof:
 I'm using the redirect with php for a long time, with no problems.
 I use it in all of my pages, including navigational menus.
 The great problem with headers is the function exit if it is used
 to ends the call. headers + exit, if used in any place, may cause
 some collateral efects. -
 zerof
 -

Why?  AFAIK, exit quits the script, exactly what you want if you want to
redirect.



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread zerof
You are absolutely right, exit, quits my script, this let me use an independent script 
to
handle the headers. if used with conditional calls. .

zerof
-
Comex [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 [EMAIL PROTECTED]
-
 Why?  AFAIK, exit quits the script, exactly what you want if you want to redirect.
---



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



Re: [PHP] Some SESSION Vars not Registering

2003-07-24 Thread Jeff Stillwall
CPT John W. Holmes wrote:

 Why not just
 
 $_SESSION['userArray'] = $userArray;
 
 ??
 
 Then $_SESSION['userArray']['fname'] to access the values, for example.

Well, yes, that does work.  And it's an acceptable workaround (I've already
updated my code).  It's nice in that it let's me keep the keys that match my
database columns.

However, it's really just that: a workaround.  I'd still love to know why I
can't register certain variables and have them stick outside of that one
function.  I think I will never find out.

Thank you very much for a very direct alternative.
-- 
Jeff Stillwall


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



Re: [PHP] php function on php.net

2003-07-24 Thread Curt Zirzow
* Thus wrote Merlin ([EMAIL PROTECTED]):
 this is a reply on:
 
  I am wondering how on php.net the search for functions is done.
 You
  can add
  any function just behind the php.net
  like php.net/phpinfo and it will point you right through it. I
 know  how to
  redirect this as a 404 error in apache to another file, but then
 the
  url is
  changing. In the php.net case the url stayes the same.
  Does anybody know how this is done?
 
 reply:
 
 Use a path relative to your httpdocs for your error document, e.g.
 ErrorDocument 404 /myerrorpage.php
 instead of
 ErrorDocument 404 http://mysite/myerrorpage.php
 David.
 
 Unfortunatelly this is not what I mean.
 
 Have a look on this:
 http://www.globosapiens.net/hially
 A php page is redirecting this 404 error to another page, but I would like
 to have
 the URL stay the same like it is done on php.net

mod_rewrite can do that.

Or:

header('HTTP/1.0 307 Temporary Redirect');
header('Location: /uri/to/file');
?
a href=/url/to/filemoved here/a
---

rfc2616 section=10.3.8
307 Temporary Redirect

The requested resource resides temporarily under a different URI.
Since the redirection MAY be altered on occasion, the client
SHOULD continue to use the Request-URI for future requests.
/rfc2616
  
I havn't tested it but the behaviour for the client is specified.

 
 Can anybody help?
 

HTH,


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Robert Fitzpatrick
I am trying to communicate with an API of a vendors of ours. They provide a
Perl example that works fast and well. I am trying to do the same thing with
a PHP class. The response takes over a minute before the response comes
back. I see from the response text that the API is running on Apache
Coyote/1.0. Does anyone know of issues with this match-up, here is the
snippet of code that seems to be hanging. Using my Komodo debugger, it
points to the line with 'while($data=fread($fp, 32768))' while waiting for
execution to continue. Using a Perl script provided by them, I get a
response in seconds. Basically, my PHP page prepares content and variables
and then uses this class to send XML formatted content to receive a
response.

  ...
  $fp=fsockopen($this-server, $this-port, $this-errno,
$this-errstr, $this-timeout);

  if(!$fp) {
$this-errstr=Cant Connect to Service ($this-server:$this-port,
$this-errno, $this-errstr);
return;
  }

  if (!fputs($fp, $op, strlen($op))) {
  $this-errstr=Write error;
  return;
  } else {

   $ipd = ;
   while($data=fread($fp, 32768)) {
  $ipd.=$data;
   }
$this-responsetext = $ipd;
//echo p.$ipd./p;
 $ipd = $this-_parse_header($ipd);

  }

  fclose($fp);
  return $ipd;
  ...



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



Re: [PHP] php function on php.net

2003-07-24 Thread Curt Zirzow
* Thus wrote Ivo Fokkema ([EMAIL PROTECTED]):
   Use a path relative to your httpdocs for your error document, e.g.
   ErrorDocument 404 /myerrorpage.php
   instead of
   ErrorDocument 404 http://mysite/myerrorpage.php
  Unfortunatelly this is not what I mean.
 I think it is. When you use a relative path in the .htaccess, the URL will
 not change, but you will be redirected. Therefor you can use
 $_SERVER['REQUEST_URI'] in your 404-page to check what the visitor was
 looking for.

with ErrorDocument 404 /myerropage.php

The url wont change if the 404 doesn't do any redirection. I've
never tried a 404 to an external page, I don't think its possible
(too lazy to look at apache's docs atm).

cheers

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Some SESSION Vars not Registering

2003-07-24 Thread Curt Zirzow
* Thus wrote Jeff Stillwall ([EMAIL PROTECTED]):
 CPT John W. Holmes wrote:
 
  Why not just
  
  $_SESSION['userArray'] = $userArray;
  
  ??
  
  Then $_SESSION['userArray']['fname'] to access the values, for example.
 
 Well, yes, that does work.  And it's an acceptable workaround (I've already
 updated my code).  It's nice in that it let's me keep the keys that match my
 database columns.
 
 However, it's really just that: a workaround.  I'd still love to know why I
 can't register certain variables and have them stick outside of that one
 function.  I think I will never find out.
 
I was browsing the php.net site and came accross this:

http://bugs.php.net/bug.php?id=23354

Note the last comment on the bug. It seems that person has been
having the same problem as you.

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] removing parts of a string...

2003-07-24 Thread Tristan . Pretty
I wanna be able to take a URL
http://www.mysite.com/downloads/file_1_a.pdf

and then remove:
http;//www.mysite.com/

then add:
/host/sites/site1/web/

to
downloads/file_1_a.pdf

Turning:
http://www.mysite.com/downloads/file_1_a.pdf
Into:
/host/sites/site1/web/downloads/file_1_a.pdf

I know I need to look up strings, but can someone point me in the right 
direction (I wanna learn, so don't give too much away!)



*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-24 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Go with the costs. If you have a running system on apache + php + mysql 
 see how much it costs to support that platform. Meaning how high are the 
 costs to maintain it. Inclusive administration and deployment of apps. 
 Then compare the costs of maintaining a IIS Windows PHP Mysql setup under 
 the same circumstances and than add to that the cost of migrating. 
 Don't forget to compare upgrade costs in apache and IIS. 

From my experience NT admin's are easier to find than UNIX/Linux
admins.

 The sums should make it clear.

Some times costs aren't an issue higher up. MS's marketing
department pushing propaganda out for people to by their products,
is what the higher management sees.

 But don't forget to see why they want to migrate. There might be a good 
 reason to do so and you shouldn't be blocking that just because you like 
 linux better.

Good policy.  This will guarantee a check in the end :)

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] removing parts of a string...

2003-07-24 Thread Juan Nin
From: [EMAIL PROTECTED]


 I wanna be able to take a URL
 http://www.mysite.com/downloads/file_1_a.pdf
 
 and then remove:
 http;//www.mysite.com/
[...]

look at preg_match()

regards,


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



Re: [PHP] Re: Problem with MySQL Query

2003-07-24 Thread Curt Zirzow
* Thus wrote Mikael Jansson ([EMAIL PROTECTED]):
 Hi Phil,
 What I can see in your question there is a missing space between fieldname
 type and the operator !=
 
 I tested on my machine and it works fine when using both != and 
 operators, but it will not work with the NOT operator.
 
 Hope the missing space will do some good.

there is no difference between:

select * from table where column !=value
vs.
select * from table where column != value

At this point, I would inspect the data to see if it is really the
value that I'm looking for.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] sorting multi-array

2003-07-24 Thread Ji Nmec
hello,

i have got a problem, tehere is an array:

$x = array(
   array(15,55,array(1,2,3),3,5,array(1,2,5)),
   array(25,55,array(1,2,3),3,5,array(1,2,5)),
   array(5,55,array(1,2,3),3,5,array(1,2,5))
   );

and I need to sort this arraybz first item of sub-arrays (x[0][0],
$x[1][0], $x[2][0]). this is the correct result:

$x = array(
   array(5,55,array(1,2,3),3,5,array(1,2,5)),
   array(15,55,array(1,2,3),3,5,array(1,2,5)),
   array(25,55,array(1,2,3),3,5,array(1,2,5))
   );

some idea how sort this multidimensional array? thank you for your
reply.

ji nmec, ICQ: 114651500
www.menea.cz - www strnky a aplikace


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



Re: [PHP] removing parts of a string...

2003-07-24 Thread R'twick Niceorgaw
On 24 Jul 2003 at 15:03, [EMAIL PROTECTED] wrote:

 I wanna be able to take a URL
 http://www.mysite.com/downloads/file_1_a.pdf
 
 and then remove:
 http;//www.mysite.com/
 
 then add:
 /host/sites/site1/web/
 
 to
 downloads/file_1_a.pdf
 
 Turning:
 http://www.mysite.com/downloads/file_1_a.pdf
 Into:
 /host/sites/site1/web/downloads/file_1_a.pdf
 
 I know I need to look up strings, but can someone point me in the
 right direction (I wanna learn, so don't give too much away!)
 

str_replace() ?


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



Re: [PHP] Please help!!!~~thx a lot

2003-07-24 Thread Curt Zirzow
* Thus wrote Joe ([EMAIL PROTECTED]):
 I have just started to learn php and written a php to list the files. But
 there is a problem, seen the is_dir() function can't work on remote files.
 Therefore, it couldn't check the filetype of subdirectories.
 Would anyone tell me what should I do.
 Thx a lot
 

Please dont attatch* your php file and expect us to read your code
figure out what you want to do then tell you what to do.

Explain what you are trying to do, and if needed give us small (10
or so lines timed down to do the task) sample of how you go about
it.  Your success rate in getting help will be much higher.

*Your file was not attatched properly, please attach file properly
if and when needed.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Difference between equal $_SERVER variables?

2003-07-24 Thread Curt Zirzow
* Thus wrote Ivo Fokkema ([EMAIL PROTECTED]):
 Hi list,
 
 Just out of curiosity I would like to know if anyone can tell me the
 difference between some $_SERVER variables that generate the same output (in
 my test-file at least).
 
 For instance, what is the difference between $_SERVER['HTTP_HOST'] and
 $_SERVER['SERVER_NAME']? Can they generate different output under some
 circumstances? They're always the same with me. Any recommendations on which
 to use?
 
 I know that $_SERVER['REQUEST_URI'] can differ from 'SCRIPT_NAME' and
 'PHP_SELF' (I use 'REQUEST_URI' to see what people were looking for when
 they hit a 404) but can $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] be
 different?

I would suggest reading up on the variables available
http://www.php.net/manual/en/reserved.variables.php

That will answer all your questions.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Load in a dedicated server

2003-07-24 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Hit to all, i have a Sun cobalt Raq 550, with php 4.1 as a module with
 apache 1.3
 
 The load average of my server is ever above 0.20 to 0.60 whith the same
 users
 
 When i turn off register globals and turn on safe mode in php.ini and
 restart the apache daemon to take the changes, the load averge is ever 0.90
 to 1.20

Have you tried toggling each one seperatly to see which one is
causing the overhead. My bet would be the safe_mode since it has
extra work to do.

If that is the case safe_mode is VERY expensive, or something is
wrong. I hope (nothing personal) that there is something wrong with
your php scripts, because that is too high of a price to pay for
safe_mode.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] php4 vs php5

2003-07-24 Thread Curt Zirzow
* Thus wrote Robert Janeczek ([EMAIL PROTECTED]):
 hi, i`m working on presentation of php5 features and i would like to add
 some comparison between php4 and php5. new coding features are of course
 available in doc on php.net, but i`m wondering where can i find benchmarks
 that show speed differences between the two. if there are none i would like
 to hear from core developers about which types (loops, math operations,
 objects code) of code will show the differences so i could write my own
 benchmark.

Since 5 is beta 1, i'm not sure all the documentation is
(officially) out on it.  If your concenered about details the
php-dev list might prove useful.

This is the only thing I found, i didn't look to hard:
http://www.php.net/ChangeLog-5.php

Curt.
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] php4 vs php5

2003-07-24 Thread Edward Peloke
some more good php5 info...

http://www.phparch.com/news/343

-Original Message-
From: Robert Janeczek [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 7:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php4 vs php5


hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
to hear from core developers about which types (loops, math operations,
objects code) of code will show the differences so i could write my own
benchmark.

rash



-- 
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] PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Curt Zirzow
* Thus wrote Robert Fitzpatrick ([EMAIL PROTECTED]):
 I am trying to communicate with an API of a vendors of ours. They provide a
 Perl example that works fast and well. I am trying to do the same thing with
 a PHP class. The response takes over a minute before the response comes
 back. I see from the response text that the API is running on Apache
 Coyote/1.0. Does anyone know of issues with this match-up, here is the
 snippet of code that seems to be hanging. Using my Komodo debugger, it
 points to the line with 'while($data=fread($fp, 32768))' while waiting for
 execution to continue. Using a Perl script provided by them, I get a
 response in seconds. Basically, my PHP page prepares content and variables
 and then uses this class to send XML formatted content to receive a
 response.
 
   ...
   $fp=fsockopen($this-server, $this-port, $this-errno,
 $this-errstr, $this-timeout);
 
   if(!$fp) {
 $this-errstr=Cant Connect to Service ($this-server:$this-port,
 $this-errno, $this-errstr);
 return;
   }
 
   if (!fputs($fp, $op, strlen($op))) {

which HTTP version are you requesting?  I know that if you send a
HTTP/1.1 then a lot of servers send the data in chunks, thus your
retrieval code needs to be different. If it is HTTP/1.1 try using
HTTP/1.0 instead.


   $this-errstr=Write error;
   return;
   } else {
 
$ipd = ;
while($data=fread($fp, 32768)) {

Have you tried smaller requests mabey 512? although that shouldn't
matter, but you might be able to see if it is getting data back at
all.

   $ipd.=$data;
}

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] sorting multi-array

2003-07-24 Thread Marek Kilimajer
www.php.net/usort - slight modification of the example (hint: add [0] to 
$a and $b).

Ji Nmec wrote:

hello,

i have got a problem, tehere is an array:

$x = array(
   array(15,55,array(1,2,3),3,5,array(1,2,5)),
   array(25,55,array(1,2,3),3,5,array(1,2,5)),
   array(5,55,array(1,2,3),3,5,array(1,2,5))
   );
and I need to sort this arraybz first item of sub-arrays (x[0][0],
$x[1][0], $x[2][0]). this is the correct result:
$x = array(
   array(5,55,array(1,2,3),3,5,array(1,2,5)),
   array(15,55,array(1,2,3),3,5,array(1,2,5)),
   array(25,55,array(1,2,3),3,5,array(1,2,5))
   );
some idea how sort this multidimensional array? thank you for your
reply.
ji nmec, ICQ: 114651500
www.menea.cz - www strnky a aplikace



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


Re: [PHP] removing parts of a string...

2003-07-24 Thread sven
hi,

Juan Nin wrote:
 From: [EMAIL PROTECTED]


 I wanna be able to take a URL
 http://www.mysite.com/downloads/file_1_a.pdf

 and then remove:
 http;//www.mysite.com/
 [...]

 look at preg_match()

... or preg_replace();


 regards,

ciao SVEN



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



[PHP] Re: sorting multi-array

2003-07-24 Thread sven
hi,
try usort();
ciao SVEN

JiøîÆèî eË wrote:
 hello,

 i have got a problem, tehere is an array:

 $x = array(
array(15,55,array(1,2,3),3,5,array(1,2,5)),
array(25,55,array(1,2,3),3,5,array(1,2,5)),
array(5,55,array(1,2,3),3,5,array(1,2,5))
);

 and I need to sort this arraybz first item of sub-arrays (x[0][0],
 $x[1][0], $x[2][0]). this is the correct result:

 $x = array(
array(5,55,array(1,2,3),3,5,array(1,2,5)),
array(15,55,array(1,2,3),3,5,array(1,2,5)),
array(25,55,array(1,2,3),3,5,array(1,2,5))
);

 some idea how sort this multidimensional array? thank you for your
 reply.

 jiøí nìmec, ICQ: 114651500
 www.menea.cz - www stránky a aplikace



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



Re: [PHP] reading from dir and displaying thumbs

2003-07-24 Thread Ryan A
oops sorry,
I guess I deleted that one accidently. Its kind of hard to keep track as
suddenly the volume of the list has gotten higher it seems. Will look into
that.
Cheers,
-Ryan


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 5:23 AM
Subject: Re: [PHP] reading from dir and displaying thumbs


 On Thursday 24 July 2003 07:41, Ryan A wrote:

  I want to convert my old java greetings programs into php scripts but am
  stuck on one little thing.
  I have a bunch of thumbnails in a 3 directories, the problem is the
number
  of thumbnails in each directory is differient...how do i first make the
  script look into the directory, display (maybe 15 per page?) thumbnails
  with a link to the main program which will take one parameter depending
on
  the thumbnail name.
  eg:
  thumbnail name is 1.jpg so that thumbnail should have a link such as a
  href /somescript.php?name=1

 If this post looks suspiciously familiar its probably because of:

   http://marc.theaimsgroup.com/?l=php-generalm=105842231927001w=2

  Anybody have any ideas or links please tell me.

 Frisk the usual suspects for ready made code:

 freshmeat.net
 sourceforge.net
 www.phpclasses.org
 www.zend.com

 --
 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
 --
 /*
 The moon is a planet just like the Earth, only it is even deader.
 */


 --
 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] Re: I'm really getting annoyed with PHP

2003-07-24 Thread Curt Zirzow
* Thus wrote Wendell Brown ([EMAIL PROTECTED]):
 On Thu, 24 Jul 2003 02:05:58 -0500, Wendell Brown wrote:
 
 Ok, I have a question.  Where is $_SESSION['valid_user'] getting set
 (or unset)???  
 
 Oooops.  I thought that was the code that he was talking about.  I
 missed your lead in.  Sorry!!!

This thread need to die... we all know it works..period

Curt
-- 
:0
* ^Subject: .*I'm really getting annoyed with PHP
/dev/null

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



Re: [PHP] php function on php.net

2003-07-24 Thread Chris Shiflett
--- Merlin [EMAIL PROTECTED] wrote:
 Unfortunatelly this is not what I mean.
 
 Have a look on this:
 http://www.globosapiens.net/hially
 A php page is redirecting this 404 error to another page, but I
 would like to have the URL stay the same like it is done on php.net

Then don't redirect to another URL but rather display whatever it is you want
to display. If nothing else, you can simply fetch the alternate URL for the
user like this:

readfile('http://www.google.com/');

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Difference between equal $_SERVER variables?

2003-07-24 Thread Ivo Fokkema
Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote Ivo Fokkema ([EMAIL PROTECTED]):
  Hi list,
 
  Just out of curiosity I would like to know if anyone can tell me the
  difference between some $_SERVER variables that generate the same output
(in
  my test-file at least).
 I would suggest reading up on the variables available
 http://www.php.net/manual/en/reserved.variables.php
Well, I've seen that, but for instance;

'PHP_SELF'
The filename of the currently executing script, relative to the document
root.
--and--
'SCRIPT_NAME'
Contains the current script's path.

doesn't mean much to me... They both return the same results to me, also.
When do these differ?



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



Re: [PHP] PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Robert Fitzpatrick
  if (!fputs($fp, $op, strlen($op))) {

 which HTTP version are you requesting? I know that if you send a
 HTTP/1.1 then a lot of servers send the data in chunks, thus your
 retrieval code needs to be different. If it is HTTP/1.1 try using
 HTTP/1.0 instead.

Same difference with the 1.0, I was using 1.1, here is the complete request
and response. The response comes back as 1.1 regardless of what I use (of
course, the xml parameter is urlencoded):

Request:
POST /XMLCommunicationServlet HTTP/1.0 Content-Type:
application/x-www-form-urlencoded User-Agent: PHP XMLRPC Host:
api.newedgenetworks.com:80 Connection: keep-alive Content-Length: 758
txnType=Ppartner=xml=%3C%3Fxml+version%3D%221.0%22%3F%3E%3C%21DOCTYPE+preq
ualrequest+SYSTEM+%22http%3A%2F%2Fapi.newedgenetworks.com%3A80%2Fdtd%2Fprequ
alrequest.dtd%22%3E%3CPrequalRequest%3E%3CIdentification%3E%3CUs
er%3Eusername%3C%2FUser%3E%3CPassword%3mypassword%3C%2FPassword%3E++
++%3C%2FIdentification%3E%3CServiceType%3ER%3C%2FServiceType%3E%3CAd
dress%3E+++%3CStreet1%3E2780+CEDARLINKS+DRIVE%3C%2FStreet1%3E+++%3CC
ity%3EMEDFORD%3C%2FCity%3E+++%3CState%3EOR%3C%2FState%3E+++%3CZipCD%
3E97504%3C%2FZipCD%3E%3C%2FAddress%3E%3CPhone%3E%3CPhoneNPA%
3E541%3C%2FPhoneNPA%3E%3CPhoneNXX%3E772%3C%2FPhoneNXX%3E%3CP
honeSuffix%3E6990%3C%2FPhoneSuffix%3E%3C%2FPhone%3E%3C%2FPrequalRequest%
3E

Response:
HTTP/1.1 200 OK Content-Type: text/xml Content-Length: 343 Date: Thu, 24 Jul
2003 15:18:52 GMT Server: Apache Coyote/1.0 Connection: Keep-Alive
1050Prequalification failed: AggregateCircuit unavailable

  $ipd = ;
  while($data=fread($fp, 32768)) {

 Have you tried smaller requests mabey 512? although that shouldn't
 matter, but you might be able to see if it is getting data back at
 all.

Yes, I've tried 128 and get the same delay.

Thanks for any help:)
--
Robert



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



[PHP] PHP Webpage like MySql- need to be able to see all fields and edit

2003-07-24 Thread Matt Hedges
Hello.  I am building a webpage for a sorority- http://www.olemissaoii.com .

I built a basic php script where they add the sisters and their names, grad.
date, and email.  Is there anyway to build a page that shows all the fields
where someone could go in and edit/add what they need?  What I basically
want is a webpage that works like MyCC SQL Database.  The only thing I've
been able to figure out is a basic update page, but using that they have to
type in everything again- so for example if they want to change the email
address, they'd have to retype the names and grad. date.  So I'd like a
script that shows all the rows and columns and allows someone to go in and
change whatever field they want.

Any help greatly appreciated,
Hedges




-- 
___
| Matt Hedges
| http://hedgesinnovations.com
|



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



Re: [PHP] REVISED: PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Robert Fitzpatrick
Sorry, the correct request and response is below, the one I copied before
was from the browser:

Request:
Request:brPOST /XMLCommunicationServlet HTTP/1.0
Content-Type: application/x-www-form-urlencoded
User-Agent: PHP XMLRPC
Host: api.newedgenetworks.com:80
Connection: keep-alive
Content-Length: 758

txnType=Ppartner=xml=%3C%3Fxml+version%3D%221.0%22%3F%3E%3C%21DOCTYPE+preq
ualrequest+SYSTEM+%22http%3A%2F%2Fapi.newedgenetworks.com%3A80%2Fdtd%2Fprequ
alrequest.dtd%22%3E%3CPrequalRequest%3E%3CIdentification%3E%3CUs
er%3E4036632%3C%2FUser%3E%3CPassword%3ELnKB8b%3C%2FPassword%3E%3
C%2FIdentification%3E%3CServiceType%3ER%3C%2FServiceType%3E%3CAddres
s%3E+++%3CStreet1%3E2780+CEDARLINKS+DRIVE%3C%2FStreet1%3E+++%3CCity%
3EMEDFORD%3C%2FCity%3E+++%3CState%3EOR%3C%2FState%3E+++%3CZipCD%3E97
504%3C%2FZipCD%3E%3C%2FAddress%3E%3CPhone%3E%3CPhoneNPA%3E54
1%3C%2FPhoneNPA%3E%3CPhoneNXX%3E772%3C%2FPhoneNXX%3E%3CPhone
Suffix%3E6990%3C%2FPhoneSuffix%3E%3C%2FPhone%3E%3C%2FPrequalRequest%3E

Response:
HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 343
Date: Thu, 24 Jul 2003 15:18:52 GMT
Server: Apache Coyote/1.0
Connection: Keep-Alive

?xml version=1.0?
!DOCTYPE PrequalResponse PUBLIC -//New Edge Networks//DTD Pilot
Prequalification Response 2.3//EN
http://api.newedgenetworks.com/dtd/prequalresponse.dtd;
PrequalResponse
 TransactionCodeCode1050/CodeMessagePrequalification failed:
AggregateCircuit unavailable/Message/TransactionCode
/PrequalResponse



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



RE: [PHP] PHP Webpage like MySql- need to be able to see all fields and edit

2003-07-24 Thread Jay Blanchard
[snip]
Hello.  I am building a webpage for a sorority-
http://www.olemissaoii.com .

I built a basic php script where they add the sisters and their names,
grad.
date, and email.  Is there anyway to build a page that shows all the
fields
where someone could go in and edit/add what they need?  What I basically
want is a webpage that works like MyCC SQL Database.  The only thing
I've
been able to figure out is a basic update page, but using that they have
to
type in everything again- so for example if they want to change the
email
address, they'd have to retype the names and grad. date.  So I'd like a
script that shows all the rows and columns and allows someone to go in
and
change whatever field they want.
[/snip]

I am an LSU kind of guy, but I think I can help. When a sis wants to
edit her stuff you recall the existiung stuff from the DB into the
various fields kinda like...

input type=text value=?php print($db_table_stuff); ?

HTH!

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



Re: [PHP] PHP Webpage like MySql- need to be able to see allfields and edit

2003-07-24 Thread Adam Voigt
Just select the values out, and put them as the default
in the value portion of the form inputs, example:

$query = mysql_query('select firstname,lastname from table where
id=1;');
$array = mysql_fetch_array($query);

input name=firstname value=?php echo $array['firstname']; ?
input name=lastname value=?php echo $array['lastname']; ?


On Thu, 2003-07-24 at 11:41, Matt Hedges wrote:
 Hello.  I am building a webpage for a sorority- http://www.olemissaoii.com .
 
 I built a basic php script where they add the sisters and their names, grad.
 date, and email.  Is there anyway to build a page that shows all the fields
 where someone could go in and edit/add what they need?  What I basically
 want is a webpage that works like MyCC SQL Database.  The only thing I've
 been able to figure out is a basic update page, but using that they have to
 type in everything again- so for example if they want to change the email
 address, they'd have to retype the names and grad. date.  So I'd like a
 script that shows all the rows and columns and allows someone to go in and
 change whatever field they want.
 
 Any help greatly appreciated,
 Hedges
 
 
 
 
 -- 
 ___
 | Matt Hedges
 | http://hedgesinnovations.com
 |
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



RE: [PHP] Software Application Engineer WANTED (PHP/MySQL Guru)

2003-07-24 Thread Dan Joseph
Aww heck, just go AWOL? :)

-Dan Joseph

 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:51 PM
 To: Richard Gabriel; [EMAIL PROTECTED]
 Subject: Re: [PHP] Software Application Engineer WANTED (PHP/MySQL Guru)
 
 
  Subject: [PHP] Software Application Engineer WANTED (PHP/MySQL Guru)
 
 I hope there are job postings like this if/when I get out of the Army! :)
 
 ---John Holmes...
 
 -- 
 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] uploading a file from a form

2003-07-24 Thread Amanda McComb
I am having a problem with uploading a file from a form.  I changed the
permission on the directory, but I am still getting an error.  Here is my
error:

Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed!

It looks like it's not finding the file type.  Here is my code:

? include(../includes/database.php); ?
?
$long_path = /home/vencel/www/images/apt/;
$short_path = ../images/apt/;

if (($REQUEST_METHOD=='POST')) {
   for(reset($HTTP_POST_VARS);
  $key=key($HTTP_POST_VARS);
  next($HTTP_POST_VARS)) {
 $this = addslashes($HTTP_POST_VARS[$key]);
 $this = strtr($this, ,  );
 $this = strtr($this, ,  );
 $this = strtr($this, |,  );
 $$key = $this;
   }


//Check for form fields, insert them.

//Pull out the id auto-incremented from previous insert.
  

//Check to see if a full-sized photo was uploaded
 if ($photo == none) { 
echo No photo.;
} else {
  $end = strrchr($photo_name, .);
echo $end;
  $new_photo_name = $company_id[0] . $end;

  if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) {
  echo Copy failed.;
  echo $long_path . company_logo/ . $photo_name;
echo $new_photo_name;

  } else {
$long_photo_path = $long_path . company_logo/ . $new_photo_name;
$photo_path = $short_path . company_logo/ . $new_photo_name;

if ([EMAIL PROTECTED]($long_path . logo/ . $photo_name,
   $long_photo_path)){
   echo Full sized photo not renamed.;
}
  }
}
$add_image_query .= UPDATE apt_company_t set
company_logo_path='$photo_path', ;
$add_image_query .= WHERE company_cd = $company_id[0];
  
mysql_query($add_image_query) or die(Update Failed!);
  

} 
} ?
FORM METHOD=post ACTION=? echo $PHP_SELF ?
table
TR
td colspan = 2BUse the iBrowse/i button to locate your file on
your computer or local network./B/td/tr
 
tr
tdCompany Logo File:  /tdtdinput type=file name=photo
size=30/td/tr

tr
td colspan=2 align=centerINPUT TYPE=submit VALUE=Add/td
/tr
/table
/FORM

Any ideas?




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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Pushpinder Singh Garcha
try this,

use a meta-refresh ...

echo META HTTP-EQUIV=\refresh\ 
content=\3;URL=http://wherever_u_wana_go.com/hello.html\;;

hth
--Pushpinder


On Thursday, July 24, 2003, at 11:24 PM, Beauford.2005 wrote:

It's obvious though that PHP can not handle it. This is why I am forced
to use javascript. I have already spent a week on this and am not going
to waste any further time. I have posted all my code and if someone can
see a problem I'll look at it, but it just ain't worth the effort at
this point.
-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: July 23, 2003 10:52 PM
To: Curt Zirzow
Cc: PHP
Subject: Re: [PHP] I'm really getting annoyed with PHP


On Thursday, July 24, 2003, at 12:18  PM, Curt Zirzow wrote:

And in my case I would never see the next page. I have javascript
turned
off.
Never rely on javascript to do the work, excpecially in small cases
like
this when php can handle it without any issues, such as javascript
being
turned off.
To follow on from this, the W3 accessibility guidelines
(http://www.w3.org/TR/WCAG10/checkpoint-list.html) state:
---
6.3  Ensure that pages are usable when scripts, applets, or other
programmatic objects are turned off or not supported.  If this is not
possible, provide equivalent information on an alternative accessible
page. [Priority 1]
For example, ensure that links that trigger scripts work when scripts
are turned off or not supported (e.g., do not use javascript: as the
link target). If it is not possible to make the page usable without
scripts, provide a text equivalent with the NOSCRIPT element, or use a
server-side script instead of a client-side script, or provide an
alternative accessible page as per checkpoint 11.4. Refer also to
guideline 1.
---
In short, do as much as you can server side (PHP), and ensure the page
doesn't break without JS.  Then use JS on the client side IF YOU MUST
to enhance the experience for those with it switched on.
Yes, it's more work, and yes this is optional (but be aware that SOCOG
(Sydney Olympics) were sued for having an inaccessible site, so it's
only a matter of time before we have huge class action everywhere :)),
and yes you'll reach a greater market share with an accessible page.
Sorry for getting OT

Justin

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] html and php in the same document

2003-07-24 Thread Bill Pilgrim
If php and html are to be included in the same document, does the document extension 
always have to be .php  ?  Are there ways to include php into an html document without 
changing the extension?
Thanks, Bill


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: [PHP] REVISED: PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Peter Clarke
Robert Fitzpatrick wrote:

Sorry, the correct request and response is below, the one I copied before
was from the browser:
Request:
Request:brPOST /XMLCommunicationServlet HTTP/1.0
Content-Type: application/x-www-form-urlencoded
User-Agent: PHP XMLRPC
Host: api.newedgenetworks.com:80
Connection: keep-alive
Try not having the connection kept alive. (just a thought)

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


Re: [PHP] REVISED: PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Curt Zirzow
* Thus wrote Robert Fitzpatrick ([EMAIL PROTECTED]):
 Sorry, the correct request and response is below, the one I copied before
 was from the browser:

I tested it here:
http://zirzow.dyndns.org/php/fread/timeout.php

Appears to work ok.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] command line or http browser?

2003-07-24 Thread ermelir
Hi list,

I search to detect if a script is call from command line or if the call from
a client http browser.
for doing that, I test if:
php_sapi_name()=='cli'
which returns TRUE if script calls from command line; this work fine with
PHP 4.2, but with PHP 5 php_sapi_name() returns cgi-fcgi
so, I would know if with others php version there is others returns values?
and if there is another way to detect if script is call from command line?
thanks in advance for yours answers
best regards



_
Envie de discuter en live avec vos amis ? Tlcharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1re messagerie instantane de France


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



Re: [PHP] html and php in the same document

2003-07-24 Thread Curt Zirzow
* Thus wrote Bill Pilgrim ([EMAIL PROTECTED]):
 If php and html are to be included in the same document, does the document extension 
 always have to be .php  ?  Are there ways to include php into an html document 
 without changing the extension?

Apache, IIS, Other?

If apache:

AddType application/x-httpd-php .php .html
add this ^

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] PHP Webpage like MySql- need to be able to see all fields and edit

2003-07-24 Thread Miles Thompson
Matt,

Juli Meloni has a tutorial on this at her web site. I think it's called 
something like Custom Error Messages and if I remember the fields are 
pulled from a database, and there are code examples of how it operates if 
fields are not completed, information fails a simple parsing test, etc.

Have a look at:
http://www.thickbook.com
It'll be worth your time.

Miles

At 12:41 PM 7/24/2003 -0300, Matt Hedges wrote:
Hello.  I am building a webpage for a sorority- http://www.olemissaoii.com .

I built a basic php script where they add the sisters and their names, grad.
date, and email.  Is there anyway to build a page that shows all the fields
where someone could go in and edit/add what they need?  What I basically
want is a webpage that works like MyCC SQL Database.  The only thing I've
been able to figure out is a basic update page, but using that they have to
type in everything again- so for example if they want to change the email
address, they'd have to retype the names and grad. date.  So I'd like a
script that shows all the rows and columns and allows someone to go in and
change whatever field they want.
Any help greatly appreciated,
Hedges


--
___
| Matt Hedges
| http://hedgesinnovations.com
|


--
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] html and php in the same document

2003-07-24 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
 * Thus wrote Bill Pilgrim ([EMAIL PROTECTED]):
  If php and html are to be included in the same document, does the document 
  extension always have to be .php  ?  Are there ways to include php into an html 
  document without changing the extension?
 
 Apache, IIS, Other?
 
 If apache:
 
 AddType application/x-httpd-php .php .html
 add this ^

Btw, thats in your system http.conf, and if you have permissions to
do that.



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Curt Zirzow
* Thus wrote Pushpinder Singh Garcha ([EMAIL PROTECTED]):
 try this,
 
 
 use a meta-refresh ...
 
 echo META HTTP-EQUIV=\refresh\ 
 content=\3;URL=http://wherever_u_wana_go.com/hello.html\;;

This has already been discussed, and is not the preferred method of
doing redirects. PHP can handle what he is doing just fine.

 

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] html and php in the same document

2003-07-24 Thread Miles Thompson
At 04:09 PM 7/24/2003 +, Curt Zirzow wrote:
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
 * Thus wrote Bill Pilgrim ([EMAIL PROTECTED]):
  If php and html are to be included in the same document, does the 
document extension always have to be .php  ?  Are there ways to include 
php into an html document without changing the extension?

 Apache, IIS, Other?

 If apache:

 AddType application/x-httpd-php .php .html
 add this ^

Btw, thats in your system http.conf, and if you have permissions to
do that.
And every .html page is parsed by PHP.
He will still have to turn PHP on and off within the page.
Unless he *really* wants to hide usage of PHP, I don't see the point of 
doing this.

Miles Thompson

PS Curt - Like the sigg.




Curt
--
I used to think I was indecisive, but now I'm not so sure.


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


Re: [PHP] command line or http browser?

2003-07-24 Thread Curt Zirzow
* Thus wrote ermelir ([EMAIL PROTECTED]):
 Hi list,
 
 I search to detect if a script is call from command line or if the call from
 a client http browser.
 for doing that, I test if:
 php_sapi_name()=='cli'
 which returns TRUE if script calls from command line; this work fine with
 PHP 4.2, but with PHP 5 php_sapi_name() returns cgi-fcgi
 so, I would know if with others php version there is others returns values?
 and if there is another way to detect if script is call from command line?
 thanks in advance for yours answers

This is a good point. I'm not aware of any other names, although I
have to admit i wan't aware of the sapi_name function either..  :)

There aught to be a better method of detecting whether you are in
cli mode or module mode. If this is the only way to determain it I
would make a suggestion to the php developers to have a way to
detect what mode your in.  Detecting by a string value is very poor
method of doing it.

Ok, now after reading the docs, I see why its a string Some one
came up with a list of names, I have no clue where he got it his
reference tells me nothing.

- aolserver
- activescript
- apache
- cgi-fcgi
- cgi
- isapi
- nsapi
- phttpd
- roxen
- java_servlet
- thttpd
- pi3web
- apache2filter
- caudium
- apache2handler
- tux
- webjames
- cli
- embed
- milter


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] removing parts of a string...

2003-07-24 Thread Tristan . Pretty
Cheers for your help...
I did this in the end...

$rest = substr($row[file_info], 27, 100);
$download = /home/sites/site1/web$rest;

where $row[file_info]   =   the full URL and the 27th character is the 
.com/ bit.

Live and learn, I love this language!

Cheers one and all!!
Tris...







R'twick Niceorgaw [EMAIL PROTECTED]
24/07/2003 15:18

 
To: [EMAIL PROTECTED]
cc: 
Subject:Re: [PHP] removing parts of a string...


On 24 Jul 2003 at 15:03, [EMAIL PROTECTED] wrote:

 I wanna be able to take a URL
 http://www.mysite.com/downloads/file_1_a.pdf
 
 and then remove:
 http;//www.mysite.com/
 
 then add:
 /host/sites/site1/web/
 
 to
 downloads/file_1_a.pdf
 
 Turning:
 http://www.mysite.com/downloads/file_1_a.pdf
 Into:
 /host/sites/site1/web/downloads/file_1_a.pdf
 
 I know I need to look up strings, but can someone point me in the
 right direction (I wanna learn, so don't give too much away!)
 

str_replace() ?


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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] html and php in the same document

2003-07-24 Thread John W. Holmes
Miles Thompson wrote:

At 04:09 PM 7/24/2003 +, Curt Zirzow wrote:

* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
 * Thus wrote Bill Pilgrim ([EMAIL PROTECTED]):
  If php and html are to be included in the same document, does the 
document extension always have to be .php  ?  Are there ways to 
include php into an html document without changing the extension?

 Apache, IIS, Other?

 If apache:

 AddType application/x-httpd-php .php .html
 add this ^

Btw, thats in your system http.conf, and if you have permissions to
do that.


And every .html page is parsed by PHP.
He will still have to turn PHP on and off within the page.
Unless he *really* wants to hide usage of PHP, I don't see the point of 
doing this.
Probably because he has a bunch of HTML pages that he wants to add a 
little PHP to, without renaming all of the pages and all of the links. 
Have the web server parse .html files and add in what you need. For 
.html files without PHP, there's a _little_ overhead for the parser to 
quickly look through it.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


[PHP] Hiding URL's...

2003-07-24 Thread Tristan . Pretty
I read this article, and thought it was perfect for me... Just the same 
prob I'm having...
http://forums.devshed.com/archive/5/2002/06/2/37330

However, I don't understand how to get the file into an A tag where it 
can still find the file, AND make the URL useless if copied and pasted..

Am I missing the point, or is it staring me in the face?


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] removing parts of a string...

2003-07-24 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Cheers for your help...
 I did this in the end...
 
 $rest = substr($row[file_info], 27, 100);
 $download = /home/sites/site1/web$rest;
 
 where $row[file_info]   =   the full URL and the 27th character is the 
 .com/ bit.

what if they use:
  http://mysite.com/download/file 
  
instead of:
  http://www.mysite.com/download/file

Your screwed!


If you don't want to use preg_match then look at strrchr.

Then of course what if they type:
  http://www.mysite.com/download/file?break=program

Are you safe from that too?

Make sure your safe in all conditions!

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] REVISED: PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Robert Fitzpatrick

 Try not having the connection kept alive. (just a thought)


Same long reponse :(



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



Re: [PHP] removing parts of a string...

2003-07-24 Thread Tristan . Pretty
Never thought of that...
Luckily, this function is gonna be held on a server for downloads only, 
and all the requests are gonna come straight from the 'master' site else 
where.
So I really shouldn't run into probs right now...
I will however lookinto making it that little bit more idiot proof after I 
finish on the current prob I'm on ;-)

Roll on Friday!






Curt Zirzow [EMAIL PROTECTED]
24/07/2003 17:29

 
To: [EMAIL PROTECTED]
cc: 
Subject:Re: [PHP] removing parts of a string...


* Thus wrote [EMAIL PROTECTED] 
([EMAIL PROTECTED]):
 Cheers for your help...
 I did this in the end...
 
 $rest = substr($row[file_info], 27, 100);
 $download = /home/sites/site1/web$rest;
 
 where $row[file_info]   =   the full URL and the 27th character is the 
 .com/ bit.

what if they use:
  http://mysite.com/download/file 
 
instead of:
  http://www.mysite.com/download/file

Your screwed!


If you don't want to use preg_match then look at strrchr.

Then of course what if they type:
  http://www.mysite.com/download/file?break=program

Are you safe from that too?

Make sure your safe in all conditions!


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Hiding URL's...

2003-07-24 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 I read this article, and thought it was perfect for me... Just the same 
 prob I'm having...
 http://forums.devshed.com/archive/5/2002/06/2/37330

You mean i have to read all that?

 
 However, I don't understand how to get the file into an A tag where it 
 can still find the file, AND make the URL useless if copied and pasted..
 
 Am I missing the point, or is it staring me in the face?
 

You put the link to the script that is doing the fpassthrough.

 
 *
 The information contained in this e-mail message is intended only for 
 the personal and confidential use of the recipient(s) named above.  
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby 
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is 
 strictly prohibited. If you have received this communication in error, 
 please notify us immediately by e-mail, and delete the original message.
 ***

Ya know this that is very noisy. And I wasted my time reading it.
 
HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Re: Redirection Question (I spoke to soon)

2003-07-24 Thread Brian Tully
on 7/24/03 8:13 PM, Beauford.2005 at [EMAIL PROTECTED] wrote:

 
 FORM onSubmit=return checkrequired(this) ACTION=season-write.php
 action=post name=testing
 

someone else already raised this issue and it doesn't look like you caught
it: you have two actions in your form (the second should probably read
method=post), e.g.,

form name=testing method=post action=season-write.php
onSubmit=return checkrequired(this);

is your form even submitting to season-write.php?

the other potential issue is that you mentioned your redirect function is
within an external include file. since you moved the code from one server to
another, make sure that the include file is in the correct path since the
paths may be different on the new server. you could test by doing some
debugging such as 

require(/path/to/include_file) or die(could not find include file);

brian


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



Re: [PHP] Hiding URL's...

2003-07-24 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote:
 I read this article, and thought it was perfect for me...
 Just the same prob I'm having...
 http://forums.devshed.com/archive/5/2002/06/2/37330
 
 However, I don't understand how to get the file into an A tag
 where it can still find the file, AND make the URL useless if
 copied and pasted..

The URL in your link will be to a PHP page that you write, not the document you
want them to receive. For example:

a href=http://example.org/getfile.php?file=/tmp/file.txt;Click/a

Something like that, anyway. Your getfile.php script is responsible for:

1. Making sure the filename sent from the client ($_GET['file']) is something
they have access to. You probably want to make sure it's not /etc/passwd or
something, right?
2. Fetching the file from the filesystem. You just read it in like any other
file. The readfile() function is probably handy here.
3. Sending the appropriate content type header, such as header('Content-Type:
text/plain');

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] PHP with XML on Windows XP

2003-07-24 Thread Sam
I have recently upgraded a server which I use for development:
Windows XP Home
Apache 1.3.26
MySQL 3.23
PHP 4.3.2 with Pear

Everything seemed to go well, except that now I James Clarks expat does
not work.  Very confused on this one I have uninstalled expat and
re-installed
Trying different versions including the latest release all to no avail.
PHPInfo lists the extension as being installed although any script using
the extension never manages to load.  The expat extension works out of
the box with php I would prefer to not have to reinstall php since I
have configured xslt which was not a lot of fun.

SS aka Fru2ty

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003
 


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



[PHP] phpTidy problems (xhtml)

2003-07-24 Thread Pedro Arellano
I want to be able to output the contents of my website in xhtml.  There it
an opensource program called phpTidy which ties into HTML Tidy that can
format all of your html into xhtml or xml.  The only problem, I cant get it
to work correctly.  Does anyone have experience in working with this script?

Here is the error that i get: (and yes, the directory /tidytemp/ is set to
be writable to..)

Warning: file(/home/wireless/tidytemp/2199e3ebfabddfc7c43ab4255d0f8e28.tmp):
failed to open stream: No such file or directory in
/home/wireless/bin/phptidyht.php on line 478

Warning: implode(): Bad arguments. in /home/wireless/bin/phptidyht.php on
line 478


*
Html Tidy Errors and Warnings for the Following PHP Generated Page:
Page Title: WGR Wireless Gaming Review: The Site for the Mobile Gamer
Script Name: /home/wireless/public_html/rollout/layout/template_bottom.inc
Get Variables: No Get Variables Sent
Post Variables: action=
Script Line: 100
Time: 07/24/2003:12:33:40:PM

***

thanks in advance for any help you can provide...




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



Re: [PHP] REVISED: PHP timeout doing fread from Apache Coyote

2003-07-24 Thread Robert Fitzpatrick

 I tested it here:
 http://zirzow.dyndns.org/php/fread/timeout.php


Thanks, I took your source and pasted it in my debugger and ran it fine like
on your server. I narrowed down the, evidently significant, difference. Your
content is has crlf line endings, hence, the 'Missing query parameters:
xml' response. If I change those line endings to just lf or put it all on
one continuous line, I get the long delay again.

Any thoughts I what would cause this?

--
Robert



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



[PHP] Re: Hiding URL's...

2003-07-24 Thread Bobby Patel
If you want to restrict the download to once per user, the best is to use a
database (or a I guess a file) which keeps tracks of who can download it and
downloaded status, etc..

I haven't worked directly with this issue, but I would start by having a
table Permissions with columns username, articleID, downloaded, authKey (and
whatever else you may want). Then present the link to the user as
getFile.php?auth=$authKey.
where getFile.php is
?php
$query = select downloaded, articleID from Permissions Where authKey =
$_POST['auth'];
$result = mysql_query ($query);
if ($result) {
$row = mysql_fetch_array ($result, MYSQL_ASSOC);
if ($row ['downloaded'] == 'N') {
# Update table and set downloaded = 'Y'
# Select the text of article from Articles table or from disk and
store in variable $contents
header (content/type pdf); # or text/plain, or whatever type you
need
echo $contents;
exit();
}
}
?

OK, I got tired of coding near the end (since I know you can do that), but I
think that this may be better. If you just pass the file name to the script
then you have to do checks that the user has access but how? Unless the user
already logged in to a members area I guess.

Anyways, there are problems to this script, for example if the download was
terminated half way through, it's already set that it has been downloaded
(maybe you can do the update query after the echo $contents, but I don't
think that will help).

That's my $0.02
Bobby


Tristan Pretty [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
com...
 I read this article, and thought it was perfect for me... Just the same
 prob I'm having...
 http://forums.devshed.com/archive/5/2002/06/2/37330

 However, I don't understand how to get the file into an A tag where it
 can still find the file, AND make the URL useless if copied and pasted..

 Am I missing the point, or is it staring me in the face?


 *
 The information contained in this e-mail message is intended only for
 the personal and confidential use of the recipient(s) named above.
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is
 strictly prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original message.
 ***





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



Re: [PHP] PHP CGI mode and command line variables

2003-07-24 Thread CDitty
That worked like a charm.  Thanks Chris.  I've added this to my snippet 
collection.  :)

At 12:02 AM 7/24/2003, Chris Shiflett wrote:
--- CDitty [EMAIL PROTECTED] wrote:
 Thanks man.  That got rid of the error, however it is not using the
 variable in the script.
You have to read them in. I think you can just loop through $argv, so 
something
like this will show you what PHP is receiving:

?
echo A total of $argc parameters are available:\n\n;
foreach ($argv as $curr_parameter)
{
 echo $curr_parameter\n;
}
?
Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/


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


[PHP] just looking for some opinions...

2003-07-24 Thread Dan Joseph
Hi,

Just looking for an opinion on how you would do this...

Let's say I have a number: 1281924

The rules call for removing 1280+, meaning remove 128 and all 0's that
come after it, until you run into another number.

In the end, it would leave 1924, and everything else on the beginning would
be gone.

How would you setup your logic for this?

-Dan Joseph


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



Re: [PHP] just looking for some opinions...

2003-07-24 Thread CPT John W. Holmes
 Let's say I have a number: 1281924

 The rules call for removing 1280+, meaning remove 128 and all 0's that
 come after it, until you run into another number.

 In the end, it would leave 1924, and everything else on the beginning
would
 be gone.

$new_number = preg_replace('/^1280+/','',$number);

---John Holmes...


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



RE: [PHP] just looking for some opinions...

2003-07-24 Thread Ford, Mike [LSS]
 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: 24 July 2003 18:44
 
  Let's say I have a number: 1281924
 
  The rules call for removing 1280+, meaning remove 128 and 
 all 0's that
  come after it, until you run into another number.
 
  In the end, it would leave 1924, and everything else on the 
 beginning
 would
  be gone.
 
 $new_number = preg_replace('/^1280+/','',$number);

Beat me to exactly that solution by a hairsbreadth!

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] command line or http browser?

2003-07-24 Thread ermelir
thanks for your answer and sorry for my poor english ;)
in the list of returns values, there somes I can't determine if command line
or server values
* isapi
* nsapi
* embed
* milter
* activescript
* java_servlet
do you know?
thanks for your help


- Original Message -
From: Curt Zirzow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 6:22 PM
Subject: Re: [PHP] command line or http browser?


 * Thus wrote ermelir ([EMAIL PROTECTED]):
  Hi list,
 
  I search to detect if a script is call from command line or if the call
from
  a client http browser.
  for doing that, I test if:
  php_sapi_name()=='cli'
  which returns TRUE if script calls from command line; this work fine
with
  PHP 4.2, but with PHP 5 php_sapi_name() returns cgi-fcgi
  so, I would know if with others php version there is others returns
values?
  and if there is another way to detect if script is call from command
line?
  thanks in advance for yours answers

 This is a good point. I'm not aware of any other names, although I
 have to admit i wan't aware of the sapi_name function either..  :)

 There aught to be a better method of detecting whether you are in
 cli mode or module mode. If this is the only way to determain it I
 would make a suggestion to the php developers to have a way to
 detect what mode your in.  Detecting by a string value is very poor
 method of doing it.

 Ok, now after reading the docs, I see why its a string Some one
 came up with a list of names, I have no clue where he got it his
 reference tells me nothing.

 - aolserver
 - activescript
 - apache
 - cgi-fcgi
 - cgi
 - isapi
 - nsapi
 - phttpd
 - roxen
 - java_servlet
 - thttpd
 - pi3web
 - apache2filter
 - caudium
 - apache2handler
 - tux
 - webjames
 - cli
 - embed
 - milter


 Curt
 --
 I used to think I was indecisive, but now I'm not so sure.

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

 _
 Envie de discuter en live avec vos amis ? Télécharger MSN Messenger
 http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France

_
Envie de discuter en live avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


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



RE: [PHP] just looking for some opinions...

2003-07-24 Thread Dan Joseph
Thanks John,

You and 4 others (3 private direct replies) all gave me the same
suggestion.  I have no idea why I never think to use a regex...  Appreciate
the thought!

-Dan Joseph

 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 1:44 PM
 To: Dan Joseph; [EMAIL PROTECTED]
 Subject: Re: [PHP] just looking for some opinions...


  Let's say I have a number: 1281924
 
  The rules call for removing 1280+, meaning remove 128 and all 0's that
  come after it, until you run into another number.
 
  In the end, it would leave 1924, and everything else on the beginning
 would
  be gone.

 $new_number = preg_replace('/^1280+/','',$number);

 ---John Holmes...



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



  1   2   >