[PHP] ' and " in sql query

2002-01-04 Thread Daniel Harik

Hello

Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors

Thank You

  

-- 
Best regards,
 Daniel  mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] special chars in SQL string

2002-01-04 Thread Daniel Harik

Hello

Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors

Thank You

  

-- 
Best regards,
 Daniel  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] special chars in SQL string

2002-01-04 Thread Richard Black

Doesn't putting a backslash in front of the offending character escape it??
Isn't that what the PHP addslashes() function does???

Richy


-Original Message-
From:   Daniel Harik [SMTP:[EMAIL PROTECTED]]
Sent:   03 January 2002 19:00
To: [EMAIL PROTECTED]
Subject:[PHP] special chars in SQL string

Hello

Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors

Thank You

  

-- 
Best regards,
 Daniel  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with function declaration in include files

2002-01-04 Thread Bobby

I have been using the following function declaration syntax for ages with no
problems.

Main php file:




Include file:


}
...
http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: application variable

2002-01-04 Thread Tim Ward

I think what you mean is sessions, but that can't really do what you want.
The best you can do is record on the database when the user last accessed a
page of the site and infer if they are currently logged in or not.

I would be interested to know how ASP does better than this in a response
driven environment. You could force a user to formally log off, but what if
they just close their browser, or their internet connection, or IE just
stops working on their PC (the most likely). This is also a problem with
inferring a current log in from the last hit by that user name.

Tim
www.chessish.com  

--
From:  Ye Tun [SMTP:[EMAIL PROTECTED]]
Sent:  04 January 2002 02:21
To:  [EMAIL PROTECTED]
Subject:  application variable

Do we have application variable in PHP as in ASP?

I have a small database running with user name and password kept in
MySQL
database.  Once user is login, how can I prevent the same user from
logging in again?

REgards,

Ye


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: File opening, writting and location

2002-01-04 Thread Tim Ward

http://www.php.net/manual/en/ref.filesystem.php
  everything you need is
here, in particular fgets.

What you'll need is something like ...
If ($fhandle = fopen("filename", "r"))
{   while ($fline = fgets($fhandle) && ++$count < $X)
{   echo($fline);
}
}

this is untested but should work

Tim
www.chessish.com  

--
From:  RRNews [SMTP:[EMAIL PROTECTED]]
Sent:  03 January 2002 03:20
To:  [EMAIL PROTECTED]
Subject:  File opening, writting and location

I'm a newbie to PHP and the web.
I've been programming in VB for about 3 years and XBase for about
15.

I would like to place a bunch of text files in a directory and have
a PHP
script pick them up and place the top X lines in a center section of
a page
followed by a MORE link.  It would do this for Y number of articles.
The
remainder it would title with the first x characters and place it on
the
right of the screen (like an archive)

I know that I can use a function similar to fopen in XBase to access
the
text files and extract the lines.
In Xbase, I would traverse the directory, extract the lines, place
the X
characters in a string followed by a "More".

If anyone can steer me in the right direction, I would appreciate
it. I
don't get how you place things on the page in a given area. I'm
using
Dreamweaver 4 templates.

Anyone have any suggestions.
Thanks in advance...
Jerry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] "; PHPSESSID" in onfocus field

2002-01-04 Thread gkin

I have a website where I use sessions. After a user has logged of, the logon
screen appears again. The username field is filled with the value from a
cookie.

What happens:

For example: username = "Peter"

In the situation that I log of (and the logon page appears), the username
field gets the value from the cookie and the string "; PHPSESSID". ("Peter;
PHPSESSID")

When I close the browser window and open a new browser window the value of
the username is correct ("Peter"). The string "; PHPSESSID" is not in the
cookie. What is the reason that this string (the variable name for session
id as set in my php.ini) appears in this field?

In other words, why is the session_id variable name displayed in a field
that is filled by a cookie. I also tried to end the session, but the only
thing I can find is destroy_session and that only destroys everything that
is within that session, but it does not kill the session itsselfs

How do I solve this problem.

Regards,

Gilbert



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] REMOTE_ADDR in requied files

2002-01-04 Thread Jan Muzik

When I call function stored in another file, included with require
command, variable $REMOTE_ADDR is empty in this function. How is that
possible?? Thanks for help.

Jan Muzik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] REMOTE_ADDR in requied files

2002-01-04 Thread Intruder

>> When I call function stored in another file, included with require
>> command, variable $REMOTE_ADDR is empty in this function. How is that
>> possible?? Thanks for help.

function Funcname() {
global $REMOTE_ADDR;

...funcbody...
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Checking for characters in string

2002-01-04 Thread Richard Black


Hi,

I'm writing a page which will allow user's to register for an online service. They 
register a username and password.

I want the password to contain at least one lowercase letter, at least one upper case 
letter, and at least one digit. So 

passW0rd would be valid, but password would not.

Whats the most compact way to do this? substr? ereg?

Richy

==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Checking for characters in string

2002-01-04 Thread Intruder

>> Whats the most compact way to do this? substr? ereg?

I think regular expressions is the best way because working with strings
looks like this:

if ($strtolower($pass)!=$pass) && ($strtoupper($pass)!=$pass) {
  echo "OK!";
} else {
  echo "WRONG!";
}

but using reg expr it's even more shorter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sending variables between PHP pages

2002-01-04 Thread Berlina

Hi users,

how can I send a connection database variable, from one PHP page to other
PHP page, and maintance the database connection open during both pages?

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder

>> how can I send a connection database variable, from one PHP page to other
>> PHP page, and maintance the database connection open during both pages?

I don't think one can do that. There is NO need for that. You can write
header.php file and
include it in the beginning of each PHP page where you need db connection
and footer.php
which you can include at the bottom of each page with X_close() function
in it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder

>> Yes, thanks a lot, but i need to mantain the connection open for manage a
>> transaction, an everytime that I open a new database connection,
>> the system
>> begins a new transaction and I lose the last one.
>> Do you understand, me?
>> Do you know the way for do that?

I think it is imposimble in web applications at all, because there is no
persistent connection between db server
and "web server + PHP" service. You can try for example mysql_pconnect()
function (or it's analog for your db engine)
but still I don't think it is possible ;(((
Only applications can make this for you NOT PHP and Web ;(((



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending variables between PHP pages

2002-01-04 Thread Berlina

Yes, Im thinking the same...
:-((

Thanks again Intruder


- Original Message -
From: "Intruder" <[EMAIL PROTECTED]>
To: "Berlina" <[EMAIL PROTECTED]>; "php-general-list"
<[EMAIL PROTECTED]>; "php-dev-list" <[EMAIL PROTECTED]>;
"php-db-list" <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 12:38 PM
Subject: RE: [PHP] Sending variables between PHP pages


> >> Yes, thanks a lot, but i need to mantain the connection open for manage
a
> >> transaction, an everytime that I open a new database connection,
> >> the system
> >> begins a new transaction and I lose the last one.
> >> Do you understand, me?
> >> Do you know the way for do that?
>
> I think it is imposimble in web applications at all, because there is no
> persistent connection between db server
> and "web server + PHP" service. You can try for example mysql_pconnect()
> function (or it's analog for your db engine)
> but still I don't think it is possible ;(((
> Only applications can make this for you NOT PHP and Web ;(((
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems with uploading even small files

2002-01-04 Thread Screwy

I'm trying to upload files using php to a server on the lan.

Apache/1.3.22, PHP 4.0.6, MySQL 3.23.40

My problem is that file uploads are slow, a <50KB file takes around 5
minutes.
Thats kilobytes. in 5 minutes. Larger files just timeout.

I've set the max file sizes in apache and php configs, although my files are
nowhere near the maximum yet.

does anyone know what i'm doing wrong?

thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] A compress function?

2002-01-04 Thread Gaylen Fraley

With all the wonderful String functions in PHP, I haven't been able to find
a str_compress().  Is there such an animal?  Let's say I have a string like
this:

$myString = First_word  <30 spaces> second_word <10 spaces> etc...

I need to do one of two things.  Either compress the multiple spaces to one
and then use explode to break the string on a single space, or can someone
explain another way to break $myString into  only those pieces that contain
usable text w/o spaces?

Thanks!

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] From 4.1 to 4.04pl1

2002-01-04 Thread Julio Nobrega Trabalhando

  Hi everybody,

  On my dev machine I have php 4.1. I have now to upload a huge script half
ported to 4.1 from 4.06 on a host where 4.04pl1 runs.

  By 'half-ported' I mean almost every file I changed global $form_var or
function($form_var) to $_POST['form_var'].

  But it will not work since it's not a var that existed ($_POST, $_SESSION,
etc...) and different scope.

  I have a main file where maybe I can do $_POST = $HTTP_POST_VARS. But I
can't scape from the scope problem.

  Anyway to make $_POST/$_SESSION/etc global on all functions on all files?

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 4 Jan 2002 12:25:49 -0000 Issue 1091

2002-01-04 Thread php-general-digest-help


php-general Digest 4 Jan 2002 12:25:49 - Issue 1091

Topics (messages 79407 through 79450):

Re: User-friendly URI's
79407 by: Philip Hallstrom
79408 by: Jason Murray
79409 by: Mike Eheler
79410 by: Mike Eheler
79411 by: Philip Hallstrom
79413 by: Philip Hallstrom
79419 by: Jonathan David Edwin Wright
79423 by: Opec Kemp
79426 by: php3.developersdesk.com

Re: An idea for a PHP tool
79412 by: Mike Eheler
79421 by: David Minor

Problem with Printer-friendly script
79414 by: ski-info
79422 by: Miles Thompson
79431 by: Torrent
79432 by: Torrent

Re: how can I add a variable to this sample
79415 by: Tom Beidler

File Upload Question - Previewing .jpgs
79416 by: Anthony Ritter
79420 by: Bogdan Stancescu

Re: More on images...
79417 by: Matthew Walker

Re: Session troubles
79418 by: Sean LeBlanc

Re: Regular Expression
79424 by: [-^-!-%-

Re: Extract a string from a string
79425 by: qartis

session question (4.1.1)
79427 by: Jon Niola
79429 by: David

Re: file uploading => dumping into ram?
79428 by: David

draw image graph with uptime command
79430 by: Daniel Masur

' and " in sql query
79433 by: Daniel Harik

special chars in SQL string
79434 by: Daniel Harik
79435 by: Richard Black

Problem with function declaration in include files
79436 by: Bobby

Re: application variable
79437 by: Tim Ward

Re: File opening, writting and location
79438 by: Tim Ward

"; PHPSESSID" in onfocus field
79439 by: gkin

REMOTE_ADDR in requied files
79440 by: Jan Muzik
79441 by: Intruder

Checking for characters in string
79442 by: Richard Black
79443 by: Intruder

Sending variables between PHP pages
79444 by: Berlina
79445 by: Intruder
79446 by: Intruder
79447 by: Berlina

Problems with uploading even small files
79448 by: Screwy

A compress function?
79449 by: Gaylen Fraley

>From 4.1 to 4.04pl1
79450 by: Julio Nobrega Trabalhando

Administrivia:

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

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

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


--

--- Begin Message ---

True, but if I remember right, the hit will end up in your error_log not
in your access_log.

-philip

On Fri, 4 Jan 2002, Jason Murray wrote:

> > A 404 ErrorDoc would still reply with a 404 code, which could mess up
> > some search engines.
>
> Not true, try this: www.inww.com/ifdbnifoudbvfd
>
> This is actually produced by "ErrorDocument 404 /404.php3" in our Apache
> configuration, and 404.php3 is a PHP script that sends the neccessary stuff
> to be seen as a 404 to a web browser (thats basically a  tag of "404
> Not Found").
>
> You could just as easily subvert 404.php3 to do redirects or include
> other stuff to produce the neccessary pages without sending the 404 bits
> (and we do, we recently moved all our PDF files into a database and use
> 404.php3 to silently redirect to the database-drawn version of the file).
>
> > I was thinking of the .htaccess solution, but I'm not sure if that's
> > possible to force only certain files or perhaps all files in just a
> > certain directory to all be application/x-httpd-php?
>
> I believe you can force a single file. I haven't done it, I'm sure
> someone else around here can. :)
>
> Jason
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--- End Message ---
--- Begin Message ---

> True, but if I remember right, the hit will end up in your 
> error_log not in your access_log.

Ah. Bugger.

But since this would require messing with your Apache config
you could adjust that anyway surely?

J

--- End Message ---
--- Begin Message ---

I don't want to mess with the whole site, just a file or 10, or one 
directory, etc.

Mike

Jason Murray wrote:

>>True, but if I remember right, the hit will end up in your 
>>error_log not in your access_log.
>>
> 
> Ah. Bugger.
> 
> But since this would require messing with your Apache config
> you could adjust that anyway surely?
> 
> J
> 


--- End Message ---
--- Begin Message ---

That's the whole point of this thread.. that's what I want to avoid. I 
want to have a URI that is easier to remember, and less ugly, and also 
provides a sense of security (even if it is only a faint sense) through 
obscurity.

Mike

Philip Hallstrom wrote:

> Why not just make the script name "news.php" and not worry about it?
> 
> On Thu, 3 Jan 2002, Mike Eheler wrote:
> 
> 
>>A 404 ErrorDoc would still reply with a 404 code, which

RE: [PHP] Problem with Printer-friendly script

2002-01-04 Thread Miles Thompson


I don't, because if MySQL caused the problem you would see it on the 
original page. I'venot worked with
fsockopen(), is there any way you can test it without hitting the database, 
which may be causing a delay?

What I'm thinking is to take the page created in the original call 
(www.ski-info-online.com/skiResort-print1.php?id=Alpbach), store it as 
straight HTML, then call it using the same technique used in the "Printer 
Friendly" code. This is puzzling.

Miles

At 07:53 AM 1/4/2002 +, Torrent wrote:
>Oh, btw, the data is extracted from a MySQL database.
>How do you see that affecting the problem?
>
>Tx
>Torrent
>www.ski-info-online.com
>
>
>-Original Message-
>From: Miles Thompson [mailto:[EMAIL PROTECTED]]
>Sent: 04 January 2002 01:30
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: Re: [PHP] Problem with Printer-friendly script
>
>
>It's reasonably fast in Internet Explorer, and didn't complete in Netscape
>4.7.
>
>The characters I saw were similar to yours, except that I saw fd0 (the
>floppy!?) instead of fd6.
>Could they be artifacts in the data stream?
>
>Does the initial page,
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
>database? from a flat file?
>
>What happens if you fetch the default length of 1k?
>
>Miles  Thompson
>
>
>At 12:30 AM 1/4/2002 +, ski-info wrote:
> >I am in the process of producing a script which will allow me to produce
> >printer-friendly versions of my dynamically produced web pages.
> >
> >For the most part it is working but take a look here...
> >
> >www.ski-info-online.com/skiResort-print1.php?id=Alpbach
> >
> >If you click the "Print Review" button it all seems to work fine, except
> >1) it's slow and...
> >2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
> >
> >Where on Earth did they come from?  They are not in the html (as you would
> >also see them on the main review page). They also appear to be the cause of
> >the
> >script running slow.
> >
> >Here is my php code.
> >
> >PHP:---
>-
> >
> >
> > >header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> >header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
> >header("Cache-Control: no-cache, must-revalidate");
> >header("Cache-Control: post-check=0,pre-check=0");
> >header("Cache-Control: max-age=0");
> >header("Pragma: no-cache");
> >
> >if ($HTTP_REFERER){
> > $myURL = $HTTP_REFERER;
> >} else {
> > $myURL = "http://www.ski-info-online.com/";;
> >}
> >
> >$START_CONT="";
> >$END_CONT = "";
> >
> >$parsed_url = parse_url($myURL);
> >$myServer = $parsed_url['host'];
> >$document = $parsed_url['path'];
> >$query = $parsed_url['query'];
> >
> >if($document[strlen($document)-1]=='/'){
> > $document = "$document/index.php";
> > $base_url = dirname($document);
> >}
> >
> >$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
> >
> >$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
> >$request .= "Host: $myServer\r\n\r\n";
> >
> >if(!$fp) {
> >   echo "$errstr ($errno)\n";
> >} else {
> >   fputs($fp,$request);
> >   $content=0;
> >   $in_title=0;
> >?>
> > >{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
> >$line; } fclose($fp); ?>
> >
> >--
> >Copyright © Ski-Info-Online.com. All rights reserved.
> >
> >
> > >}
> >?>
> >
> >---
>-
> >
> >
> >
> >Any help greatly appreciated.
> >
> >Torrent
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with function declaration in include files

2002-01-04 Thread Dennis Moore




The problem is most likely with your include statement.  The include 
path imay be incorrect...  
 
 
 
"Bobby" <[EMAIL PROTECTED]> wrote in 
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...> 
I have been using the following function declaration syntax for ages with 
no> problems.> > Main php file:> > 
> include "my-inc.php";> ...>     
FuncExample(arg1,arg2);> ...> ?>> > > 
Include file:> > > ...> 
FuncExample(arg1,arg2){> > }> 
...> > > I have just finished some work for a 
client, after full testing on both my> Unix and Win32 test servers I 
moved the site over to their hosting company> and I get the following 
problem.> > All my functions that are declared in my Inc files are 
spitting back the> error:> > "Fatal error: Call to 
undefined function:..."> > I have spoken with the hosting company, 
but they have considerable trouble> with 'backside' and 'elbow' 
recognition.> > Are there any PHP.ini settings that affect this 
type of function> declaration?> > Any help would be 
appreciated.> > Bobby> > > > > 
> -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, 
e-mail: [EMAIL PROTECTED]> 
For additional commands, e-mail: [EMAIL PROTECTED]> 
To contact the list administrators, e-mail: [EMAIL PROTECTED]> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] A compress function?

2002-01-04 Thread Emil Rasmussen

Hey

> With all the wonderful String functions in PHP, I haven't been able to
find
> a str_compress().  Is there such an animal?  Let's say I have a string
like
> this:
>
> $myString = First_word  <30 spaces> second_word <10 spaces> etc...

This would proberly work:
--
function str_compress($stString) {

if (substr_count($stString,'  ') == 0) {
return $stString;
}

$stString = str_replace('  ',' ',$stString);

return str_compress($stString);
}


echo str_compress('dsfsd fdf sdf sdfd sf sf sdf
sf  s fdsf sdfsdf sfsfsd sfs   sf ');
--

Regards Emil

ps. I admit that I dont know if there is a built in function.

--
Emil Rasmussen
http://noget.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending variables between PHP pages

2002-01-04 Thread Henning Sprang

Am 04 Jan 2002 12:49:41 +0100 schrieb Berlina:
> Yes, Im thinking the same...
> :-((
> 
> Thanks again Intruder
> 
> 
> - Original Message -
> From: "Intruder" <[EMAIL PROTECTED]>
> To: "Berlina" <[EMAIL PROTECTED]>; "php-general-list"
> <[EMAIL PROTECTED]>; "php-dev-list" <[EMAIL PROTECTED]>;
> "php-db-list" <[EMAIL PROTECTED]>
> Sent: Friday, January 04, 2002 12:38 PM
> Subject: RE: [PHP] Sending variables between PHP pages
> 
> 
> > >> Yes, thanks a lot, but i need to mantain the connection open for
manage
> a
> > >> transaction, an everytime that I open a new database connection,
> > >> the system
> > >> begins a new transaction and I lose the last one.
> > >> Do you understand, me?
> > >> Do you know the way for do that?
> >
> > I think it is imposimble in web applications at all, because there
is no
> > persistent connection between db server
> > and "web server + PHP" service. You can try for example
mysql_pconnect()
> > function (or it's analog for your db engine)
> > but still I don't think it is possible ;(((
> > Only applications can make this for you NOT PHP and Web ;(((

I don't see the problem? What do you really want to do?

Can't you go and use php sessions to save data generated in multiple
pageviews of the web application, and when you finished all data
collection from the user, at the last page you go and make your DB
transaction to save all the data.
If you worry that some data could be changed in the meantime you can
even add a timestamp column in your database and check if it's still the
same before doing something like, e.g. updating a database row on the
last page.
So i don't see why a transaction _must_ live over multiple pages and not
only start on the last one when input is finished.

Anyway, the last sentence is double wrong - you can make _real_ GUI
application with php-gtk, see gtk.php.net, and then, i can think of web
applications that _could_ do something like that, even if I don't know
one that does it - sure you could create a server side, web based
software that would let db connections and even transactions alive even
after a request and sending out the answer is done(which is the way php,
CGI Programs, and i suppose nearly all other Web based software works),
save the state of db connections as session data and use the same
database connection again with the next request, but i think that brings
some problems.
E.g. I could fire thousands of programs that stay alive on the server
just by sending some http requests - that wouldn't be very nice for
folks runnning the webservers.

Writing more clearly what the purpose of all that is migth bring me
another view of this all...


greets,
henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: An idea for a PHP tool

2002-01-04 Thread J Smith


If anybody out there is using Konqueror, try setting up an item in the 
Enhanced Browsing dialog with a shortcut like "php" and the search URI set 
to "http://www.php.net/manual-lookup.php?pattern=\1";. Now you can go to the 
location textbox and enter something like "php:fsockopen" to bring up the 
manual page for fsockopen().

J



Mike Eheler wrote:

> Like google has it's toolbar, why not have a PHP Manual toolbar? That
> would be *great*. Just type in the function name and hit "go" and the
> manual comes up.
> 
> One for Moz & one for IE I'm sure would be appreciated.
> 
> I'd do it myself, but I have not the ability to code in C (or C++ for
> that matter), nor the time. So I donate this idea to the PHP community
> in hopes that someone out there has the knowledge and the ambition to
> make it happen.
> 
> Mike


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PHP-DB] php+mysql simple query help me pls! ty.

2002-01-04 Thread Rick Emery

Test the mysql_query() return value:
$result = mysql_query("SELECT * FROM members") or
die("Error:".mysql_error());

there may be an error in your query.

-Original Message-
From: louie miranda [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 1:59 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] php+mysql simple query help me pls! ty.


Hi, can someone help me here! :(
I can't query the data on my sql from php.
db is fine, i couldnt see the prob in php!
pls help, ty.



# MSQL ###
mysql> desc members;
+--+-+--+-+-++
| Field| Type| Null | Key | Default | Extra  |
+--+-+--+-+-++
| id   | tinyint(5)  |  | PRI | NULL| auto_increment |
| ircname  | varchar(30) | YES  | | NULL||
| email| varchar(30) | YES  | | NULL||
| realname | varchar(40) | YES  | | NULL||
| asl  | varchar(30) | YES  | | NULL||
| info | varchar(70) | YES  | | NULL||
+--+-+--+-+-++



# PHP 



n", mysql_result($result,0,"ircname"));
printf("email: %sn", mysql_result($result,0,"email"));
printf("realname: %sn", mysql_result($result,0,"realname"));
printf("asl: %sn", mysql_result($result,0,"asl"));
printf("info: %sn", mysql_result($result,0,"info"));

?>





# ERROR 


  Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 13
ircname:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 14
email:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 15
realname:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 16
asl:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 17
info:
n


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Error Logging Question

2002-01-04 Thread TD - Sales International Holland B.V.

Hey there,

I'm playing around with the logging options in the php.ini file.
I set this:
display_errors = Off

Because I don't want to visitors to see any errors (besides the errors I 
define myself in the PHP script, which is exactly what this does... I only 
print out things like can't open database which doesn't reveal sensitive data 
like paths and host)
log_errors = On

I need the error ofcourse :-)

now I had error_log set. However, my error log resides in a root write only 
directory. My apache logs have NO problem with these permissions (apache logs 
are u root g root rw-r--r--) however appearantly PHP gets started only by the 
forked processes because it CAN'T write to a root log file if it's set in 
error_log
so I unset error_log, now apache takes over the logging appearantly because 
the errors now show up in my apache error_log which is kewl. But this is what 
I have a question about

I have not yet configured my own apache like this, but I saw this at my ISP. 
What they do is make VirtualHost containers in which each virtual host has 
their own log files. This is absolutely cool, because I can't read the log 
files from others and they can't read mine. But every user can read their own 
webserver logs. (you can't get into the user directory so you can't read the 
files either). Anyways, the question would be, if I don't fill in the 
error_log tag like I did now, will the errors in such a setup go to the 
general error file or does it go to the virtual host log file of the 
virtualhost it belongs too?

Thanks in advance and have a great weekend ya'll

Ferry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Licensing??

2002-01-04 Thread Michael A. Peters

On Thu, 3 Jan 2002 09:58:03 +0100
"TD - Sales International Holland B.V." <[EMAIL PROTECTED]> mentioned:

> On Wednesday 02 January 2002 20:14, Michael A. Peters stuffed this into
my 
> mailbox:
> 
> Hmm but ClibPDF is an additional library package which is not part of
the PHP 
> engine right? 
> 
> regards
> 

Yes, you need to specify ClibPDF as a build option and have the library
and headers already on your system to build it.

But I thought it important to note because there are php binaries floating
around that staticly linked against this (and other) libraries that
sometimes are used by people who are not aware that they need license to
use that particular function of php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Script accesses complete harddrive. what did I do wrong?

2002-01-04 Thread christian_holler

Hi,

I have a big security hole in my php and I cannot get out why:

 Operating system: Windows XP
 PHP version:  4.1.1
 Bug description:  Script accesses harddrive. what did I do wrong?
 
 I installed Apache 1.3.20 with PHP and now I saw, a php script can show my
 complete harddrive remotly. I don't know if it is a bug in php, I think
 not, I think I configured something wrong but I have ABSOLUTLY no idea what
 and I didn't find help anywhere. maybe you can tell me what this could be.
 
 
 thanks a lot

P.S.: how can I configure that scripts only access things in the directory they where 
executed or in their subdirs?

chris
 


Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problems with php 4.1.1 (strtok?)

2002-01-04 Thread Robert Mena

Hi,
I have a script to upload/insert records in a mysql
db.  I was running fine before the upgrade (php
4.0.4pl1) now it confuses the columns starting with
the column number 9.

I've attached a one line file that I used with the
scripts. the problem seems to be with strok and null
values.  One of the columns is empty so I have
value1\t\tvalue2 and it seems to confuse itself.

The script that parses the line is like this

$C_F=strtok($line,"\t");
$dt=strtok("\t");
$DT=strtok("\t");


Using the same script under php4.0.6 with the same
upload file it shows (correct) :
insert into table values
values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO
PAULO','47.427.653/0014-30','109726','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','','','','','','','','','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','','7D,22H','')

Using the same script under php4.1.1 with the same 
upload file it shows (incorrect 02 at column number 9)
: 
insert into cargas values
values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO
PAULO','47.427.653/0014-30','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','7D,22H','050210972604.679.080/0001-0447.427.653/0014-30091330','/
/','','','','','','','','','109726')

Thanks.

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

05  2001110101/11/0110:01   MYCOMPANY   04.679.080/0001-04 
 OTHERCOMPANYSP-SAO PAULO47.427.653/0014-30  109726  02  
091330  15  VOL PROD383,100010075/01EQT-0001
EQT-0001
01/11/0108:00   01/11/0118:00   09/11/0108:00   09/11/01   
 08:00   7D,22H  050210972604.679.080/0001-0447.427.653/0014-30091330/  /  
  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] PEAR

2002-01-04 Thread harry

Hi all

I have been trying to use PEAR and have come to a standstill.

The following:

setCache("true");
  echo "TEST 1";
  //$p->toHtml();
  echo "TEST 2";
 // $p->setTitle("Jobsite Page");

  $p->display();



require_once ("HTML/Form.php");



 /*This is where the class is initialised */
 $f = new HTML_Form( 'test.php', "POST", "form", "harry.php" );
 /* This is the first button and it is for text entry
the following variables are set in order
$name $title $default $size */

$f->addText( "textname" , "Username" , "1" , 30 );



 /* This is the second two buttons and it is for semi secure
entry of text the  following variables are set in order
$name $title $default $size */
$f->addPassword( "passname" , "Password" , 1 , 30 );


 
$f->addCheckbox( "checkname" , "Yes or No",  30 );





$f->addTextarea( "textareaname" , "Text Area" ,"" , 60 , 3 );
  

$f->addSubmit();



$f->addReset();

/* I am not sure as to what the parameters are meant to be 
for this but this is as far as I got will try again later.
It produces the first error in this code*/

//$f->addSelect( "passname" , "Select" , "none"  ); //, "none"  , 3 
 , 5 

, true, "" );


/* From what I can see the function DisplayRadioRow is missing for
addRAdio function */

//$f->addRadio( "passname" , "Select"  , "", ""  ); //, "none"  , 3 
 , 5 

, true, "" );




$f->end();
$f->display();



?>






Produces the following error:

 TEST 1TEST 2
Warning: Cannot add header information - headers already sent by (output 
started at /var/www/html/website/jobix/php_test/test_form.php:4) in 
/usr/share/php/HTML/Page.php on line 136
  
Could anyone point me to a good PEAR tutorial with lots of examples. Google 
produces lots of them but they are all  lacking in examples for forms, 
tables etc. I am new so I am probably looking at the wrong place. I am 
reading the source to learn it but this error has shown me how little I 
know about it. The above example is me going through the source trying to 
build a standard web page with all the relevant headers etc.

Any help would be much appreciated
-- 

Harry Jackson

::
21
::
"Slang is a language that rolls up its sleeves and goes to wrork."
Carl Sandbury.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP-Friendly WYSIWYG HTML Editor

2002-01-04 Thread Brandon

G'day!

I'm a full-time university student, and also serve on a part-time basis
(during vacations, holidays, etc.) as the Systems
Administrator/Webmaster/PHP Guru/Computer Trainer for my library back home.
Another work term is coming to an end soon, and in my absence, there will be
no PHP/HTML-savvy staff onsite - just me, several hundred kilometres away.

As the subject header pretty clearly lays out, I'm looking for a WYSIWYG
HTML editor that isn't going to go and h4x0r webpages which contain PHP
source that I've written to automate several tasks they perform. So far,
I've tried the following without success:

- Adobe PageMill. It came free with PageMaker; nice, except it arbitrarily
replaces things like http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Script accesses complete harddrive. what did I do wrong?

2002-01-04 Thread harry

Christian Holler wrote:

> Hi,
> 
> I have a big security hole in my php and I cannot get out why:
> 
>  Operating system: Windows XP
>  PHP version:  4.1.1
>  Bug description:  Script accesses harddrive. what did I do wrong?
>  
>  I installed Apache 1.3.20 with PHP and now I saw, a php script can show
>  my complete harddrive remotly. I don't know if it is a bug in php, I
>  think not, I think I configured something wrong but I have ABSOLUTLY no
>  idea what and I didn't find help anywhere. maybe you can tell me what
>  this could be.
>  
>  
>  thanks a lot
> 
> P.S.: how can I configure that scripts only access things in the directory
> they where executed or in their subdirs?
> 
> chris
>  
> 
> 
> Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
> Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13

Do not quote me but I think your apache settings may be incorrect. I think 
you can limit your Server Side Scripts to certain directories.

-- 

Harry Jackson

::
22
::
"Private faces in public places,
Are wiser and nicer,
Than public faces in private places."
Wystan Hugh Auden

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: User-friendly URI's

2002-01-04 Thread Philip Hallstrom

AddType application/x-httpd-php .php .php3 .whatever

-philip

On Fri, 4 Jan 2002, Jamie Fields wrote:

> How do you set up apache to recognize .whatever as a php extension?
>
> - Original Message -
> From: "Philip Hallstrom" <[EMAIL PROTECTED]>
> To: "Mike Eheler" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, January 03, 2002 7:35 PM
> Subject: [PHP] Re: User-friendly URI's
>
>
> > You could always name the file "news.mike" and then tell apache that .mike
> > is a PHP extension :)
> >
> >
> >
> > -philip
> >
> > On Thu, 3 Jan 2002, Mike Eheler wrote:
> >
> > > That's the whole point of this thread.. that's what I want to avoid. I
> > > want to have a URI that is easier to remember, and less ugly, and also
> > > provides a sense of security (even if it is only a faint sense) through
> > > obscurity.
> > >
> > > Mike
> > >
> > > Philip Hallstrom wrote:
> > >
> > > > Why not just make the script name "news.php" and not worry about it?
> > > >
> > > > On Thu, 3 Jan 2002, Mike Eheler wrote:
> > > >
> > > >
> > > >>A 404 ErrorDoc would still reply with a 404 code, which could mess up
> > > >>some search engines.
> > > >>
> > > >>I was thinking of the .htaccess solution, but I'm not sure if that's
> > > >>possible to force only certain files or perhaps all files in just a
> > > >>certain directory to all be application/x-httpd-php?
> > > >>
> > > >>I guess that would be the best solution. :)
> > > >>
> > > >>Or would it? What if I have an images/ subfolder.. I certainly
> wouldn't
> > > >>want all my images being thrown through PHP. That could cause some
> > > >>ugliness. So I guess it would have to be un-doable. Is it?
> > > >>
> > > >>Mike
> > > >>
> > > >>Jason Murray wrote:
> > > >>
> > > >>
> > > "news" would actually be a PHP script, of course. I know how
> > > to handle /2002/01/02/keyword as parameters, my question is on
> > > making "news" be interpreted through PHP.
> > > 
> > > 
> > > >>>Off the top of my head...
> > > >>>
> > > >>>You could either use a .htaccess to force Apache to recognise
> > > >>>"news" as a PHP script, or you could use a Custom 404 page to
> > > >>>figure out what the heck the original URL was trying to get at
> > > >>>and silently substitute in the resulting page.
> > > >>>
> > > >>>A Custom 404 might be easier, but would have a bit more supporting
> > > >>>infrastructure at the code end for a big site.
> > > >>>
> > > >>>Apologies if this is incorrect, I just may not be thinking
> > > >>>too clearly today :)
> > > >>>
> > > >>>Jason
> > > >>>
> > > >>>
> > > >>
> > > >>--
> > > >>PHP General Mailing List (http://www.php.net/)
> > > >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >>For additional commands, e-mail: [EMAIL PROTECTED]
> > > >>To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > > >>
> > > >>
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Script accesses complete harddrive. what did I do wrong?

2002-01-04 Thread Miles Thompson

This is an Apache question, not a PHP one. I don't know if your Apache 
configuration file is named apache.conf or httpd.conf under Windows, but 
whatever it is, check these settings:

ServerRoot - should be set to the location where Apache is installed.
DocumentRoot = set to where your web files are located.
DirectoryIndex - should be set to the default file names, e.g index.htm, 
index.html, index.php

plus one more, which automatically has theeffect of adding a trailing slash 
to an URL, so that you do not get a directory listing.

This is a start - Miles

At 03:52 PM 1/4/2002 +0100, [EMAIL PROTECTED] wrote:
>Hi,
>
>I have a big security hole in my php and I cannot get out why:
>
>  Operating system: Windows XP
>  PHP version:  4.1.1
>  Bug description:  Script accesses harddrive. what did I do wrong?
>
>  I installed Apache 1.3.20 with PHP and now I saw, a php script can show my
>  complete harddrive remotly. I don't know if it is a bug in php, I think
>  not, I think I configured something wrong but I have ABSOLUTLY no idea what
>  and I didn't find help anywhere. maybe you can tell me what this could be.
>
>
>  thanks a lot
>
>P.S.: how can I configure that scripts only access things in the directory 
>they where executed or in their subdirs?
>
>chris
>
>
>
>Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
>Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Dave Brotherstone

Use the pconnect functions.  These do exactly that.

eg. mysql_pconnect() at the top of your page, and it will re-use the
database connection for you.
mysql_close() won't close a permanent connection.

Please don't post general questions to the php-dev list.  This is for
development OF PHP, not IN PHP.

Dave.

> -Original Message-
> From: Berlina [mailto:[EMAIL PROTECTED]]
> Sent: 04 January 2002 11:16
> To: php-general-list; php-dev-list; php-db-list
> Subject: [PHP] Sending variables between PHP pages
>
>
> Hi users,
>
> how can I send a connection database variable, from one PHP page to other
> PHP page, and maintance the database connection open during both pages?
>
> Thanks
>
> --


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Grammar

2002-01-04 Thread JJVG

Hi,

Is there a place where I can get the PHP Grammar?

TIA,
Juan



[PHP] Re: A compress function?

2002-01-04 Thread George Nicolae

take a look at http://www.php.net/manual/en/function.bzcompress.php

--


Best regards,
George Nicolae
IT Manager
___
X-Playin - Professional Web Design
www.x-playin.f2s.com



"Gaylen Fraley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> With all the wonderful String functions in PHP, I haven't been able to
find
> a str_compress().  Is there such an animal?  Let's say I have a string
like
> this:
>
> $myString = First_word  <30 spaces> second_word <10 spaces> etc...
>
> I need to do one of two things.  Either compress the multiple spaces to
one
> and then use explode to break the string on a single space, or can someone
> explain another way to break $myString into  only those pieces that
contain
> usable text w/o spaces?
>
> Thanks!
>
> --
> Gaylen
> [EMAIL PROTECTED]
> Home http://www.gaylenandmargie.com/
> PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with function declaration in include files

2002-01-04 Thread Bobby

I wish it was that simple, I have already added debug 'echo' statements to
make sure the included file is being included correctly and it is?

This problem really has me beat, I never usually send out desperate pleas,
but I am not a happy bunny atm.

Any thoughts would be appreciated

Cheers



Bobby
"Dennis Moore" <[EMAIL PROTECTED]> wrote in message
003501c19526$a0968740$[EMAIL PROTECTED]">news:003501c19526$a0968740$[EMAIL PROTECTED]...
The problem is most likely with your include statement.  The include path
imay be incorrect...



"Bobby" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been using the following function declaration syntax for ages with
no
> problems.
>
> Main php file:
>
>  include "my-inc.php";
> ...
> FuncExample(arg1,arg2);
> ...
> ?>
>
>
> Include file:
>
>  ...
> FuncExample(arg1,arg2){
> 
> }
> ...
> 
> I have just finished some work for a client, after full testing on both my
> Unix and Win32 test servers I moved the site over to their hosting company
> and I get the following problem.
>
> All my functions that are declared in my Inc files are spitting back the
> error:
>
> "Fatal error: Call to undefined function:..."
>
> I have spoken with the hosting company, but they have considerable trouble
> with 'backside' and 'elbow' recognition.
>
> Are there any PHP.ini settings that affect this type of function
> declaration?
>
> Any help would be appreciated.
>
> Bobby
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Problem with Printer-friendly script

2002-01-04 Thread Dennis Gearon

Every now and then, I get a corrupted htm file. It ends up with characters in it
that DON'T show up in the editor. I usually have to type the whole thing again.
Maybe that's what's happened here?

"ski-info" <[EMAIL PROTECTED]> wrote:
>I am in the process of producing a script which will allow me to produce
>printer-friendly versions of my dynamically produced web pages.
>
>For the most part it is working but take a look here...
>
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach
>
>If you click the "Print Review" button it all seems to work fine, except
>1) it's slow and...
>2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
>
>Where on Earth did they come from?  They are not in the html (as you would
>also see them on the main review page). They also appear to be the cause of
>the
>script running slow.
>
>Here is my php code.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Encoding Code

2002-01-04 Thread Devin Atencio


I have mcrypt installed and I would like to encrypt
Like say a block of code then insert it into a database.
It looks like when I encrypt more than 1 word it seems
To get weird on me and doesn't encrypt or decrypt 
Correctly.

Does anyone know how I can encrypt like a paragraph
And then beable to have it decrypt the entire thing
Correctly?

  __\/__ 
  .  / ^  _ \  . 
  |\| (o)(o) |/| 
#.OOOo--oo--oOOO.---# 
#   # 
#   Devin Atencio [EMAIL PROTECTED] # 
#   Sys Admin Dept  # 
#_Oooo._# 
  .oooO   (   ) 
  (   )) / 
   \ ((_/ 
\_)
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] draw image graph with uptime command

2002-01-04 Thread Austin Gonyou






x axis= 0 - 365 (time in days)

y axis= 0 - 100(or 1 depending on the value you're taking for utilization. It's best to convert it into %.) (percent util)



After that you'll need some way of being able to plot  y/x or Percent util over time. After that, it should be easy. 







On Fri, 2002-01-04 at 01:54, Daniel Masur wrote: 
> what i want to do is, parsing the "uptime" command in suse, get the
> stats
> for 1, 5 and 15 minute cpu utilisation, and draw an image.
> 
> just like the taskmanager in win windows 2000, xp, and nt.anybody did
> this
> before?
> 
> should look like this:
>   /
> |    /
> |/\/
> |___/\/
> |  /
> |/__
> uptime: 68days
> 
> 
> parsing the uptime command, isnt a problem, but how to coordinate the 3
> values in the image.
> 
> also i have the ability, to save all values in a mysql db.
> 
> anybody can help?
> 
> ps, i never worked with images in php before...
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-698-7250
email: [EMAIL PROTECTED]

"It is the part of a good shepherd to shear his flock, not to skin it."
Latin Proverb








signature.asc
Description: This is a digitally signed message part


Re: [PHP] PHP Grammar

2002-01-04 Thread Henning Sprang

Am 04 Jan 2002 14:53:18 -0200 schrieb JJVG:
> Hi,
> 
> Is there a place where I can get the PHP Grammar?

http://download.php.net/manual/en/langref.php


have fun,
henning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: ' and " in sql query

2002-01-04 Thread Philip Hallstrom

addslashes() would work... or use an ereg_replace to do it.  Provided that
you only use single quotes in your SQL (which is a good idea anyway since
other db's only allow you to use single quotes) then you only have a
problem with single quotes and not double quotes.

On Thu, 3 Jan 2002, Daniel Harik wrote:

> Hello
>
> Guys how can escape chars like ' and " so that MySQL doesn't report me
> errors all the time, for example when i try to add data like "It's", i
> always have errors
>
> Thank You
>
>
>
> --
> Best regards,
>  Daniel  mailto:[EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] win2k..grrr

2002-01-04 Thread Kunal Jhunjhunwala

Hey,
Does anyone know WHY form scripts, that submit to themselves, dont work on
windows boxes?? Example :
I have a script called mail.php. The first part of the script displays the
form whos action states, mail.php. When the form is submitted, the second
part of the script mails the form details out.. this works fine on linux..
but on windows, only part one is displayed again and again... when i
seperate the 2 components, it works fine.
Regards,
Kunal Jhunjhunwala


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] compilation of PHP with SNMP support

2002-01-04 Thread Jason Signalness

Hello,

I am having trouble compiling php with snmp support. ucd-snmp 4.2.2 is 
installed and working without trouble. PHP4.1.1 configures ok but fails 
on make, giving many errors similar to this:

/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_next':
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111: 
multiple definition of `sa_find_next'
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_specific':
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120: 
multiple definition of `sa_find_specific'
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120:
 
first defined here

My PHP configure options are:
./configure \
--with-apxs=/opt/apache/bin/apxs \
--with-oci8 \
--with-ldap \
--with-gd=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr/X11R6 \
--enable-sigchild \
--with-imap \
--enable-xslt \
--with-xslt-sablot \
--enable-wddx \
--with-snmp=/usr/local \
--enable-ucd-snmp-hack \
--with-openssl

Please CC me on any replies, as I don't subscribe to php-general.  Any 
ideas would be greatly appreciated.

Thanks in advance
-- 
Jason Signalness, Systems Administrator
Basin Telecommunications, Inc.
[EMAIL PROTECTED](701)355-5727
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] win2k..grrr

2002-01-04 Thread Frank M. Kromann

I do that all the time without any problems.

Could you give us a (small) sample script ?

- Frank

> Hey,
> Does anyone know WHY form scripts, that submit to themselves, dont work on
> windows boxes?? Example :
> I have a script called mail.php. The first part of the script displays the
> form whos action states, mail.php. When the form is submitted, the second
> part of the script mails the form details out.. this works fine on linux..
> but on windows, only part one is displayed again and again... when i
> seperate the 2 components, it works fine.
> Regards,
> Kunal Jhunjhunwala
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: win2k..grrr

2002-01-04 Thread George Nicolae

i tell you why. because on instalation you use php.ini-optimized. file. copy
in your win2k director the php.ini-dist as php.ini. After that the script
will work. I don't know what is set in optimized ini file and your script
not work.

--


Best regards,
George Nicolae
IT Manager
___
X-Playin - Professional Web Design
www.x-playin.f2s.com



"Kunal Jhunjhunwala" <[EMAIL PROTECTED]> wrote in message
015501c19547$82434d70$0301a8c0@CONFUSED">news:015501c19547$82434d70$0301a8c0@CONFUSED...
> Hey,
> Does anyone know WHY form scripts, that submit to themselves, dont work on
> windows boxes?? Example :
> I have a script called mail.php. The first part of the script displays the
> form whos action states, mail.php. When the form is submitted, the second
> part of the script mails the form details out.. this works fine on linux..
> but on windows, only part one is displayed again and again... when i
> seperate the 2 components, it works fine.
> Regards,
> Kunal Jhunjhunwala
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with Printer-friendly script

2002-01-04 Thread Torrent


Appreciate the help on this one.

I have not worked with fsockopen before either (I only
started php about 6 weeks ago which also doesn't help).
I am almost certain the delay isn't with the database because
at the point where the pause is the query has already been
executed and the result returned (all of that page's content
comes from the Db).  Thanks for the suggestion though.

Do you know of another way I could accomplish this? Someone
on my site's forum suggested that I could perhaps use fpassthru().

I've not used this function before but thought I would take a
look at it.  What do you think?

Also, I have noticed that if I select different resorts I get
different hex numbers come up. So it must have something to
do with the content.  I checked to see if the numbers were
equivalent to the number of characters upto that point
(including any html tags) but they are way off.

This is stumping a lot of people.

Thanks again for your help with this.
Torrent


-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2002 12:27
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Problem with Printer-friendly script



I don't, because if MySQL caused the problem you would see it on the
original page. I'venot worked with
fsockopen(), is there any way you can test it without hitting the database,
which may be causing a delay?

What I'm thinking is to take the page created in the original call
(www.ski-info-online.com/skiResort-print1.php?id=Alpbach), store it as
straight HTML, then call it using the same technique used in the "Printer
Friendly" code. This is puzzling.

Miles

At 07:53 AM 1/4/2002 +, Torrent wrote:
>Oh, btw, the data is extracted from a MySQL database.
>How do you see that affecting the problem?
>
>Tx
>Torrent
>www.ski-info-online.com
>
>
>-Original Message-
>From: Miles Thompson [mailto:[EMAIL PROTECTED]]
>Sent: 04 January 2002 01:30
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: Re: [PHP] Problem with Printer-friendly script
>
>
>It's reasonably fast in Internet Explorer, and didn't complete in Netscape
>4.7.
>
>The characters I saw were similar to yours, except that I saw fd0 (the
>floppy!?) instead of fd6.
>Could they be artifacts in the data stream?
>
>Does the initial page,
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
>database? from a flat file?
>
>What happens if you fetch the default length of 1k?
>
>Miles  Thompson
>
>
>At 12:30 AM 1/4/2002 +, ski-info wrote:
> >I am in the process of producing a script which will allow me to produce
> >printer-friendly versions of my dynamically produced web pages.
> >
> >For the most part it is working but take a look here...
> >
> >www.ski-info-online.com/skiResort-print1.php?id=Alpbach
> >
> >If you click the "Print Review" button it all seems to work fine, except
> >1) it's slow and...
> >2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
> >
> >Where on Earth did they come from?  They are not in the html (as you
would
> >also see them on the main review page). They also appear to be the cause
of
> >the
> >script running slow.
> >
> >Here is my php code.
> >
>
>PHP:---
>-
> >
> >
> > >header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> >header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
> >header("Cache-Control: no-cache, must-revalidate");
> >header("Cache-Control: post-check=0,pre-check=0");
> >header("Cache-Control: max-age=0");
> >header("Pragma: no-cache");
> >
> >if ($HTTP_REFERER){
> > $myURL = $HTTP_REFERER;
> >} else {
> > $myURL = "http://www.ski-info-online.com/";;
> >}
> >
> >$START_CONT="";
> >$END_CONT = "";
> >
> >$parsed_url = parse_url($myURL);
> >$myServer = $parsed_url['host'];
> >$document = $parsed_url['path'];
> >$query = $parsed_url['query'];
> >
> >if($document[strlen($document)-1]=='/'){
> > $document = "$document/index.php";
> > $base_url = dirname($document);
> >}
> >
> >$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
> >
> >$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
> >$request .= "Host: $myServer\r\n\r\n";
> >
> >if(!$fp) {
> >   echo "$errstr ($errno)\n";
> >} else {
> >   fputs($fp,$request);
> >   $content=0;
> >   $in_title=0;
> >?>
> > >{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
> >$line; } fclose($fp); ?>
> >
> >--
> >Copyright © Ski-Info-Online.com. All rights reserved.
> >
> >
> > >}
> >?>
> >
>
>---
>-
> >
> >
> >
> >Any help greatly appreciated.
> >
> >Torrent
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail:

[PHP] NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!

2002-01-04 Thread Mark

I apologize if the title of this post sounds overly aggresive, but I have
followed the instructions to a 'T' and got nowhere!!  I have tried the
"auto" install version of PHP and manual instructions for installing PHP
4.1.1.  Neither of them work.  I added the lines to my httpd.conf file for
both types of installs (not at the same time) as discribed in the
Install.txt file, along with the instructions on the website, and can get no
"test" scripts to run or PHP for that matter.  All I get is a blank screen
when running the CGI version or can not even get apache to load when I try
the Module version (Get a "Requested Operation Failed" message).  can
someone please help?  My system is as follows:

Windows 2000 SP2
Apache 2.0.28 (I have also tried version 1.3.22 with same results as
mentioned above)
PHP 4.1.1
MDAC 2.7
MySQL 3.23.46a

Thanks in advance!!

Mark



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: win2k..grrr

2002-01-04 Thread Kunal Jhunjhunwala

nopes.. dint do the trick.. anything else??
Regards,
Kunal Jhunjhunwala
- Original Message -
From: "George Nicolae" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 11:52 PM
Subject: [PHP] Re: win2k..grrr


> i tell you why. because on instalation you use php.ini-optimized. file.
copy
> in your win2k director the php.ini-dist as php.ini. After that the script
> will work. I don't know what is set in optimized ini file and your script
> not work.
>
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> "Kunal Jhunjhunwala" <[EMAIL PROTECTED]> wrote in message
> 015501c19547$82434d70$0301a8c0@CONFUSED">news:015501c19547$82434d70$0301a8c0@CONFUSED...
> > Hey,
> > Does anyone know WHY form scripts, that submit to themselves, dont work
on
> > windows boxes?? Example :
> > I have a script called mail.php. The first part of the script displays
the
> > form whos action states, mail.php. When the form is submitted, the
second
> > part of the script mails the form details out.. this works fine on
linux..
> > but on windows, only part one is displayed again and again... when i
> > seperate the 2 components, it works fine.
> > Regards,
> > Kunal Jhunjhunwala
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Modulus and floating point...

2002-01-04 Thread Boget, Chris

Consider the following:

$number = 102.52;

echo $number % 50;
echo bcmod( $number, 50 );

in both cases, it's spitting out "2".  Why is it not spitting
out "2.52"?  Is there a way I can get that information?
w/o having to parse the string, breaking it up, getting
the modulus and then adding it back into the end result...?

Chris



[PHP] pass variable from php script to another php script

2002-01-04 Thread toni baker

I would like to pass the "$text" variable to the body
of an email message in another php script.  
The code is below:

< -- upload.php -- >
if (!$file=fopen(text.txt", "r")) {
echo "Could not open file";
  }
  else {
$text=fread($file, 100);
fclose($file);
  }

< -- mail.php -- >
$to = "[EMAIL PROTECTED]";
$subj = "The Subject";
$body="\nBegin" .
  "\n" . quotemeta ($a) .
  "\n" . quotemeta ($b) .
  "\n" . quotemeta ($c) .
  "\nEnd" .
  "\n" . $text;
$header="From: " . $email .
"\r\nReply-To: [EMAIL PROTECTED]";

$success = mail ($to, $subj, $body, $header);

I can echo the "$text" variable to my web form, but
not
to the email body of another php script.  Is this
possible?  How can I get the "$text" variable to
display in the body of my email message?  Thanks

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] draw image graph with uptime command

2002-01-04 Thread php3

Addressed to: "Daniel Masur" <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from "Daniel Masur" <[EMAIL PROTECTED]> Fri, 4 Jan 2002 08:54:00 
+0100

> anybody can help?
>
> ps, i never worked with images in php before...


Take a look at:

  http://www.aditus.nu/jpgraph/

Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] pass variable from php script to another php script

2002-01-04 Thread Kevin Stone

It all depends on how you're calling the script.  Obviously these variables
are not system globals.  So if the mail.php script is being accessed
separately from the upload.php script they will not share variables.
However if you include("mail.php"); from within upload.php, then it
automaticaly inherets any variables set from within that script.

However if this is not possible, and you're accessing the scripts
separately, you can use session control to pass variables from one script to
another.  You use session_start(); and register the variable,
session_register("text");  Then Launch the mail.php script manualy and you
have access to $text by its short name if "register_globals" is turned on..
or by $HTTP_SESSION_VARS["text"] if "register_globals" is turned off.

Hope this helps.

-Kevin

- Original Message -
From: "toni baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 12:13 PM
Subject: [PHP] pass variable from php script to another php script


> I would like to pass the "$text" variable to the body
> of an email message in another php script.
> The code is below:
>
> < -- upload.php -- >
> if (!$file=fopen(text.txt", "r")) {
> echo "Could not open file";
>   }
>   else {
> $text=fread($file, 100);
> fclose($file);
>   }
>
> < -- mail.php -- >
> $to = "[EMAIL PROTECTED]";
> $subj = "The Subject";
> $body="\nBegin" .
>   "\n" . quotemeta ($a) .
>   "\n" . quotemeta ($b) .
>   "\n" . quotemeta ($c) .
>   "\nEnd" .
>   "\n" . $text;
> $header="From: " . $email .
> "\r\nReply-To: [EMAIL PROTECTED]";
>
> $success = mail ($to, $subj, $body, $header);
>
> I can echo the "$text" variable to my web form, but
> not
> to the email body of another php script.  Is this
> possible?  How can I get the "$text" variable to
> display in the body of my email message?  Thanks
>
> __
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: DOM XML?

2002-01-04 Thread Jeff Warrington

In <[EMAIL PROTECTED]>, Yasuo Ohgaki wrote:

> Daniele Baroncelli wrote:
> 
>> Hello,
>> 
>> I would like to restyle one big site in XML and I would like some brief
>> straight info/suggestions.
>> 
>> I am definitely interested in DOM XML, but as far as I can understand,
>> the module is still experimental and there to main risks: - The module
>> is not completely stable - The functions are likely to change
>> 
>> Are you able to confirm me these?
> 

I would agree that the DMO stuff isn't 100% stable but it
is already functional enough to be usable. I have been
using the DOM stuff in a production enviornment including
the XPath functionality for a good four or five months
now without major problems. The XSLT functionality is
coming along nicely as well.

I would suggest at least playing around with it to see
if it fits your needs. I think you will find advantages
to using it over the saxon-style stuff in the other
XML PHP functions, especially if you utilize the
XPath search functionality.

Jeff


> 
> You are right about this.
> But please use it and report bugs if you find one. The more users, it
> will be more stable quickly.
> 
> Please also try latest snapshot for experimental modules/functions.
> http://snaps.php.net/
> 
> 
> 
>> As an alternative, it seems the only safe way to develop XML in PHP is
>> by using the Expat module.
>> 
>> Is this your view too?
> 
> 
> I would say yes, but you may experience problem(s).
> 
> 
>> In any case, are you able to indicate some good web references for XML
>> in PHP ?
>> 
>> 
>> 
> I don't know this one ;)
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Modulus and floating point...

2002-01-04 Thread Bogdan Stancescu

You can consider doing this:
$number=102.52;
$fraction=$number-floor($number);
$number=($number % 50)+$fraction;

Basically it's the exact solution you're suggesting, just that you don't
have to do any string stuff.

PHP's behaviour is normal - modulus is generally intended for
integers...

Bogdan

"Boget, Chris" wrote:

> Consider the following:
>
> $number = 102.52;
>
> echo $number % 50;
> echo bcmod( $number, 50 );
>
> in both cases, it's spitting out "2".  Why is it not spitting
> out "2.52"?  Is there a way I can get that information?
> w/o having to parse the string, breaking it up, getting
> the modulus and then adding it back into the end result...?
>
> Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Classes versus native functions

2002-01-04 Thread Vikram Vaswani

Hi,

I was wondering if anyone knew (and could quantify) the performance
difference between a script that uses PHP's native XML functions - for
example, DOM functions to add/remove nodes - and one that simulates these
functions via a class - like the PHP.XPath class.

I would assume that simulating it via a class would obviously be slower
than the native function - right? But are there any numbers to back this
up? Any ideas on how to build a test case to check this?

Thanks in advance! Please CC my address above as well as the list if you
have a response.

Vikram
--
Friends help you move. Real friends help you move bodies.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] jukebox

2002-01-04 Thread Scott

Has anyone experimented with controlling an mp3 player like mpg123 from 
php?  I want to build a radio automation system using a web interface, but 
not sure how I want to handle the actual playing of music.  

Basically I would have a mysql database that rotates the music based on 
categories and it would move down the list resetting every hour.

If you have done an exec to mpg123 before, how did you control the output?  
I want the output to be on the local machine and not streamed across a 
network.

Thanks in advance.

-Scott



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problem reading sessions

2002-01-04 Thread Alastair


I have just recently set up PHP on my Win2K laptop and I have just found out
that I can't read sessions. As far as I can tell the session file is being
created, but PHP doesn't seem to be able to get any data into it.

Here is what the session file looks like:
!sess_user|!blah|

The two PHP files look like this:

test_session1.php



test_session2.php
";
echo session_encode(). "";
echo isset($HTTP_SESSION_VARS) . "";
echo sizeof($HTTP_SESSION_VARS) . "";

echo $blah;
?>

For the second PHP page the ouput I get is:
- true for the 'session is registered' function
- the string that is found in the session file (listed above)
- true for the 'isset' function
- size of zero
- The warning: 'Warning: Undefined variable: blah '

Does anybody know why I would not be able to read these variables?

thanks,
alastair




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Keep my own frameset

2002-01-04 Thread R. Elsenaar

Hi all,

Lot of sites are deeplinking to my site. I like them to do so but ..
I want them to see the requested page IN MY OWN FRAMESET. To do so I figured
out that I can redirect the requested url to my framepage and build it up
again with the requested URL in the content-frame.

There is one problem:
Can somebody tell me if I can figure out what the name is of the frame where
it would be presented whithout my interferring?

I hope the problem is clear.

Robert



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] problem reading sessions

2002-01-04 Thread Johnson, Kirk

Is register_globals set to 'on' in php.ini? It needs to be for this coding
style to work. 

Kirk

> -Original Message-
> From: Alastair [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 04, 2002 1:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] problem reading sessions
> 
> 
> 
> I have just recently set up PHP on my Win2K laptop and I have 
> just found out
> that I can't read sessions. As far as I can tell the session 
> file is being
> created, but PHP doesn't seem to be able to get any data into it.
> 
> Here is what the session file looks like:
> !sess_user|!blah|
> 
> The two PHP files look like this:
> 
> test_session1.php
>  $blah = "good";
> session_start();
> session_register("blah");
> ?>
> 
> 
> test_session2.php
>  session_start();
> echo session_is_registered("blah") . "";
> echo session_encode(). "";
> echo isset($HTTP_SESSION_VARS) . "";
> echo sizeof($HTTP_SESSION_VARS) . "";
> 
> echo $blah;
> ?>
> 
> For the second PHP page the ouput I get is:
> - true for the 'session is registered' function
> - the string that is found in the session file (listed above)
> - true for the 'isset' function
> - size of zero
> - The warning: 'Warning: Undefined variable: blah '
> 
> Does anybody know why I would not be able to read these variables?
> 
> thanks,
> alastair

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] configuring sever to send mail (Win2k)

2002-01-04 Thread CJ

i have a problem using the mail function on my server.
  win2000 Pro
  IIS 5.0
  PHP Version 4.0.6

i'm not sure if it's a configuration problem with IIS or i'm missing
something in the php.ini file.

thanks
CJ




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem reading sessions

2002-01-04 Thread Kevin Stone

I'll add if you do not have register_globals set then you can access the
variable by its long name, $HTTP_SESSION_VARS["blah"].

-Kevin


> Is register_globals set to 'on' in php.ini? It needs to be for this coding
> style to work.
>
> Kirk
>
> > -Original Message-
> > From: Alastair [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 04, 2002 1:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] problem reading sessions
> >
> >
> >
> > I have just recently set up PHP on my Win2K laptop and I have
> > just found out
> > that I can't read sessions. As far as I can tell the session
> > file is being
> > created, but PHP doesn't seem to be able to get any data into it.
> >
> > Here is what the session file looks like:
> > !sess_user|!blah|
> >
> > The two PHP files look like this:
> >
> > test_session1.php
> >  > $blah = "good";
> > session_start();
> > session_register("blah");
> > ?>
> >
> >
> > test_session2.php
> >  > session_start();
> > echo session_is_registered("blah") . "";
> > echo session_encode(). "";
> > echo isset($HTTP_SESSION_VARS) . "";
> > echo sizeof($HTTP_SESSION_VARS) . "";
> >
> > echo $blah;
> > ?>
> >
> > For the second PHP page the ouput I get is:
> > - true for the 'session is registered' function
> > - the string that is found in the session file (listed above)
> > - true for the 'isset' function
> > - size of zero
> > - The warning: 'Warning: Undefined variable: blah '
> >
> > Does anybody know why I would not be able to read these variables?
> >
> > thanks,
> > alastair
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Compile Errors

2002-01-04 Thread Jason Signalness

Hello,

I am having trouble compiling php with snmp support. ucd-snmp 4.2.2 is 
installed and working without trouble. PHP4.1.1 configures ok but fails 
on make, giving many errors similar to this:

/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_next':
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111: 
multiple definition of `sa_find_next'
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111:
 
first defined here
/usr/local/lib/libsnmp.a(snmp_alarm.o): In function `sa_find_specific':
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120: 
multiple definition of `sa_find_specific'
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120:
 
first defined here

My PHP configure options are:
./configure \
--with-apxs=/opt/apache/bin/apxs \
--with-oci8 \
--with-ldap \
--with-gd=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr/X11R6 \
--enable-sigchild \
--with-imap \
--enable-xslt \
--with-xslt-sablot \
--enable-wddx \
--with-snmp=/usr/local \
--enable-ucd-snmp-hack \
--with-openssl

Please CC me on any replies, as I don't subscribe to php-general.  Any 
ideas would be greatly appreciated.

Thanks in advance

-- 
Jason Signalness, Systems Administrator
Basin Telecommunications, Inc.
[EMAIL PROTECTED](701)355-5727
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] print files

2002-01-04 Thread Leon_Tseng


Greetings all!

I'm a newbie to PHP and I wonder how I can print a file (eg. .doc, .xls
etc.) using PHP.
I looked at the printer functions but I can't seem to print anything other
than plain text and bitmaps.
Any help would be greatly appreciated. :p


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cannot find imap library

2002-01-04 Thread Richard Brust

[2002-01-03 21:55:02] [EMAIL PROTECTED]

original configure script:
./configure --with-apxs=/etc/httpd/bin/apxs --enable-track-vars 
--enable-ftp --with-gd=../gd-1.8.4 --prefix=/etc/php --sysconfdir=/etc/php 
--with-imap=../imapServer

Note: ../imapServer is the dir where I gunzip'd the source files.

This script gives the error:
Cannot find rfc822.h. Please check your IMAP installation.

Then I do another configure where I specify the location of rfc822.h:
./configure --with-apxs=/etc/httpd/bin/apxs --enable-track-vars 
--enable-ftp --with-gd=../gd-1.8.4 --prefix=/etc/php --sysconfdir=/etc/php 
--with-imap=../imapServer/src

Now the error is:
Cannot find imap library. Please check your IMAP installation.

I have also downloaded the newest IMAP source from 
http://www.washington.edu/imap/, but the same error messages appear.

By the way, PHP, Apache, and the IMAP server were, and still are, working 
fine. It's just that I cannot recompile PHP with IMAP support.


Richard Brust
IT Manager
Technology Business Research
Hampton, NH. USA


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] configuring sever to send mail (Win2k)

2002-01-04 Thread DL Neil

CJ,

> i have a problem using the mail function on my server.
>   win2000 Pro
>   IIS 5.0
>   PHP Version 4.0.6
>
> i'm not sure if it's a configuration problem with IIS or i'm missing
> something in the php.ini file.


The pre-requisite is that the php.ini file points to a visible SMTP server. Please 
review the [mail function]
section of that file.
If you have further questions please include that section, plus PHP version number in 
your reply.

Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: php-general Digest 3 Jan 2002 12:22:53 -0000 Issue 1089

2002-01-04 Thread Garth Dahlstrom


If you don't like getting 50 messages a day, I suggest
using this list's digest mode, then you get 1 big message
with your daily dose of 50 messages tucked away neatly 
inside.  :)

>  "Matt Moreton" 
> -  Re: [PHP] Holy Moly...
> -  Thu, 3 Jan 2002 03:03:02 -
> 
> If you dont mind downloading ~50 messages a day, then I'd 
> recommend this
> group :]
> 
> Regards
> 
> Matt.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: php-general Digest 3 Jan 2002 12:22:53 -0000 Issue 1089

2002-01-04 Thread Mehmet Kamil ERISEN

you can aslo go to www.php.net and read the emails from
your browser.
--- Garth Dahlstrom <[EMAIL PROTECTED]> wrote:
> 
> If you don't like getting 50 messages a day, I suggest
> using this list's digest mode, then you get 1 big message
> with your daily dose of 50 messages tucked away neatly 
> inside.  :)
> 
> >  "Matt Moreton" 
> > -  Re: [PHP] Holy Moly...
> > -  Thu, 3 Jan 2002 03:03:02 -
> > 
> > If you dont mind downloading ~50 messages a day, then
> I'd 
> > recommend this
> > group :]
> > 
> > Regards
> > 
> > Matt.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem reading sessions

2002-01-04 Thread Alastair

I get the error: 'Warning: Undefined index: blah' when I use the long name.
As far as I can tell it doesn't seem to be actually writing the data into
the session file.  Am I missing a crucial step somewhere?

alastair

"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
003401c19563$95ee2e00$[EMAIL PROTECTED]">news:003401c19563$95ee2e00$[EMAIL PROTECTED]...
> I'll add if you do not have register_globals set then you can access the
> variable by its long name, $HTTP_SESSION_VARS["blah"].
>
> -Kevin
>
>
> > Is register_globals set to 'on' in php.ini? It needs to be for this
coding
> > style to work.
> >
> > Kirk
> >
> > > -Original Message-
> > > From: Alastair [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, January 04, 2002 1:41 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] problem reading sessions
> > >
> > >
> > >
> > > I have just recently set up PHP on my Win2K laptop and I have
> > > just found out
> > > that I can't read sessions. As far as I can tell the session
> > > file is being
> > > created, but PHP doesn't seem to be able to get any data into it.
> > >
> > > Here is what the session file looks like:
> > > !sess_user|!blah|
> > >
> > > The two PHP files look like this:
> > >
> > > test_session1.php
> > >  > > $blah = "good";
> > > session_start();
> > > session_register("blah");
> > > ?>
> > >
> > >
> > > test_session2.php
> > >  > > session_start();
> > > echo session_is_registered("blah") . "";
> > > echo session_encode(). "";
> > > echo isset($HTTP_SESSION_VARS) . "";
> > > echo sizeof($HTTP_SESSION_VARS) . "";
> > >
> > > echo $blah;
> > > ?>
> > >
> > > For the second PHP page the ouput I get is:
> > > - true for the 'session is registered' function
> > > - the string that is found in the session file (listed above)
> > > - true for the 'isset' function
> > > - size of zero
> > > - The warning: 'Warning: Undefined variable: blah '
> > >
> > > Does anybody know why I would not be able to read these variables?
> > >
> > > thanks,
> > > alastair
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] adding users on *nix

2002-01-04 Thread Chris Hogben

Is there a way of adding a user to a *nix box thru php. Like, someone signs
up, and they're account is added? Thanks.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem reading sessions

2002-01-04 Thread R'twick Niceorgaw

Have you set the session.save_path properly in php.ini ? By default it is
set to /tmp which doesn't work under Win* systems. You need to point it to a
valid directory on your machine.

HTH

- Original Message -
From: "Alastair" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 4:35 PM
Subject: Re: [PHP] problem reading sessions


> I get the error: 'Warning: Undefined index: blah' when I use the long
name.
> As far as I can tell it doesn't seem to be actually writing the data into
> the session file.  Am I missing a crucial step somewhere?
>
> alastair
>
> "Kevin Stone" <[EMAIL PROTECTED]> wrote in message
> 003401c19563$95ee2e00$[EMAIL PROTECTED]">news:003401c19563$95ee2e00$[EMAIL PROTECTED]...
> > I'll add if you do not have register_globals set then you can access the
> > variable by its long name, $HTTP_SESSION_VARS["blah"].
> >
> > -Kevin
> >
> >
> > > Is register_globals set to 'on' in php.ini? It needs to be for this
> coding
> > > style to work.
> > >
> > > Kirk
> > >
> > > > -Original Message-
> > > > From: Alastair [mailto:[EMAIL PROTECTED]]
> > > > Sent: Friday, January 04, 2002 1:41 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] problem reading sessions
> > > >
> > > >
> > > >
> > > > I have just recently set up PHP on my Win2K laptop and I have
> > > > just found out
> > > > that I can't read sessions. As far as I can tell the session
> > > > file is being
> > > > created, but PHP doesn't seem to be able to get any data into it.
> > > >
> > > > Here is what the session file looks like:
> > > > !sess_user|!blah|
> > > >
> > > > The two PHP files look like this:
> > > >
> > > > test_session1.php
> > > >  > > > $blah = "good";
> > > > session_start();
> > > > session_register("blah");
> > > > ?>
> > > >
> > > >
> > > > test_session2.php
> > > >  > > > session_start();
> > > > echo session_is_registered("blah") . "";
> > > > echo session_encode(). "";
> > > > echo isset($HTTP_SESSION_VARS) . "";
> > > > echo sizeof($HTTP_SESSION_VARS) . "";
> > > >
> > > > echo $blah;
> > > > ?>
> > > >
> > > > For the second PHP page the ouput I get is:
> > > > - true for the 'session is registered' function
> > > > - the string that is found in the session file (listed above)
> > > > - true for the 'isset' function
> > > > - size of zero
> > > > - The warning: 'Warning: Undefined variable: blah '
> > > >
> > > > Does anybody know why I would not be able to read these variables?
> > > >
> > > > thanks,
> > > > alastair
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem reading sessions

2002-01-04 Thread Alastair

yup, it's set correctly.  It actually creates the file (I've opened it in a
text editor) with the correct variable names, but just no values.
"R'Twick Niceorgaw" <[EMAIL PROTECTED]> wrote in message
065d01c1956a$f1321db0$[EMAIL PROTECTED]">news:065d01c1956a$f1321db0$[EMAIL PROTECTED]...
> Have you set the session.save_path properly in php.ini ? By default it is
> set to /tmp which doesn't work under Win* systems. You need to point it to
a
> valid directory on your machine.
>
> HTH
>
> - Original Message -
> From: "Alastair" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 04, 2002 4:35 PM
> Subject: Re: [PHP] problem reading sessions
>
>
> > I get the error: 'Warning: Undefined index: blah' when I use the long
> name.
> > As far as I can tell it doesn't seem to be actually writing the data
into
> > the session file.  Am I missing a crucial step somewhere?
> >
> > alastair
> >
> > "Kevin Stone" <[EMAIL PROTECTED]> wrote in message
> > 003401c19563$95ee2e00$[EMAIL PROTECTED]">news:003401c19563$95ee2e00$[EMAIL PROTECTED]...
> > > I'll add if you do not have register_globals set then you can access
the
> > > variable by its long name, $HTTP_SESSION_VARS["blah"].
> > >
> > > -Kevin
> > >
> > >
> > > > Is register_globals set to 'on' in php.ini? It needs to be for this
> > coding
> > > > style to work.
> > > >
> > > > Kirk
> > > >
> > > > > -Original Message-
> > > > > From: Alastair [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Friday, January 04, 2002 1:41 PM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: [PHP] problem reading sessions
> > > > >
> > > > >
> > > > >
> > > > > I have just recently set up PHP on my Win2K laptop and I have
> > > > > just found out
> > > > > that I can't read sessions. As far as I can tell the session
> > > > > file is being
> > > > > created, but PHP doesn't seem to be able to get any data into it.
> > > > >
> > > > > Here is what the session file looks like:
> > > > > !sess_user|!blah|
> > > > >
> > > > > The two PHP files look like this:
> > > > >
> > > > > test_session1.php
> > > > >  > > > > $blah = "good";
> > > > > session_start();
> > > > > session_register("blah");
> > > > > ?>
> > > > >
> > > > >
> > > > > test_session2.php
> > > > >  > > > > session_start();
> > > > > echo session_is_registered("blah") . "";
> > > > > echo session_encode(). "";
> > > > > echo isset($HTTP_SESSION_VARS) . "";
> > > > > echo sizeof($HTTP_SESSION_VARS) . "";
> > > > >
> > > > > echo $blah;
> > > > > ?>
> > > > >
> > > > > For the second PHP page the ouput I get is:
> > > > > - true for the 'session is registered' function
> > > > > - the string that is found in the session file (listed above)
> > > > > - true for the 'isset' function
> > > > > - size of zero
> > > > > - The warning: 'Warning: Undefined variable: blah '
> > > > >
> > > > > Does anybody know why I would not be able to read these variables?
> > > > >
> > > > > thanks,
> > > > > alastair
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with Printer-friendly script

2002-01-04 Thread Torrent

Problem is now resolved :-)
In the end I swapped the fsockopen() for an fopen().
This seemed to fix it up a treat.

Thanks for all your help.
Torrent


-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2002 01:30
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with Printer-friendly script


It's reasonably fast in Internet Explorer, and didn't complete in Netscape
4.7.

The characters I saw were similar to yours, except that I saw fd0 (the
floppy!?) instead of fd6.
Could they be artifacts in the data stream?

Does the initial page,
www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
database? from a flat file?

What happens if you fetch the default length of 1k?

Miles  Thompson


At 12:30 AM 1/4/2002 +, ski-info wrote:
>I am in the process of producing a script which will allow me to produce
>printer-friendly versions of my dynamically produced web pages.
>
>For the most part it is working but take a look here...
>
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach
>
>If you click the "Print Review" button it all seems to work fine, except
>1) it's slow and...
>2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
>
>Where on Earth did they come from?  They are not in the html (as you would
>also see them on the main review page). They also appear to be the cause of
>the
>script running slow.
>
>Here is my php code.
>
>PHP:---
-
>
>
>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
>header("Cache-Control: no-cache, must-revalidate");
>header("Cache-Control: post-check=0,pre-check=0");
>header("Cache-Control: max-age=0");
>header("Pragma: no-cache");
>
>if ($HTTP_REFERER){
> $myURL = $HTTP_REFERER;
>} else {
> $myURL = "http://www.ski-info-online.com/";;
>}
>
>$START_CONT="";
>$END_CONT = "";
>
>$parsed_url = parse_url($myURL);
>$myServer = $parsed_url['host'];
>$document = $parsed_url['path'];
>$query = $parsed_url['query'];
>
>if($document[strlen($document)-1]=='/'){
> $document = "$document/index.php";
> $base_url = dirname($document);
>}
>
>$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
>
>$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
>$request .= "Host: $myServer\r\n\r\n";
>
>if(!$fp) {
>   echo "$errstr ($errno)\n";
>} else {
>   fputs($fp,$request);
>   $content=0;
>   $in_title=0;
>?>
>{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
>$line; } fclose($fp); ?>
>
>--
>Copyright © Ski-Info-Online.com. All rights reserved.
>
>
>}
>?>
>
>---
-
>
>
>
>Any help greatly appreciated.
>
>Torrent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] adding users on *nix

2002-01-04 Thread Jason Bell

you might be better off triggering a back-end script to do that. the
script would have to have root privilegf es. I'm not sure if you can "become
root" within PHP, but if you trigger a shell script or perl script  or
something, it can be set SUID to root or something please note that my
suggestions are merely technical there are no implications of security
using this method.  :)


- Original Message -
From: "Chris Hogben" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 1:40 PM
Subject: [PHP] adding users on *nix


> Is there a way of adding a user to a *nix box thru php. Like, someone
signs
> up, and they're account is added? Thanks.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: A compress function?

2002-01-04 Thread Gaylen Fraley

Not even close.  I'm after a function to compress multiples of the same
character to one instance, as in my stated example, 30 spaces to 1 space,
not compressing the string.

Emil offered a good substitute.

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/

"George Nicolae" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> take a look at http://www.php.net/manual/en/function.bzcompress.php
>
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> "Gaylen Fraley" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > With all the wonderful String functions in PHP, I haven't been able to
> find
> > a str_compress().  Is there such an animal?  Let's say I have a string
> like
> > this:
> >
> > $myString = First_word  <30 spaces> second_word <10 spaces> etc...
> >
> > I need to do one of two things.  Either compress the multiple spaces to
> one
> > and then use explode to break the string on a single space, or can
someone
> > explain another way to break $myString into  only those pieces that
> contain
> > usable text w/o spaces?
> >
> > Thanks!
> >
> > --
> > Gaylen
> > [EMAIL PROTECTED]
> > Home http://www.gaylenandmargie.com/
> > PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/
> >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to clear a populated array

2002-01-04 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I have a populated array that stores user input errors.

I have been browsing the manual and some books and I couldn't find one 
thing.

I've got an array $Erros[] and I would like to be able to clear it 
entirely. Is there any builtin function that acomplishes that?

Thank you in advance.

Carlos Fernando S. Antunes.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to clear a populated array

2002-01-04 Thread Bogdan Stancescu

I don't know, does $Errors=array() work for you? Hope I understood your
problem...

Bogdan

Carlos Fernando Scheidecker Antunes wrote:

> Hello All,
>
> I have a populated array that stores user input errors.
>
> I have been browsing the manual and some books and I couldn't find one
> thing.
>
> I've got an array $Erros[] and I would like to be able to clear it
> entirely. Is there any builtin function that acomplishes that?
>
> Thank you in advance.
>
> Carlos Fernando S. Antunes.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to clear a populated array

2002-01-04 Thread Carlos Fernando Scheidecker Antunes

Yeah Bogdan.

I have thought so too, but I also found it quite intuitive and I thought 
there might be something easier.

As usual you reply to my questions. And as usual I appreciate your help.

Thanks again.

regards,

Carlos Fernando.


Bogdan Stancescu wrote:

>I don't know, does $Errors=array() work for you? Hope I understood your
>problem...
>
>Bogdan
>
>Carlos Fernando Scheidecker Antunes wrote:
>
>>Hello All,
>>
>>I have a populated array that stores user input errors.
>>
>>I have been browsing the manual and some books and I couldn't find one
>>thing.
>>
>>I've got an array $Erros[] and I would like to be able to clear it
>>entirely. Is there any builtin function that acomplishes that?
>>
>>Thank you in advance.
>>
>>Carlos Fernando S. Antunes.
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread David Yee

Hi guys.  Quick regular expressions question here:

I want to match:



but not:

blah blah 

Basically I want to wipe out lines beginning with the  tag followed
immediately by a carriage return.  If I do a:

str_replace("\r\n", '', $string);

It wipes out  and the carriage return after blah blah .  So I
suppose I have to turn to preg_replace, but I'm having a hard time coming up
with the right pattern.  Thanks.

David


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Paging through MySQL results in PHP

2002-01-04 Thread Nelson Goforth

I have an application that returns a set of results from a MySQL 
query.  Let's say I have 100 results from the query, but only want to 
show 25 per HTML page.

The MySQL query is driven by a 'Search' page that creates an array 
"$keywords" - which can be of any size.  I then loop through the 
$keywords array to create the SQL code.

I understand how to use the LIMIT statement in MySQL - so I can 
'page' the output, but how do I pass the "$keywords" array with each 
request for the next page?

I create a link with a phrase like:

printf(...A HREF="results.php?firstitem=1&items=25&kw=$kw...);

but end up just showing that kw=array.

Can anyone put me on the right track or point me to some resource? 
This seems like it should be simple but...

Thanks,
Nelson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] configuring sever to send mail (Win2k)

2002-01-04 Thread CJ

thanks for the reply but i still need some help:

PHP Version 4.0.6

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]
---
I get this error when i use the mail function on my local server (IIS 5.0,
windows 2000 Pro). Maybe it's an IIS configuration problem. i'm really not
sure.
Error
Warning: Server Error in F:\Inetpub\wwwroot\stowe\scripts\mail.php on line
42

 Code
 Thank you for your input\n";
}
else{
echo "Internal Error:  Your input was
unprocessed.Contact $from\n";
}
}
?>




"Dl Neil" <[EMAIL PROTECTED]> wrote in message
06f601c1962f$e3841cc0$7b16100a@jrbrown">news:06f601c1962f$e3841cc0$7b16100a@jrbrown...
> CJ,
>
> > i have a problem using the mail function on my server.
> >   win2000 Pro
> >   IIS 5.0
> >   PHP Version 4.0.6
> >
> > i'm not sure if it's a configuration problem with IIS or i'm missing
> > something in the php.ini file.
>
>
> The pre-requisite is that the php.ini file points to a visible SMTP
server. Please review the [mail function]
> section of that file.
> If you have further questions please include that section, plus PHP
version number in your reply.
>
> Regards,
> =dn
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to clear a populated array

2002-01-04 Thread Miles Thompson

Carlos,

Just redeclare the array  $Erros = array();

Miles

At 05:11 PM 1/4/2002 -0700, Carlos Fernando Scheidecker Antunes wrote:
>Hello All,
>
>I have a populated array that stores user input errors.
>
>I have been browsing the manual and some books and I couldn't find one thing.
>
>I've got an array $Erros[] and I would like to be able to clear it 
>entirely. Is there any builtin function that acomplishes that?
>
>Thank you in advance.
>
>Carlos Fernando S. Antunes.
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Stupid question alert

2002-01-04 Thread tim at 10Kv

Hi, 

first of all apologise to the list ­ this is a very basic question for you
I¹m sure. I have tried to find an answer on the web but the problem is
knowing HOW to ask the question ­ and I hoping you can provide me with a
starting point.

Anyway.. I design a lot of graphic intensive pages which rely heavily on
layers that contain images, mouseovers and image swaps. The trouble is, when
there are more than a couple of these layers on a page the code gets long
and over complicated.  For example, if I have a page which on one side
contains an image map with 5 clickable points that shows one of 5 possible
layers on the other side of the page  (each with different content)  this is
automatically a page with lots of code which is slow to load ­ especially if
the page already has a layer based navigation bar!

My question is: is there a way to use a language like php to make this
process easier? For example populate the layers from a different file rather
than have all the code on the same page and perhaps slim the page down a
little ­ or is this missing the point of what a language like php is about.

Thanks for your help and my apologies if this is the worst question of the
week.

Tim Rogers



Re: [PHP] Stupid question alert

2002-01-04 Thread Bogdan Stancescu

Your question is not stupid - it's just uninformed, and that's easily
understandable if you never used PHP.

The concept is dynamically creating the page SERVER-SIDE. That is, use some
databases or some nifty code to dynamically build a page using specific
parameters. Unforunately for you, this means that all the fun ends on the server
side. Once PHP ends its job, Apache takes over and serves the content generated
by PHP as it would serve any regular file. What you actually pass to the client
is "dead" information - it's not dynamic unless you echo some JavaScript code or
something similar from PHP (which is the same as writing the respective code in
a regular file, unless you create some custom parameters in JavaScript based on
some other parameters you pass to PHP).

Hope my explanation makes sense... ;-)

Bogdan

tim at 10Kv wrote:

> Hi,
>
> first of all apologise to the list ­ this is a very basic question for you
> I¹m sure. I have tried to find an answer on the web but the problem is
> knowing HOW to ask the question ­ and I hoping you can provide me with a
> starting point.
>
> Anyway.. I design a lot of graphic intensive pages which rely heavily on
> layers that contain images, mouseovers and image swaps. The trouble is, when
> there are more than a couple of these layers on a page the code gets long
> and over complicated.  For example, if I have a page which on one side
> contains an image map with 5 clickable points that shows one of 5 possible
> layers on the other side of the page  (each with different content)  this is
> automatically a page with lots of code which is slow to load ­ especially if
> the page already has a layer based navigation bar!
>
> My question is: is there a way to use a language like php to make this
> process easier? For example populate the layers from a different file rather
> than have all the code on the same page and perhaps slim the page down a
> little ­ or is this missing the point of what a language like php is about.
>
> Thanks for your help and my apologies if this is the worst question of the
> week.
>
> Tim Rogers


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread Bogdan Stancescu

I suck big time at regular expressions, but have you tried
str_replace("\r\n\r\n", '', $string); ?

Bogdan

David Yee wrote:

> Hi guys.  Quick regular expressions question here:
>
> I want to match:
>
> 
>
> but not:
>
> blah blah 
>
> Basically I want to wipe out lines beginning with the  tag followed
> immediately by a carriage return.  If I do a:
>
> str_replace("\r\n", '', $string);
>
> It wipes out  and the carriage return after blah blah .  So I
> suppose I have to turn to preg_replace, but I'm having a hard time coming up
> with the right pattern.  Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] CGI and HTTP Authentication

2002-01-04 Thread Gaylen Fraley

Is there any work around for using HTTP Authentication and PHP installed as
CGI?  I know how to make the detection, I'm hoping (probably in vain) that
there is some way to make the two work.  Thanks.

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!

2002-01-04 Thread Miles Thompson


I've never installed PHP on a Windows box, but on Linux you have to move 
and rename the php.ini file. It's mentioned in the docs, but for the life 
of me I can't remember its name right now.

Miles Thompson

At 11:15 AM 1/4/2002 -0600, Mark wrote:
>I apologize if the title of this post sounds overly aggresive, but I have
>followed the instructions to a 'T' and got nowhere!!  I have tried the
>"auto" install version of PHP and manual instructions for installing PHP
>4.1.1.  Neither of them work.  I added the lines to my httpd.conf file for
>both types of installs (not at the same time) as discribed in the
>Install.txt file, along with the instructions on the website, and can get no
>"test" scripts to run or PHP for that matter.  All I get is a blank screen
>when running the CGI version or can not even get apache to load when I try
>the Module version (Get a "Requested Operation Failed" message).  can
>someone please help?  My system is as follows:
>
>Windows 2000 SP2
>Apache 2.0.28 (I have also tried version 1.3.22 with same results as
>mentioned above)
>PHP 4.1.1
>MDAC 2.7
>MySQL 3.23.46a
>
>Thanks in advance!!
>
>Mark
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread David Yee

That's an idea but it would delete the carriage return before it which I
don't want to happen.  I've tried preg_replace("/^\r\n/", '', $string)
+ quite a few other variations but no luck :-(.  Argh!

David

- Original Message -
From: "Bogdan Stancescu" <[EMAIL PROTECTED]>
To: "David Yee" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 6:20 PM
Subject: Re: [PHP] Quick regular expressions question / preg_replace


> I suck big time at regular expressions, but have you tried
> str_replace("\r\n\r\n", '', $string); ?
>
> Bogdan
>
> David Yee wrote:
>
> > Hi guys.  Quick regular expressions question here:
> >
> > I want to match:
> >
> > 
> >
> > but not:
> >
> > blah blah 
> >
> > Basically I want to wipe out lines beginning with the  tag
followed
> > immediately by a carriage return.  If I do a:
> >
> > str_replace("\r\n", '', $string);
> >
> > It wipes out  and the carriage return after blah blah .  So
I
> > suppose I have to turn to preg_replace, but I'm having a hard time
coming up
> > with the right pattern.  Thanks.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread Bogdan Stancescu

str_replace("\r\n\r\n", '\r\n', $string);

David Yee wrote:

> That's an idea but it would delete the carriage return before it which I
> don't want to happen.  I've tried preg_replace("/^\r\n/", '', $string)
> + quite a few other variations but no luck :-(.  Argh!
>
> David
>
> - Original Message -
> From: "Bogdan Stancescu" <[EMAIL PROTECTED]>
> To: "David Yee" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, January 04, 2002 6:20 PM
> Subject: Re: [PHP] Quick regular expressions question / preg_replace
>
> > I suck big time at regular expressions, but have you tried
> > str_replace("\r\n\r\n", '', $string); ?
> >
> > Bogdan
> >
> > David Yee wrote:
> >
> > > Hi guys.  Quick regular expressions question here:
> > >
> > > I want to match:
> > >
> > > 
> > >
> > > but not:
> > >
> > > blah blah 
> > >
> > > Basically I want to wipe out lines beginning with the  tag
> followed
> > > immediately by a carriage return.  If I do a:
> > >
> > > str_replace("\r\n", '', $string);
> > >
> > > It wipes out  and the carriage return after blah blah .  So
> I
> > > suppose I have to turn to preg_replace, but I'm having a hard time
> coming up
> > > with the right pattern.  Thanks.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to clear a populated array

2002-01-04 Thread Michael Sims


>>>I've got an array $Erros[] and I would like to be able to clear it
>>>entirely. Is there any builtin function that acomplishes that?

Why not:

unset($Errors);

??


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Unknown persistent list entry type in module shutdown (11)

2002-01-04 Thread Brian Clark

* Ed Swartz ([EMAIL PROTECTED]) [Jan 03. 2002 13:26]:

> Hi,

Hiya

> The error message listed in the subject line is being displayed at the
> bottom of my HTML pages gen'd by PHP. Any hints how what might be
> causing this message? I looked in BUGS, FAQTS, etc not to no avail.

May help:



-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
I intend to live forever - so far, so good.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread David Yee

Ah that would do it (just need to double quote the \r\n).  Thanks!  I just
know, however, one of these days I'm gonna need to use preg_replace :-).

David

- Original Message -
From: "Bogdan Stancescu" <[EMAIL PROTECTED]>
To: "David Yee" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 6:46 PM
Subject: Re: [PHP] Quick regular expressions question / preg_replace


> str_replace("\r\n\r\n", '\r\n', $string);
>
> David Yee wrote:
>
> > That's an idea but it would delete the carriage return before it which I
> > don't want to happen.  I've tried preg_replace("/^\r\n/", '',
$string)
> > + quite a few other variations but no luck :-(.  Argh!
> >
> > David
> >
> > - Original Message -
> > From: "Bogdan Stancescu" <[EMAIL PROTECTED]>
> > To: "David Yee" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, January 04, 2002 6:20 PM
> > Subject: Re: [PHP] Quick regular expressions question / preg_replace
> >
> > > I suck big time at regular expressions, but have you tried
> > > str_replace("\r\n\r\n", '', $string); ?
> > >
> > > Bogdan
> > >
> > > David Yee wrote:
> > >
> > > > Hi guys.  Quick regular expressions question here:
> > > >
> > > > I want to match:
> > > >
> > > > 
> > > >
> > > > but not:
> > > >
> > > > blah blah 
> > > >
> > > > Basically I want to wipe out lines beginning with the  tag
> > followed
> > > > immediately by a carriage return.  If I do a:
> > > >
> > > > str_replace("\r\n", '', $string);
> > > >
> > > > It wipes out  and the carriage return after blah blah .
So
> > I
> > > > suppose I have to turn to preg_replace, but I'm having a hard time
> > coming up
> > > > with the right pattern.  Thanks.
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML with Dynamic Content

2002-01-04 Thread Brian Clark

* Emile Bosch ([EMAIL PROTECTED]) [Jan 03. 2002 15:38]:

> Hi a lot of todays proffesional content management systems use XML, now
> i was wondering how it's possible to mix XML with Dynamic Content, or
> content which is change sensitive, IE A shop, or an auction,
> let's say you have a shop with 1000 products, how am i gonna mix this in
> the XML?

> Does anyone know how this is solved, because i don't think that you are
> gonna write hundreds of XML files for each article, can someone please help
> me out here?

I understand the first paragraph up to "how am i gonna mix this in the
XML?"

Why couldn't you store information in a database and write the XML files
on the fly when you need XML? Or update the XML file when something 
changes? Or, why use XML at all? Do you _really_ need it? *confused*

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Sex is the most fun you can have without laughing.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Cannot find imap library

2002-01-04 Thread Brian Clark

* Richard Brust ([EMAIL PROTECTED]) [Jan 04. 2002 16:25]:

> original configure script:
> ./configure --with-apxs=/etc/httpd/bin/apxs --enable-track-vars 
> --enable-ftp --with-gd=../gd-1.8.4 --prefix=/etc/php --sysconfdir=/etc/php 
> --with-imap=../imapServer

> Note: ../imapServer is the dir where I gunzip'd the source files.

[...]

> Then I do another configure where I specify the location of rfc822.h:
> ./configure --with-apxs=/etc/httpd/bin/apxs --enable-track-vars 
> --enable-ftp --with-gd=../gd-1.8.4 --prefix=/etc/php --sysconfdir=/etc/php 
> --with-imap=../imapServer/src

> Now the error is:
> Cannot find imap library. Please check your IMAP installation.

OK this is seriously a long shot, but..

cd ../imapServer/src/c-client
ln -s c-client.h libc-client.h

Then remove config.cache in your PHP directory and try configuring it
again --with-imap=../imapServer/src

See what that returns..

It might work because c-client.h points to everything else it needs.

I think configure is looking for c-client.a instead, but try the above
and see what happens. Backup your original apache php DSO before you
make install though, so you don't try find me and hang me out back when
it all goes poof. :)

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
It's been lovely, but I have to scream now.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] compilation of PHP with SNMP support

2002-01-04 Thread Kancha .

I faced the same problem when compile php 4.0.6 and
4.1.0 with snmp. I tried several times so i just
dropped it. Now I'm using php without snmp. 


Do let me know if you get over this error.


--- Jason Signalness <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am having trouble compiling php with snmp support.
> ucd-snmp 4.2.2 is 
> installed and working without trouble. PHP4.1.1
> configures ok but fails 
> on make, giving many errors similar to this:
> 
> /usr/local/lib/libsnmp.a(snmp_alarm.o): In function
> `sa_find_next':
>
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111:
> 
> multiple definition of `sa_find_next'
>
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:111:
> 
> first defined here
> /usr/local/lib/libsnmp.a(snmp_alarm.o): In function
> `sa_find_specific':
>
/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120:
> 
> multiple definition of `sa_find_specific'
>
Zend/.libs/libZend.al(snmp_alarm.o):/export/home/j/js/jsignalness/ucd-snmp-4.2.2/snmplib/snmp_alarm.c:120:
> 
> first defined here
> 
> My PHP configure options are:
> ./configure \
> --with-apxs=/opt/apache/bin/apxs \
> --with-oci8 \
> --with-ldap \
> --with-gd=/usr \
> --with-jpeg-dir=/usr \
> --with-png-dir=/usr \
> --with-freetype-dir=/usr \
> --with-zlib-dir=/usr \
> --with-xpm-dir=/usr/X11R6 \
> --enable-sigchild \
> --with-imap \
> --enable-xslt \
> --with-xslt-sablot \
> --enable-wddx \
> --with-snmp=/usr/local \
> --enable-ucd-snmp-hack \
> --with-openssl
> 
> Please CC me on any replies, as I don't subscribe to
> php-general.  Any 
> ideas would be greatly appreciated.
> 
> Thanks in advance
> -- 
> Jason Signalness, Systems Administrator
> Basin Telecommunications, Inc.
> [EMAIL PROTECTED](701)355-5727
> --
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Checking the season

2002-01-04 Thread webapprentice

Hi,
Just need a sounding board to help me think this through.

I want to check the current date to determine what "season" it is and display the 
appropriate picture.

I define spring as 03/21/, summer as 06/21/, autumn as 09/21/, and winter 
as 12/21/.

I form a string for the current date and get a timestamp via mktime().
I also get the equivalent timestamps for the dates above for the seasonal changes.

Then, I compare the current date to see if it's between the seasonal dates.
The problem is when I go from 12/31/ to 01/01/(+1).
Since winter and spring dates are one year apart, the current date timestamp 
comparison gets messed up and nothing displays.

How do I do a proper comparison?  I was thinking of just seeing if the current date 
timestamp is greater than each of the seasonal date timestamp, but it feels like I 
would miss something.  Would I?  Or is there another solution?

Thank you for your time.

--Stephen



Re: [PHP] PEAR

2002-01-04 Thread Brian Clark

* harry ([EMAIL PROTECTED]) [Jan 04. 2002 10:44]:

> Hi all

Hi Harry

> I have been trying to use PEAR and have come to a standstill.

> The following:

>  require_once ("HTML/Page.php");



> /* PAGE SETUP */
>   $p = new HTML_Page();
>   $p->setCache("true");
>   echo "TEST 1";

Try commenting the above line out.

>   //$p->toHtml();
>   echo "TEST 2";

Try commenting the above line out also.

>  // $p->setTitle("Jobsite Page");

>   $p->display();

because in the display() method, it's sending header()s:


function display() 
{   
  if(! $this->_cache) {
header("Expires: Tue, 1 Jan 1980 12:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
  }
  $strHtml = $this->toHtml();
  print $strHtml;
} // end func display


> Produces the following error:

Which is why you are getting this error about header information:

>  TEST 1TEST 2
> Warning: Cannot add header information - headers already sent by (output 
> started at /var/www/html/website/jobix/php_test/test_form.php:4) in 
> /usr/share/php/HTML/Page.php on line 136

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
A day without sunshine is like, night.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP-Friendly WYSIWYG HTML Editor

2002-01-04 Thread Brian Clark

* Brandon ([EMAIL PROTECTED]) [Jan 04. 2002 10:47]:

> G'day!

G'day, mate!

[...]

> I've tried the following without success:

> - Adobe PageMill. It came free with PageMaker; nice, except it arbitrarily
> replaces things like  - Netscape Composer, which gets the current value produced by the PHP bits,
> and then saves that information, statically.

A lot of folks seem to love Macromedia Dreamweaver for use with PHP.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Everyone who believes in telekinesis, raise my hands.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!

2002-01-04 Thread Brian Clark

* Mark ([EMAIL PROTECTED]) [Jan 04. 2002 12:14]:

[...]

> the Module version (Get a "Requested Operation Failed" message).  can
> someone please help?  My system is as follows:

> Windows 2000 SP2
> Apache 2.0.28 (I have also tried version 1.3.22 with same results as

People had problems in that past with 2.x; I don't know if the php-dev's
have worked that out yet.

> mentioned above)
> PHP 4.1.1
> MDAC 2.7
> MySQL 3.23.46a

Are there any hints in Apache's error_log? What is your exact LoadModule
line you're using in httpd.conf?

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
In politics, stupidity is not a handicap.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >