RE: [PHP] fopen not opening url

2001-07-31 Thread Lawrence . Sheed

Are you still having problems?

Things to try:

1.  Try and open the url directly in a browser.
eg http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml

Does it return data (you may need to change the &o=xml to &o=html though).

Some countries (like the one I'm in China, have moreover access banned via
some providers)

2.  socket blocking - you may need to enable or disable this dependant on
your server settings:
set_socket_blocking ($connection,false);

function LoadFile ($filename,$block=false){
$fd = fopen( $filename, "r" );
if ($block) set_socket_blocking ($fd,true);
$contents = fread( $fd, filesize( $filename ) );
fclose( $fd );  
return ($contents);
}

Without socket blocking
LoadFile
("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";);


With socket blocking
LoadFile
("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml",true
);

3. I use something like this for reads on difficult servers (some china mail
servers are a p.i.a to get at sometimes).

Function GetLine() {
$timeout=30;
$iStartTime = time();
set_socket_blocking($this->connection, false);

$line = fread($this->connection,128);
while(empty($line)){
$line = fread($this->connection,128);
usleep(25); 
}
if ($debug) {
print ($line) ."";
System("echo ''"); 
flush;
}

return ($line);
}


Let me know how you do.

Lawrence.
-Original Message-
From: Jay Paulson [mailto:[EMAIL PROTECTED]]
Sent: July 31, 2001 5:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] fopen not opening url


here's the code i'm using below to try and open up the url.. :)

thanks!
jay

$fp =
fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";
, "r");
$length = filesize($fp);
$content = fread($fp,$length);
fclose($fp);
echo $content;

- Original Message -
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "'Jay Paulson'" <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 1:52 PM
Subject: RE: [PHP] fopen not opening url


> Hi jay,
>
> I've done the exact thing you're trying, and it works...paste in some
> code so we can see where its going wrong...
>
> jack
>
> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] fopen not opening url
>
> hello-
> I'm trying to use the fopen() command to open the url below and just
> read it
> into another $var. However, I'm having some problems the warning i
> get
> is below along with the url in the warning.  Anyone know what's going on
> here??
>
> Thanks,
> jay
>
> Warning: php_hostconnect: connect failed
> Warning:
> fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=
> xml"
> ,"r") - Bad file descriptor




-- 
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] Compution of Fibonacci

2001-07-31 Thread Saquib Farooq


On Tue, 31 Jul 2001, Stig Venaas wrote:

> On Tue, Jul 31, 2001 at 11:59:07AM +0500, Saquib Farooq wrote:
> > hi
> > 
> > well first of all you have to remove the colon -- ";" sign from
> > the end of your while loop .. that will solve the problem for the time
> > out.
> > then there is problem with your code, this code will never get you
> > the fibonacci since the variable a,b and c never go abone 0, see. :).
> 
> Just in case anyone is interested... If you want to find the n'th
> Fibonacci number and not go through the entires sequence, you can
> use the formula:
> 
> F(n) = ( P^n - (-P)^(-n) ) / sqrt(5) where P = (1 + sqrt(5))/2
> 
> and it's also possible to extend Fibonacci numbers to negative n.
> Pretty fascinating (:
> 
> Also, if you have F(n) you can find F(n+1). Let x denote F(n).
> 
> F(n+1) = floor( (x + 1 + sqrt(5x^2)) / 2).
> 
> Stig
> 
> 
Oh please stop that ... you sound like my maths professor :). lol.

-- 
  ,
 /'^ ^'\
   -((o)-(o))-
   --oOOO--(_)--OOOo---

   Saquib Farooq Malik
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]
   Sustainable Develpment
   Network Program (SDNP)
   Tel: 2270684

 .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] PHP_SELF

2001-07-31 Thread Ralph Guzman

I personally think it is best to display a form error on the form itself,
rather than given them a blank page that shows an error, then have them
click a button or link to go back to the form. Here is somewhat a quick and
dirty example of how I go about forms and error checking. For this example I
am only checking for a required field, you can elaborate on this and check
to see if input for age is numerical, or whatever other type of
error-checking you may need to do:





   " METHOD="post">
   ">
   ">
   
   



Hope this helps.

-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 3:30 PM
To: PHP
Subject: [PHP] PHP_SELF

Im trying to introduce some logic into a form.I am unsing $PHP_SELF as
the target.


I have a text area that the user inputs their age.  What I want is that
if the field is blank, to stop the script and send the user back to fill
in their age.  My problem now is that if I go to the blank application
form, The script interprets the form as being blank and spits out the
error.  Ideal scenario, a blank form is presented to the user, and when
the form is submitted, do the logic check and act accordingly.  Is it
possible using $PHP_SELF as the target, or do I have to use 2 files: a
form 'front end' with the php logic in the 'backend'??


if ($Age = " ") {
 echo "Please go back and enter your age."; } exit();

Thanks
Gerard


--
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: Newbie: Site search, more than one directory

2001-07-31 Thread Tim Ward

I have used this for a simple site map, it (or at least the principles
involved) should do what you want. The trick is to put your search in a
recursive function, that calls itself when the file is a directory.

function sitemap($path)
{   if ($dhandle = opendir($path))
{   echo("");
while ($file_name = readdir($dhandle))
{   if ($file_name == "." or $file_name == "..")
continue;
echo("$file_name");
if (is_dir("$path$file_name"))
sitemap("$path$file_name/");
}
closedir($dhandle);
echo("");
}
} // end of fn sitemap

Tim

--
From:  Steve Wright [SMTP:[EMAIL PROTECTED]]
Sent:  30 August 2001 21:11
To:  [EMAIL PROTECTED]
Subject:  Newbie: Site search, more than one directory

Hey,

I have just developed a simple site search.. .and am after learning
how to
get it to search all directories... at present, it only searches the
one it
is in!!


Here's the code:



" METHOD="POST">
"
   SIZE="20" MAXLENGTH="30">



\n";
// call grep with case-insensitive search mode on all
files
$cmdstr = "grep -i $searchstr *";
$fp = popen( $cmdstr, "r" ); file://open the output of
command
as a  pipe
$myresult = array(); // to hold my search results
while( $buffer = fgetss ($fp, 4096 )) {
// grep returns in the format
// filename: line
// So, we use split() to split the data
list($fname, $fline) = split(":",$buffer, 2);
// we take only the first hit per file
if ( !defined($myresult[$fname]))
$myresult[$fname] = $fline;
}
// we have results in a hash. lets walk through it
and print
it
if ( count($myresult) ){
echo "\n";
while(list($fname,$fline) = each($myresult))
echo "
   $fname : $fline \n";
echo "\n";
} else {
// no hits
echo "Sorry. Search on $searchstr
  returned no results.\n";
}
pclose($fp);
}
?>




I think it centers around the line whcich contains but am not
definate:
while( $buffer = fgetss ($fp, 4096 )) {


Any help much appreciated..

Steve Wright


-- 
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_SELF

2001-07-31 Thread Ralph Guzman





   echo "$formerror";

   " METHOD="post">
   ">
   ">
   
   




-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 3:30 PM
To: PHP
Subject: [PHP] PHP_SELF

Im trying to introduce some logic into a form.I am unsing $PHP_SELF as
the target.


I have a text area that the user inputs their age.  What I want is that
if the field is blank, to stop the script and send the user back to fill
in their age.  My problem now is that if I go to the blank application
form, The script interprets the form as being blank and spits out the
error.  Ideal scenario, a blank form is presented to the user, and when
the form is submitted, do the logic check and act accordingly.  Is it
possible using $PHP_SELF as the target, or do I have to use 2 files: a
form 'front end' with the php logic in the 'backend'??


if ($Age = " ") {
 echo "Please go back and enter your age."; } exit();

Thanks
Gerard


--
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: Newbie: Site search, more than one directory

2001-07-31 Thread Richard Lynch

>$cmdstr = "grep -i $searchstr *";

Add a "-r" in there before or after the -i part.

"-r" will have grep search recursively.

Read "man grep" for details.

Warning:  This will impact the performance of grep considerably if your site
is deep/broad...



-- 
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: storing array in mysql

2001-07-31 Thread Richard Lynch

> I want to store the results of a multiple select input box in a mysql
> db.

Store each possible selection as a different record in a separate table and
then create a three-table join for which selections match which "main"
records.

You'll be tearing your hair out for the rest of time otherwise.

Here's what I mean:

Assume table "foo" is what you have right now, and you've been trying to
stuff things into "lists_actual" (that is you, isn't it?) for the names
selected.  Do this instead:

[UNTESTED CODE!]

create table foo(
foo_id int(11) auto_increment not null primay key,
foo text
);
insert into foo(foo) values('Foo 1');
insert into foo(foo) values('Foo 2');

create table name(
name_id int(11) auto_increment not null primary key,
name text
);
insert into name(name) values('a');
insert into name(name) values('b');
insert into name(name) values('c');
insert into name(name) values('d');
insert into name(name) values('e');

create table foo_name(
foo_id int(11),
name_id int(11)
);

$foo\n";
}
exit;
}
if (isset($names)){
$query = "delete from foo_name where foo_id = $foo_id";
mysql_query($query) or die(mysql_error());
while (list($name_id, $name) = each($names)){
$query = "insert into foo_name (foo_id, name_id) values($foo_id,
$name_id)";
mysql_query($query) or die(mysql_error());
}
}
$query = "select foo_id, foo from foo where foo_id = $foo_id";
$foos = mysql_query($query) or die(mysql_error());
list($foo_id, $foo) = mysql_fetch_row($foos);
echo $foo, "\n";
?>
 METHOD=POST>
>

$name\n";
}
?>




--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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_SELF

2001-07-31 Thread Richard Lynch

> the form is submitted, do the logic check and act accordingly.  Is it
> possible using $PHP_SELF as the target, or do I have to use 2 files: a
> form 'front end' with the php logic in the 'backend'??

#1.  Under no circumstances should you trust JavaScript to have sanitized
your data in any way, shape or form.  Furthermore, since you'll probably be
storing this data in a database, you should assume some hacker is attempting
to screw you with an age like:

$age = "38; drop table foo;";

So, when you do:

$query = "update foo set age = $age where id = $id";

What you *GET* is:

"update foo set age = $age; drop table foo; where id = $id"

Guess what?  Your foo table just got deleted.  Have a nice day.

So, here's a sample script for you, *complete* with some sample sanitizing:

Assumption:  You have a valid "id" for the record you are editing.

This page re-displays the data after updating it, which is good for
user-interface to correct any mis-typed data.

\n";
}

$good_id = (int) $id;
$id_string = (string) $good_id;
if ($id != $id_string){
$message .= "Invalid ID -- Your hack attempt and IP
($REMOTE_ADDR) have been logged.  Have a nice day.";
# Emailing yourself on every hack attempt may be "too much"...
# It's up to you exactly how to deal with the rats:
mail("[EMAIL PROTECTED]", "Hack attempt", "$REMOTE_ADDR tried
ID $id on $PHP_SELF");
}

if (!$message){
$query = "update foo set age = $age where id = $id";
# Displaying mysql_error() to the public is NOT GOOD.
# It exposes your internal database structure too easily.
# Log it somewhere for yourself in a production site.
mysql_query($query) or die(mysql_error());
}
}
else{
# If this is their first time here, give a blank age:
$age = '';
}
?>
 METHOD=POST>
$message\n";?>
>




--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: search based on array

2001-07-31 Thread Richard Lynch

> For example suppose I had an array of array(1,2,3). And I want to
> search like so:
>
> SELECT * FROM table WHERE id=arrayvalues

$values = array (1, 2, 3);

$sql_values = implode(', ', $values);

$query = "select * from table where id in ($sql_values)";

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: IMAP4, krb4 and PHP4 - tix not handled right under apache modulevers

2001-07-31 Thread Richard Lynch

> The problem I'm having now, is that c-client is able to kerberos
> authentication properly if php is compiled as a CGI, but when compiled as
> a server module, the ticket file gets mucked up.  imap_open() invokes

Hm

WILD GUESSES ABOUND:

When you say the ticket file gets mucked up, do you actually have an actual
file, and perhaps an analysis of what exactly is in there compared with
module/CGI modes?  I have no idea what a Kerebos ticket file is, but I
reckon analyzing what's inside it under the two cases might be fruitful.

You're not using suExec wrapped around the CGI version to change the user
PHP runs as, are you?...

That *FOR* *SURE* could have a huge impact on Kerebos, eh?

Another thing that changes for sure between Module/CGI is that PHP CGI runs
as a separate process ID.  Does Kerebos care about process IDs?

I'm guessing that a CGI run might somehow manage to have different PATH/path
settings since the Module and the CGI almost certainly live in different
directories...  Where are the Kerebos keys living?

Like, after your PHP Module authenticates, will that particular httpd
process then be authenticated from that point forward?...  I have no idea
how this stuff works, but if httpd is going to be able to masquerede as the
formerly authenticated Kerebos user, then the Module not working is a
feature, not a bug...

Also -- Is Apache itself utilizing Kerebos for anyting?  Perhaps whatever
Apache is doing to load Kerebos is messing up PHP's attemtps to load it, but
when they are in separate processes (CGI) then their two Kerebos loadings
don't tromp on each other.

Finally, perhaps the order of events is important -- If Apache is loading
some Kerebos stuff, then running PHP as a CGI, all is good.  But if your PHP
Module is loaded, then Apache loads Kerebos, it's too late for PHP to
utilize it.  Try moving your PHP Module stuff (LoadModule, AddModule, all of
it) to the very end of httpd.conf -- Leave comments where it used to be so
if it works you have some sort of documentation for the next poor schnook
(maybe you in a year) that has to edit httpd.conf, and you can put things
back where they belong if it doesn't help.

Disclaimer:  If you think I actually know what I'm talking about here, you
are sorely mistaken :-)   [Not least of which is I think I just mis-spelled
Kereberos about a half-dozen times...]

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Banner Exchange Schema ??

2001-07-31 Thread Richard Lynch

Where in the world does JavaScript come into it?...

http://yoursite.com/banner.php

- file: banner.php ---
http://yoursite.com/forward.php?ID=$ID>http://yoursite.com/image.php/whatever.jpg?ID=$ID>"
?>
---

- file: forward.php ---
$URL in the database and update your click-through stats
for that $ID
header("Location: $URL");
?>
---

- file: image.php -
$path in the database and update your display-ad stats for
that $ID
header("Content-type: image/jpg");
header("Content-length: " . filesize($path));
readfile($path);
?>
---

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Jon Shoberg <[EMAIL PROTECTED]>
Newsgroups: php.general
To: Php-General@Lists. Php. Net <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 10:32 PM
Subject: Banner Exchange Schema ??


>
>   In creating a banner exchange, anyone have thoughts on how the big boys
> use their javascript and server side coding to do the banner rotations?
I've
> look at a lto of examples but some concurrency issues arrise.  Anyone have
> thoughts on or seen 'research' on how the major networks get the job done
?
>


-- 
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: Why no color in graphic?

2001-07-31 Thread Richard Lynch

> I'm simply trying to resize an image, which is working - sortof.  It
resizes
> properly, but it loses it's color.  Why, and how do I correct it?  Thanks.
>
>  $pic_dir = "_uimages";
> $picture = "$pic_dir/mypic.jpg";
> $size = GetImageSize($picture);
> $width = round($size[0]/4);
> $height = round($size[1]/4);
> $im = ImageCreate($width,$height);
> $im_o = ImageCreateFromJPEG($picture);;
> ImageCopyResized($im,$im_o,0,0,0,0,$width,$height,$size[0],$size[1]);
> imagedestroy($im_o);
> ImageJPEG($im);
> imagedestroy($im);
> ?>

Your $im does not have the same pallette of colors as the original...

You'll need to copy over the pallette first somehow.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] storing array in mysql

2001-07-31 Thread Richard Lynch

> a:4:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"
>
> When I output this to the screen I get the same as above. But when I
> try to echo the unserialized result I get nothing. I am using:
> echo $db_result->lists_actual (nothing is returned)

Show more code...  Also use "View Source" in your browser to see what you
are *REALLY* getting.

>
> If I try to display the result using foreach I get the warning
> "Invalid argument supplied for foreach()". I am using:
> $array = unserialize($db_result->lists_actual);
> foreach($array AS $val) {
> echo $val;
> };
>
> I hope the problem is clear, I am thoroughly confused at this stage! I
> should admit that I am only just getting used to arrays...

What is the datatype of your lists_actual field in your database?

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: exec'ing sendmail?

2001-07-31 Thread Richard Lynch

> I write: Return-Path: <[EMAIL PROTECTED]>\n

Get rid of the < and > in there, and use \r\n, not just \n to be
RFC-compliant.

Also check you sendmail.cf to see if maybe you've disabled various people
from forging their Return-Path: and if you have, alter sendmail.cf to let
PHP get away with it.

NOTE:  That means that *ANY* user can then use PHP to forge Return-Path:...

> but sendmail re-writes this as: Return-Path: <[EMAIL PROTECTED]>
>
> My plan is to exec sendmail and use the -f flag to specify a return-path,
I
> can do this from the command line but I am unsure how to go about doing
this
> from within php basically what are the principals of using the exec
> function, specifically with sendmail and do I have to close the process
> after each mail that's sent.

You don't have to close the process if you use exec, as exec runs and
finishes all in one step as far as PHP is concerned.

But you'll need to cram everything for sendmail into a single line with echo
and ; and whatnot to get all the email stuff to it...

Probably better to use http://php.net/popen

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] Can't write to file via php, just via ftp...Can anyonehelp?

2001-07-31 Thread Richard Lynch

>in interarchy, after you have uploaded the file, select the file and choose
>"Set Permissions..." from the Listing diresctory. then make sure the box
for
>group write is checked.

If you can do that, you can *PROBABLY* make it "world-writeable"

WARNING -- DANGER -- WARNING

Either of these suggestions is *EXTREMELY* dangerous!!!

In *NEITHER* case should the file in question be placed in your web-tree --
Put it in a sub-directory of your home directory.

In *BOTH* these cases, you are *INVITING* disaster from any other user on
your server who feels like writing *ANYTHING* they desire into your file,
*UNLESS* you are running under SAFE_MODE and have the directory/user
containing the file in your php.ini as the whatsit that lets you, and only
you, alter the file.

Re-read http://php.net security page for details about SAFE MODE and the
setting I'm drawing a blank on for php.ini

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: session_set_save_handler

2001-07-31 Thread Richard Lynch

> I have found that I can still use my customer save_handler with the
> session.save_handler in the php.ini being set to 'files'.  Since I
> implemented this function, we noticed that our other applications that do
> not call session_set_save_handler started having the following error:
> "Fatal error: Failed to initialize session module in backend.php on line
27

Somebody as OSCON was describing the same behaviour Wednesday in the PHP
guru room, I think...  Or was that you?  Hi again, if so. :-)

Maybe try using .htaccess files in each application's directory and:

php_value session.save_handler user
php_value session.save_handler files

in the appropriate directories.

> Warning: Failed to write session data (user). Please verify that the
current
> setting of session.save_path is correct (/tmp) in backend.php on line 0"
>
> line 27 of backend.php is a simple session_start();
>
> The /tmp is not full and is fully writable.  It seems that when the 3
custom
> session applications are in use, that this error starts popping up in
other
> session applications.
>
> Is my call to a session_set_save_handler somehow "changing" the php.ini
for
> a bit?  It's like the custom session application is setting the
> session.save_handler to 'user' for all other sessions.

Sounds like a reasonable hypothesis...

PHP is doing its best to do what you want, but you've confused it thoroughly
by calling session_set_save_handler() with the "files" setting in php.ini --
Those two together is basically just not kosher, so it's trying to do what
you said, only you've confused it.

You should be able to throw in a  to see what the
master/local values for session.save_handler is at various points, but the
change on the fly may not be shown there if your theory is correct.  It
*SHOULD* show the .htaccess alterations suggested above, though, and I'm
hoping that by setting it up correctly in advance for each appliation, it
will all work out right.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: require() results in session and header-sent errors

2001-07-31 Thread Richard Lynch

Betcha a dollar there's a newline after that last ?> in the first of the two
included files:

>define("INTRANET_DB","intranet");
>   define("INTRANET_APPS_TABLE","apps");
>   define("INTRANET_APPS_FOLDER","apps");
>   define("INTRANET_FOLDER","/"); file://Server Root
>   define("INTRANET_TEST_PASSWORD","test");
> ?>
^
   / \
  /   \
Right about here.

Use "vi" and see if you can cursor down to the line below ?>

If you can, hit "dd" until you are forced up on to the ?> line, and then use
":wq" to "write" and "quit"

PS  Neither require nor include is a function, so parantheses are silly
there:

require "whatever.inc";

Your current parens are *NOT*, repeat *NOT*, doing what you think -- They
are forcing PHP to "calculate" the whatever.inc bit "first", just as they
would if you had:

$foo = (2 + 3) * 4;

Since there ain't no calculation to "whatever.inc", they're just silly.

PPS  emacs can have "add newline after unfinished last line" or somesuch
stupid flag turned ON, which will automagically screw up any include file
every time you edit it.  That's why I'm suggesting "vi" above.  YMMV.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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]DB Logic help...

2001-07-31 Thread Richard Lynch

> I have a few pages on my website which need to be divided up into
different
> columns and rows based on a category in a table. for example, on a links
> page, I have three different columns, one for bands, one for sites, and
one
> for other things. I'm storing those things in the table with a category
> field, so that when I output the data, it goes to the right place. However
> I'm a little unsure of the actual code to do this...

Assuming it's not critical to line up, say, the third band with the third
site in your table, right?

So all you really need is three columns with line breaks  between
individual bands/sites/things:


\n";
}
# Start a new column for the new category:
echo "$category\n";

# Remember which category we are on now:
$last_category = $category;
}

# Spew out an individual item:
echo "http://details.php?id=$id>$name\n";
}
# Finish off that final column:
echo "\n";
?>


--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Realm Auth Via Non-Sessions

2001-07-31 Thread Richard Lynch

> When a user leaves a realm(.htaccess) from which they have logged into is
> there any kind of notification back to the server?

Nope.

> I would like keep a log of such activities and do not want to do any
session
> type of jizz jazz(cookies etc).

You either do sessions or you don't keep a log of such activities.  Take
your pick.

> I would think that there would need to be some kind of notification back
to
> the server,  as when I leave and come back (close browser) I get a new
pass
> dialog popped up...How does Apache know that I have to re-authenticate and
> can I access this knowledge via php?.

The browser sends your (previous) username/password on each page hit to the
same server.

When the browser quits, it loses its memory of your username/password.

That's all there is to it.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: fopen not opening url

2001-07-31 Thread Richard Lynch

Their CGI *MIGHT* be checking all sorts of things and determining that you
are not a real browser and denying access...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Jay Paulson <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 1:08 PM
Subject: fopen not opening url


> hello-
> I'm trying to use the fopen() command to open the url below and just read
it
> into another $var. However, I'm having some problems the warning i get
> is below along with the url in the warning.  Anyone know what's going on
> here??
>
> Thanks,
> jay
>
> Warning: php_hostconnect: connect failed
> Warning:
>
fopen("http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml";
> ,"r") - Bad file descriptor
>
>


-- 
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: move_uploaded_file permissions

2001-07-31 Thread Richard Lynch

> I tried the new move_uploaded_file() function.  It seems to work fine
> but doesn't assign any permissions to the moved file, not even for
> reading.
>
> Is there any way around this? Can I define the permissions myself?

http://php.net/chmod
http://php.net/umask
http://php.net/chown

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Large Calculations

2001-07-31 Thread Richard Lynch

> I have a mySQL database holding baseball stats and I want to calculate
> rankings on these players.  Now I'd obviously want this to be as fast as
> possible since I go through about 600 players but where is it best to make
> them?  In the SQL command itself or in PHP?

Not even a close race:  SQL will win every single time.

Databases have been optimized to hell and back for DECADES to do this kind
of stuff fast.
PHP has only been alive for 5 years.
You do the math :-)

Not that PHP is slow, but SQL will win for sure.

> 1. batting average x .05
> 2. doubles + triples + HR divided by at bats
> 3. runs scored divided by at bats
> 4. rbi's divided by at bats
> 5. stolen bases divided by at bats
> next add up the 5 totals then multiply that total by 200.   It's a bse 100
> system. a rating over 100 is very good.

Not sure exactly which columns you have in your database, but do something
not unlike this:

select (hits/atbats * 0.05 + ((doubles + triples + homers)/atbats) +
runs/atbats + stolen/atbats) * 200 as rating from players order by rating
desc

That's all 1 line, no matter what you see...

For 600 hundred players, this isn't going to even be a burp on the system to
do the work.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: "Call to a member function on a non-object" error!

2001-07-31 Thread Richard Lynch

>Fatal error: Call to a member function on a non-object >in
/home/cmradmin/public_html/thus/basket.php on line 304
>
>Does anyone know what the flaming heck that means?  I'm trying to fix this
little problem >which has only appeared since my webserver upgraded to PHP4.
>
>Line 304 contains this:
>
>$MyCart->Display($Orderno);

PHP thinks that $MyCart ain't an object, much less a Cart object.

At line 303, insert:
echo "MyCart is a ", vartype($MyCart), "\n";
vardump($MyCart);

and see what you get.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Reading from remote files

2001-07-31 Thread Richard Lynch

> I am trying to read in a nav bar from a remote web page into my web page.
> There is a comment at the start  and one at the
end
> , and i want to be able to read in everything
between
> these two comments.

How sure are you that these comments won't change...?

http://whatever.com/navbar.htm";) or die("Could not snag
remote web page.");
$html = implode('', $remote);
$parts = explode('', $html);
$goodpart = $parts[1];
$parts = explode('', $goodpart);
$navbar = $parts[0];
echo $navbar;
?>

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: splitting a string in half

2001-07-31 Thread Richard Lynch

> I wish to split my databased string in half to be shown on 2 seperate
> columns, but also preserve whole words. Is there a function that does this
> already? Maybe a quick fix? Hopefully something that doesn't include html
> tags as part of the string to split. If it's not that specific then that's
> okay.

I suppose that this would work if it weren't for the HTML tags inside your
text:

$text = "Suppose this text was really long.";
$half_length = (int) strlen($text) / 2;
$split = wordwrap($text, $half_length, "");
echo "$split";

Now, once you throw HTML tags into your string, you are in a much trickier
problem...  Don't really see *any* solution for that in a general sense,
since somebody could use a tag that spans the entire text, and then you
can't break it in half at all...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: calling javascript functions inside PHP

2001-07-31 Thread Richard Lynch

> I use a PHP self-validating form for taking orders off my site. (on submit
> it calls itself and if there are no errors a send variable is set and it
> emails me the information, etc - standard stuff).

Relying on JavaScript as your only validation is a BAD IDEA.  The user could
trivially bypass JavaScript and send you all sorts of nasty stuff.

> I'd like to start taking CC orders and would like to encode the
information
> using javascript
> http://javascript.internet.com/passwords/virgenere-encryption.html.  I'll
> use a hidden value as a codephrase to encode the CC number, then when I
> receive the order I can go to a secure page on the site to decrypt it.

No.  Really BAD IDEA.  Use an SSL server.

> The question is - how do I call a javascript function from my PHP code?

You don't.  You'd have to code the decoder stricly in PHP, using the
counter-matching value from the (presumed) key-pair of the PGP codephrase.

I haven't actually read the link above, as it's silly to use that when you
should use SSL in the first place, so I dunno what whack thing they are
doing if they aren't doing some sort of PGP thing.

>  I
> want to do the encoding just before I email the form variables.  ie -
>
> if ($send == "yes"){
> do javascript encoding of cc number
> $mail (information to me)
> echo ("Your Order has been sent")
> }

Do *NOT* email yourself a CC number in clear-text.  Email is eminently
hackable.  PGP (or gpg http://gnupg.org) encrypt it...

No, cancel that.  Just do it the industry-tested standard way with SSL and a
bank backend like everybody else, or use http://ccnow.com or similar service

Don't risk your customer's credit card info on some untested scheme.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: How to get the post variable ?

2001-07-31 Thread Richard Lynch

>In authentication.php it will call one html which will inturn contains
frames and in one >frame 4 links r there.
>
>For every link i will call one php file. I want to get one variable that is
posted during >login in this php file .


&bar= ...>
&bar= ...>
&bar= ...>
&bar= ...>


--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




-- 
PHP 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: Find and Replace

2001-07-31 Thread Richard Lynch

> So, I want to rename them to *.inc.php

No, you don't. :-)

That allows hackers to surf to individual pieces of your code in 
knows what circumstances and do an end-run around any data-sanitizing you
have in your .php files...  That's even worse for security than revealing
the contents of your .inc files in the first place.

What you *REALLY* want is to force Apache via httpd.conf or .htaccess simply
*NOT* server up any .inc files, or, better yet, to move your .inc files out
of the web-tree *entirely* and use include_path to get them include-able by
PHP.

For example:

Assume that your web-server currently looks kinda like this:

/your-home-dir
/htdocs
index.php
coolpage.php
whatever.inc
somemore.inc

Do this:
/your-home-dir
whatever.inc
somemore.inc
/htdocs
.htaccess
index.php
coolpage.php

So now your .inc files aren't even visible to a web-surfer, no matter what
your httpd.conf looks like.  Well, unless you're silly enough to screw up
and set up your home dir inside a DocumentRoot at some point...  You'd have
to be pretty asleep to do that, though...

-- .htaccess -
php_value include_path "./:/full/path/to/your-home-dir"
--

You can use  in your /htdocs directory to find out the
full path bit you need above.  Throw it away as soon as you're done with it
though, as phpinfo() reveals far too much about your web-server to leave it
laying around for hackers to peruse.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] textfile??????

2001-07-31 Thread Muhv

Hi

Why this code will make empty line between each text line???

$linkFile='link.txt';
$links=file($linkFile);
$fs=fopen($linkFile,'w+');
for ($i=0; $ihttp://www.mp3.com,MP3 Site,Official mp3 site,0
http://www.winamp.com,Winamp,Winamp - MP3 Player,0
---

,and after running this script several times:
---
http://www.mp3.com,MP3 Site,Official mp3 site,0




http://www.winamp.com,Winamp,Winamp - MP3 Player,0




---

I dont want those emty lines!

Help please


-
Meeldetuletused kalendrist sms-lühisõnumina. Uuri järgi!
http://www.hot.ee



-- 
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_SELF

2001-07-31 Thread Jon Haworth

> if ($post = "1" && $Age = " ") {echo "NO";}
> else {echo "YES";}
> Now here is what happens.  On a first time view of the page it outputs 
> 'NO' (Good).  If I dont enter anything in the age field and submit the 
> form it outputs 'NO' (Good).  If I enter a value into the age field and 
> submit, it outputs 'NO' (Not Good).

You are assigning these values, not comparing them

$post = "1"// puts "1" in the variable $post
$post == "1"   // compares $post to "1"

you need to change your code to 

if ($post == "1" && $age == " ") { blah blah blah

HTH
Jon

-- 
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] Why is XML parser so slow?

2001-07-31 Thread terry chay

No the XML parser is not slow at all. Especially since the only one 
available in PHP 3 would have to be expat base. Since expat is an event 
based parser and a very well coded one, you should be able to extract 
strings from the XML document very easily.

Note that there are some libraries out there which take an XML 
document and put it into a tree of objects. These might not be fast (I 
never tried them on PHP < 4.0.4). The correct approach if you need to 
manipulate the whole XML data store at once is to use a DOM based parser. 
Since PHP 4.0.2 there has been a DOM based parser marked as experimental. 
The thing is highly unstable and the PHP functions are very buggy so 
you'll have to work around those bugs. Also, the functionality is very 
un-DOMlike and most of the useful method calls aren't implemented.

Oh yeah, the parser leaks memory too. Typically a DOM based parser 
will use about 1.5x as much memory as the actual XML file, this one seems 
to use many times more--an double again in size they introduced XPATH 
support (I think around PHP 4.04pl1 or so). Note that this isn't a true 
memory leak since all the memory gets returned the httpd and the next PHP 
processes when the application quits.

However it is quite fast. I built a production web application for my 
last company with it. Each process (of which 80 or so run simultaneously 
on each server during peak) uses 100k+ XML file as well as a bunch of 
smaller (5L) files and the only lag is that the fact that the PHP 
processes can get so large that the operating system (FreeBSD and Linux) 
will end up swapping.

Note that a properly coded event based parser (expat) will beat a DOM 
one almost every time if speed is an issue. Personally, unless you are 
working on a large data store, the DOM one should be good enough given 
that everything will have latency once it goes over the internet. In the 
case of very large data stores, I recommend you install a database that 
understands XML (Oracle, SQL Server, etc).

Hopefully someone will fix the DOM issues in PHP in the next couple 
releases.

Take care,

terry

-- 
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: What tools do you use to develop PHP?

2001-07-31 Thread Ralph Guzman

Homesite: http://www.allaire.com/products/HomeSite/

-Original Message-
From: Matt Rogers [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 7:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: What tools do you use to develop PHP?

I like PHPCoder for Winblowz:

http://www.phpide.de


There are a couple of others, but this one lets you do all kinds of stuff
built-in.  Of course, it's for Windows and you have to download the
documentation (mySQL, PHP, and htmlhelp.com's HTML docs)

And the fact that it's still kinda buggy But it works and keeps me from
having to load a bunch of different programs all at once to write, upload,
and test my php scripts. =)

(I'm a Beta enthuisiast)
---
-- M&D Creations
- Matt Rogers
- Web Design Dept.
- [EMAIL PROTECTED]
"Gerry Kirk" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I'm putting together a PHP development framework for our small group. We
> have worked on a couple of small apps, so now it's time to do things a
> little more methodically, i.e. make life easier for everyone. :)
>
> So, I scanned the web and found quite a few options for code libraries,
> and a few for PHP code editors.
>
> I'm interested to know what tools / libraries people prefer -
>
> 1. Code libraries:
> a) Metabase (for database abstraction)
> b) PHPLib
> c) PEAR
> d) BinaryCloud
> e) other
>
> 2. What code editor do you use?
>
> 3. Source code control. CVS appears to be the only real option here.
>
> TIA,
> Gerry
>



--
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 configuring PHP

2001-07-31 Thread Peter Yung

Hi, 

I am having a problem configuring PHP 4.0.5 for my Red Hat Linux 6.2 server.

I am using Apache 1.3.12.

When I try to "configure" PHP it comes up with the following error?

checking whether to enable a memory limit... no

checking whether to enable Zend debugging... no

checking for inline... inline

Configuring TSRM

checking for stdarg.h... (cached) yes

Configuring libtool

checking build system type... Invalid configuration `enable-track-vars': machine 
`enable-track' not recognized

checking for ld used by GCC... /usr/bin/ld

checking if the linker (/usr/bin/ld) is GNU ld... yes

checking for BSD-compatible nm... /usr/bin/nm -B

updating cache ./config.cache

loading cache ./config.cache within ltconfig

ltconfig: you must specify a host type if you use `--no-verify'

Try `ltconfig --help' for more information.

configure: error: libtool configure failed

[root@test php-4.0.5]# 



I was wondering do I really need this "enable-track" thing.  It seems that this is the 
only one that is causing the problem.  If I leave it out would it be better?

Thanks.



Peter




Re: [PHP]DB Logic help...

2001-07-31 Thread Michael Egan

Chris,

You don't say which database package you're using so perhaps it is the
underlying design logic you're after rather than specific code.

One book I've seen recommended in a number of places is by Michael
Hernandez (I think it's called 'Database Design for Mere Mortals'). I've
had a look at this myself and it's written in a clear manner.

The thing to consider is what sort of relationship there is, if any,
between things such as the bands and links. The way in which you want to
access the data to pull into your PHP application will need to be
considered when looking at the table design.

Hope this helps,

Michael Egan

Chris Cocuzzo wrote:
> 
> hey-
> 
> I have a few pages on my website which need to be divided up into different
> columns and rows based on a category in a table. for example, on a links
> page, I have three different columns, one for bands, one for sites, and one
> for other things. I'm storing those things in the table with a category
> field, so that when I output the data, it goes to the right place. However
> I'm a little unsure of the actual code to do this...
> 
> can someone lend me an example or give me some ideas?
> 
> thanks
> 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 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] problems configuring PHP

2001-07-31 Thread David Robley

On Tue, 31 Jul 2001 17:51, Peter Yung wrote:
> Hi,
>
> I am having a problem configuring PHP 4.0.5 for my Red Hat Linux 6.2
> server.
>
> I am using Apache 1.3.12.
>
> When I try to "configure" PHP it comes up with the following error?
>
> checking whether to enable a memory limit... no
>
> checking whether to enable Zend debugging... no
>
> checking for inline... inline
>
> Configuring TSRM
>
> checking for stdarg.h... (cached) yes
>
> Configuring libtool
>
> checking build system type... Invalid configuration
> `enable-track-vars': machine `enable-track' not recognized
>
> checking for ld used by GCC... /usr/bin/ld
>
> checking if the linker (/usr/bin/ld) is GNU ld... yes
>
> checking for BSD-compatible nm... /usr/bin/nm -B
>
> updating cache ./config.cache
>
> loading cache ./config.cache within ltconfig
>
> ltconfig: you must specify a host type if you use `--no-verify'
>
> Try `ltconfig --help' for more information.
>
> configure: error: libtool configure failed
>
> [root@test php-4.0.5]#
>
>
>
> I was wondering do I really need this "enable-track" thing.  It seems
> that this is the only one that is causing the problem.  If I leave it
> out would it be better?
>
> Thanks.
>
>
>
> Peter

You haven't shown your configure arguments but just for a guess, did you 
specify --enable-track-vars? Do a configure --help |less to see all the 
possible configuration parameters.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Bad breath is better than no breath.

-- 
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] Example high-profile PHP sites

2001-07-31 Thread Ralph Guzman

here are a few:

http://www.marketplayer.com: they provide the real-time stock market
simulations for sites like etrade.com and smartmoney.com that have these
games.

http://www.chek.com/



-Original Message-
From: Maurice Rickard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 9:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Example high-profile PHP sites

For a number of reasons, I need to offer a client a list of big,
impressive-sounding, high-profile sites using PHP.  I went looking
for the list on PHP.net, and the closest I could find is
http://pt2.php.net/sites.php  which, as you'll see, is suffering from
a fatal error.

I did find a list at http://php.datalogica.com/sites.php which, while
helpful,  seems a bit dated.  Does anyone have some favorite examples
that aren't on this list?

I've been preparing other arguments as well, but the "all the cool
people are doing it" examples will help.

Thanks!
--
Maurice Rickard
http://mauricerickard.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]




Re: [PHP] search array for value

2001-07-31 Thread Lenar

> > How do I search an array?
> >
> > For example if I want to know if $array contains "1"...
> >
> > Regards,
> >
> > Matthew Delmarter
> >
>
This is bad, use in_array() or array_search().
in_array() returns TRUE if element is found in array.
array_search returns the key of matching element, FALSE otherwise.

Lenar

> for ($i = 0; $i < count($array); $i++)
> {
> if ($array[$i] == 1) {
> //do something
> exit;
> }
> }
>



-- 
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] problems configuring PHP

2001-07-31 Thread Peter Yung

Sorry forgot to be in my configuration arguments.

Here they are:

#./configure --with-mysql=/usr/local/mysql \
--with-xml
--with-apache=../apache_1.3.2\
--enable-track-vars





- Original Message - 
From: "David Robley" <[EMAIL PROTECTED]>
To: "Peter Yung" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 4:41 PM
Subject: Re: [PHP] problems configuring PHP


> On Tue, 31 Jul 2001 17:51, Peter Yung wrote:
> > Hi,
> >
> > I am having a problem configuring PHP 4.0.5 for my Red Hat Linux 6.2
> > server.
> >
> > I am using Apache 1.3.12.
> >
> > When I try to "configure" PHP it comes up with the following error?
> >
> > checking whether to enable a memory limit... no
> >
> > checking whether to enable Zend debugging... no
> >
> > checking for inline... inline
> >
> > Configuring TSRM
> >
> > checking for stdarg.h... (cached) yes
> >
> > Configuring libtool
> >
> > checking build system type... Invalid configuration
> > `enable-track-vars': machine `enable-track' not recognized
> >
> > checking for ld used by GCC... /usr/bin/ld
> >
> > checking if the linker (/usr/bin/ld) is GNU ld... yes
> >
> > checking for BSD-compatible nm... /usr/bin/nm -B
> >
> > updating cache ./config.cache
> >
> > loading cache ./config.cache within ltconfig
> >
> > ltconfig: you must specify a host type if you use `--no-verify'
> >
> > Try `ltconfig --help' for more information.
> >
> > configure: error: libtool configure failed
> >
> > [root@test php-4.0.5]#
> >
> >
> >
> > I was wondering do I really need this "enable-track" thing.  It seems
> > that this is the only one that is causing the problem.  If I leave it
> > out would it be better?
> >
> > Thanks.
> >
> >
> >
> > Peter
> 
> You haven't shown your configure arguments but just for a guess, did you 
> specify --enable-track-vars? Do a configure --help |less to see all the 
> possible configuration parameters.
> 
> -- 
> David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  
> 
>Bad breath is better than no breath.


-- 
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: Can't write to file via php, just via ftp...Can anyone help?

2001-07-31 Thread elias

Hmm...I'm not a *nix guru, but I remember there is a command that allows you
to change current user.
so suppose it was called: changeuser, do this with PHP as web user:

1)execute changeuser [ftplogin] [ftppassword]
normally the ftp user have the rights to change mode and write to files
2)execute chmod filename newmode (as ftp user)

hope this gives a hint,

//elias

"Stephan HüBner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> another newbie-question, probably... :-)
>
> And sorry for my (possibly) bad english, I'm from Germany.
>
> the problem I noticed is that I have to write to a file on the server. I
> created a directory where I store the files, upload a data-file into it
and
> tried to write to it via a php-file. But it seems I don't have the right
to
> write to it and somehow I can't change that with the ftp-programm I have
> ("Interarchy" on the Mac). So, does anybody know if there is a solution
for
> this? I mean, others have to write to the server too, so there must be a
way
> to do it... (btw, it's a linux or unix server where the pages are on).
> Thanks for your thoughts.
>
>
> Have a nice day,
>
> Stephan Huebner
>



-- 
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: Cannot connect to db when running PHP as Cron

2001-07-31 Thread Richard Lynch

>Here is the crontab entry:
>*/1 * * * * /usr/local/bin/php ora_test.php >> /tmp/cron_oralog
>
>Warning:  Oracle: Connection Failed: Error while trying to retrieve
>text for error ORA-12154

The user running the cron job probably doesn't have the various ORA
environment variables set such as ORA_HOME etc.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Cannot copy a file to a dynamic folder

2001-07-31 Thread Richard Lynch

> // Make new directory function
> $default_dir = ("D:\www\Proj\$textfield2\");

The ()'s are silly... They force the string to be evaluated before any other
expressions in this statement, and there aren't any.

The \'s are bad, though.  \ is a "special" character inside of " and you
need to put \\ to get one \.  So, this line should be:

$default_dir = "D:\\www\\Proj\\$textfield2\\";

An alternative is to just / like a real OS :-)
$default_dir = "D:/www/Proj/$textfield2/";

Can't guarantee the trailing slash belongs there or not.  You'll have to try
both ways to be sure.

> if(file_exists($default_dir)) rmdir($default_dir);

This is technically okay, but sooner or later, you're going to need to do
more than just rmdir.  I'd recommend using:

if(file_exists($default_dir)){
rmdir($default_dir);
}

> mkdir($default_dir, 0777);

Logically, it might be better to test if the directory does *NOT* exist,
then make it.  Thus replace these two (well, four lines, now) with:

if (!file_exists($default_dir)){
mkdir($default_dir);
}

NOTE:  This will puke if D:\\www\\Proj doesn't already exist...  You may
want to add some error checking such as:

if (!file_exists($default_dir)){
if (!mkdir($default_dir)){
echo "Could not create $default_dir.  Parent directory probably
doesn't exist.";
}
}

> // Copy template.html to new directory
> $filename = D:Automator\auto_2\Template.html;

You need quotes and \\ for each \ and you are missing a \ after D:
$filename = "D:\\Automator\\auto_2\\Template.html";

> copy($filename, ($default_dir) .overview.html);

You need quotes around the overview.html part:
copy($filename, ($default_dir) . "overview.html");

You may want to alter you php.ini file and use E_ALL (including E_NOTICE)
instead of the default setting -- A lot of the errors you are making would
be more clear if you did that.

> Can I not have these two scripts run together? The mkdir function alone
> works. Can someone tell me what I'm doing wrong?

I think I hit everything, but you never know for sure until it actually
works, eh?

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: Regular expressions

2001-07-31 Thread Richard Lynch

Your three str_replace calls might be faster anyway...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Philip Murray <[EMAIL PROTECTED]>
Newsgroups: php.general
To: PHP General List <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:31 AM
Subject: Regular expressions


> In Perl you can do this:
>
> $foo =~ tr/012/mpf/;
>
> Which is the same as:
>
> $foo = str_replace("0", "m", $foo);
> $foo = str_replace("1", "p", $foo);
> $foo = str_replace("2", "f", $foo);
>
> in PHP.
>
> Is there a more elegant way of doing this in PHP? I tried preg_replace but
> it didn't seem to like my regexp.
>
> Any ideas?
>
>  -  -- -  -   -
> Philip Murray
> [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 is the management of memory by PHP?

2001-07-31 Thread Richard Lynch

> I would like to know like is the management, that recourses the php
utlize.
> I am making a work to university and I need of  more information.
> I find in www.zend.com a article about Reference Counting, but i stayed
> confuse, if o recourse is of PHP 4 or of
> ZEND Engine..

Deep inside of PHP4 dealing with issues like memory management and parsing
and whatnot is the Zend Engine.

Thus, for this question, the distinction between PHP and the Zend engine is
meaningless.

Here is a gross simplification of how it works:

PHP does reference counting which basically means that for any "chunk" of
data, PHP "knows" how many variables are looking at it.  Any time a new
variable is created to "look" at the same "chunk", that chunk's count goes
up by 1.  Any time a variable is changed to "look" at some other chunk, or
at nothing, the original chunk's count goes down by 1.

If a chunk's count hits 0, there ain't nobody left looking at that chunk, so
that memory can safely be re-used for something else.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] md5 crypt question

2001-07-31 Thread Richard Lynch

> Yeah, I'm getting 2 and 0.  Lame.  What's the answer to this.

Go back to your PHP source directory and start digging through config.log
and config.cache or even re-run the configure to see what's going on with
various crypt libraries.

If you installed them in a non-standard place, maybe PHP just ain't finding
them.

You may even need to dig into the Makefiles to figure out where PHP expects
them and make some sym-links so configure can find them.

Don't forget make clean and rm config.cache

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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: formating numbers to two decimal points - money - best ways

2001-07-31 Thread Richard Lynch

You mean like PHP's number_format function http://php.net/number_format :-)

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Tim Olsen <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 2:51 AM
Subject: formating numbers to two decimal points - money - best ways


> Anyone have functions for formatting numbers being multiplied by variables
> and whatnot to two decimal points - rounded up? As for displaying total
> cost, etc?
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.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] Re: method=post destroys PHPSESSID??

2001-07-31 Thread Richard Lynch

What if you lose the JavaScript and keep the POST?...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Dan Harrington <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 7:51 PM
Subject: method=post destroys PHPSESSID??


> Hello all,
>
> I'm having a heck of a time with a file uploader
> page.  When I set method=post on the file uploader
> form, the PHP session is somehow corrupted
> during the upload, and any links made in the
> in the resulting page (photoupload.php) don't
> pass along the session even though they
> have the exact same PHPSESSID value.
>
> ==
> file://upload request page
>  ENCTYPE="multipart/form-data">
> 
> .
> .
> .
> [snip]
> 
>
> ==
>
> The session and variables seem fine _IN_ photoupload.php,
> but when I try to link to another page from the
> photoupload.php page, it is broken.
>
> But when I right-click on the links, copy the link
> shortcut complete with PHPSESSID,
> e.g.
> (http://foo.bar.com/asdfsad.php?PHPSESSID=!@#$!@#$!@#$!@#$!@#$@!#$)
>
> and then I take and paste that into the location: field in
> a newly opened web browser, the session works and I
> can continue to use it.
> But when I try to click on the link inside of the photoupload.php,
> the session dies and doesn't show any of the PHP session variables
> even though I've checked and they exist and have values in the
> session files on the hard drive on the server.
>
> One more weird anomaly, is that when I change the method=post
> to method=get in the html upload request page, I don't have
> these problems with the session.  (I just have problems with the
> file upload because it requires method=post).
>
> Anyone have an idea to whats going on here?
>
> Thanks
>
> Dan
>


-- 
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: How make the time

2001-07-31 Thread Richard Lynch

>The client wants to get a report written out over each hour like this:
>
>11:002 Customers
>11:1532 Customers
>11:3012 Customers
>...
>...
>22:3014 Customers

Assuming you only allow them to put in valid :15 minute data in the first
place:

$query = "select time_field, count(*) from booking GROUP BY time_field order
by time_field";
$bookings = mysql_query($query) or die(mysql_error());
while (list($time, $count) = mysql_fetch_row($bookings)){
echo "$time $count Customers\n";
}

The GROUP BY clause "smushes" all records with the same value in that field
together in a set so you can get the COUNT.  Or AVERAGE on another field, or
MIN or MAX or all sorts of other cool "AGGREGATE" functions.

For example, the following might be a query you'd write to tell him which
hours are his biggest/lowest revenue-generators:

select time_field, min(bill), max(bill) from receipts group by time_field

Assuming that for each reservation he had recorded their bill in the first
place...



-- 
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: How can i pop my mails?

2001-07-31 Thread Richard Lynch

Use IMAP, which supports POP.

Search php.net for "IMAP"

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Elias <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 5:05 AM
Subject: How can i pop my mails?


> Hi
>
> Using PHP, how can i check my mail and dump it to a text file?
>
> As if email2text ?
>
>
>


-- 
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: date

2001-07-31 Thread Richard Lynch

> how do i check that the current date is the end of month ?

In PHP?

$now = date('m/d/Y');
$parts = explode('/', $now);
list($month, $day, $year) = $parts;
$tomorrow = mktime($month, $day + 1, $year);

if ($month != date('m', $tomorrow)){
echo "LAST DAY!\n";
}

Probably can be done in SQL as well.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] problems configuring PHP

2001-07-31 Thread Richard Lynch

Missing \ after some lines, and don't use relative directory to Apache --
use full path from /

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Peter Yung <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 4:47 AM
Subject: Re: [PHP] problems configuring PHP


> Sorry forgot to be in my configuration arguments.
>
> Here they are:
>
> #./configure --with-mysql=/usr/local/mysql \
> --with-xml
> --with-apache=../apache_1.3.2\
> --enable-track-vars
>
>
>
>
>
> - Original Message -
> From: "David Robley" <[EMAIL PROTECTED]>
> To: "Peter Yung" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 4:41 PM
> Subject: Re: [PHP] problems configuring PHP
>
>
> > On Tue, 31 Jul 2001 17:51, Peter Yung wrote:
> > > Hi,
> > >
> > > I am having a problem configuring PHP 4.0.5 for my Red Hat Linux 6.2
> > > server.
> > >
> > > I am using Apache 1.3.12.
> > >
> > > When I try to "configure" PHP it comes up with the following error?
> > >
> > > checking whether to enable a memory limit... no
> > >
> > > checking whether to enable Zend debugging... no
> > >
> > > checking for inline... inline
> > >
> > > Configuring TSRM
> > >
> > > checking for stdarg.h... (cached) yes
> > >
> > > Configuring libtool
> > >
> > > checking build system type... Invalid configuration
> > > `enable-track-vars': machine `enable-track' not recognized
> > >
> > > checking for ld used by GCC... /usr/bin/ld
> > >
> > > checking if the linker (/usr/bin/ld) is GNU ld... yes
> > >
> > > checking for BSD-compatible nm... /usr/bin/nm -B
> > >
> > > updating cache ./config.cache
> > >
> > > loading cache ./config.cache within ltconfig
> > >
> > > ltconfig: you must specify a host type if you use `--no-verify'
> > >
> > > Try `ltconfig --help' for more information.
> > >
> > > configure: error: libtool configure failed
> > >
> > > [root@test php-4.0.5]#
> > >
> > >
> > >
> > > I was wondering do I really need this "enable-track" thing.  It seems
> > > that this is the only one that is causing the problem.  If I leave it
> > > out would it be better?
> > >
> > > Thanks.
> > >
> > >
> > >
> > > Peter
> >
> > You haven't shown your configure arguments but just for a guess, did you
> > specify --enable-track-vars? Do a configure --help |less to see all the
> > possible configuration parameters.
> >
> > --
> > David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> > CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA
> >
> >Bad breath is better than no breath.
>


-- 
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: storing array in mysql

2001-07-31 Thread elias

when you submit this form, PHP will give a array variable called $name

you can store in in MySql as:



now to reget the array, you can select it back from MySql and split it as:


//elias
"Matthew Delmarter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I want to store the results of a multiple select input box in a mysql
> db. The box looks like this:
> 
> name
> 
>
> I cannot seem to store the array in a database and then output the
> result using foreach. Any tips?
>
> Regards,
>
> Matthew Delmarter
> Web Developer
>
> AdplusOnline.com Ltd
> www.adplusonline.com
>
> Phone: 06 8357684
> Cell: 025 2303630
>



-- 
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: Making graphs from within PHP?

2001-07-31 Thread elias

You can use the GD Image Library calls to draw a graph,

http://www.php.net/manual/en/ref.image.php

"Dr. Evil" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I have a PHP application, and I need to display some dynamic data as a
> simple line graph (a gif or png).  Is there a simple way to do this?
> Maybe something I can compile in to PHP?
>
> 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] Re: textfile??????

2001-07-31 Thread elias

I tried it and it works good!

"Muhv" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> Why this code will make empty line between each text line???
>
> $linkFile='link.txt';
> $links=file($linkFile);
> $fs=fopen($linkFile,'w+');
> for ($i=0; $i if (count(explode(',',$links[$i]))==4){
> $fout=fwrite($fs,$links[$i]);
> }
> }
> fclose($fs);
>
> Same file before:
> ---
> http://www.mp3.com,MP3 Site,Official mp3 site,0
> http://www.winamp.com,Winamp,Winamp - MP3 Player,0
> ---
>
> ,and after running this script several times:
> ---
> http://www.mp3.com,MP3 Site,Official mp3 site,0
>
>
>
>
> http://www.winamp.com,Winamp,Winamp - MP3 Player,0
>
>
>
>
> ---
>
> I dont want those emty lines!
>
> Help please
>
>
> -
> Meeldetuletused kalendrist sms-lühisõnumina. Uuri järgi!
> http://www.hot.ee
>



-- 
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-qmail-sendmail...cjk

2001-07-31 Thread Richard Lynch

> Warning: mail() is not supported in this PHP build in
> /usr/local/htdocs/test/newsletter/phpmynewsletter/include/cls.php3 on line
> 141

I think that means that whomever configured PHP specifically dis-allowed use
of the function known as mail()...

>
> Now i thought to install SENDMAIL in server A in order to install and
> configure again PHP-APACHE-MYSQL and after uninstall it.
>
> I want to know will this function influence the qmail program?
>
> and another thing that i can do but dont know how is to somehow say to PHP
> that my mail program is QMAIL.Anybody knows how?

You should be able to point PHP to QMAIL's wrapper named "sendmail" and it
won't even know the difference...

But if mail() was disabled at compile-time as I suspect above, there ain't
nothing you can do other than re-compile.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP 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] open_basedir problem?

2001-07-31 Thread uhlar

Hello,

I have a virtual domain "www.domain.sk" in config file.
the domain resides in /home/user/www.domain.sk directory.
I set up php_admin_flag open_basedir /home/user for that virtual domain, and
in php.ini I have "open_basedir = /home"

The user created this script:

http://www.domain.sk/index1.php";);
elseif(ERegI("^wap",$HTTP_HOST))
Header("Location: http://wap.domain.sk/index.wml";);
?>

Anyway, trying to browse index.php results in this status:


Warning:  open_basedir restriction in effect. File is in wrong
directory 
in Unknown on line 0

Warning:  Failed opening
'/home/user/www.domain.sk/index.php' for inclusion (include_path='.') in 
Unknown on line 0


error log says this:

[Tue Jul 31 11:47:44 2001] [error] PHP Warning:  open_basedir restriction in effect. 
File is in wrong directory in Unknown on line 0
[Tue Jul 31 11:47:44 2001] [error] PHP Warning:  Failed opening 
'/home/user/www.domain.sk/index.php' for inclusion (include_path='.') in Unknown on 
line 0

What's that. Does php try to include anything? is it a bug of open_basedir?

That's PHP 4.0.6 on FreeBSD-4.3 with apache-1.3.20; php is compiled as
module.

-- 
 Matus "fantomas" Uhlar, sysadmin at NEXTRA, Slovakia; IRCNET admin of *.sk
 [EMAIL PROTECTED] ; http://www.fantomas.sk/ ; http://www.nextra.sk/
 Silvester Stallone: Father of the RISC concept.

-- 
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] file upload problem - urgent help needed

2001-07-31 Thread Steve Brett

i know this has been posted before but i still haven't figured it out.

the bloke who runs the server for a 'client' of mine has set safe mode on
and therefore the standard file upload scripts fail.

i needed to create a 'dump' of the database in text files whihc i've done by
creating a dir within the httpd dir and chaning the permissions but when i
try to upload files i keep running into the problem whereby php can't write
to the temp dir as it uploads the file.

i get various errors from '. safe mode in operation...' to 'user blah
blah does not have permission to write to /foo/bar/tmp'.

is there ANY way round this ?

Steve



-- 
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] Regex question

2001-07-31 Thread Boaz Yahav

I'm trying to find if a string exists inside a string. Instead of using
strstr() twice I want to use eregi() once.

What I want to check is if "HTTP/1.1 302" or "HTTP/1.0 302" exists in
some $output.

I'm trying something like : 

eregi("[\"HTTP/1.\"]+[0-1]+[\" 302\"]",$output)
eregi("[HTTP/1.]+[0-1]+[ 302]",$output)
eregi("HTTP/1.+[0-1]+ 302",$output)

But I must be off cause it doesn't work.

Anyone?

thanks


berber

--
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_oci8.dll

2001-07-31 Thread Liviu Popescu2

I have installed PHP4 manually to use it with Win2000 
I did everything according to installation guide specifications.
I uncommented,  in php.ini, the line:
extension=php_oci8.dll 
Afer I stopped and started the Web server, and try to load a page, I
get: 
"PHP Warning: Unable to load dynamic library 'c:\php/php_oci8.dll' - The
specified procedure could not be found. in Unknown on line 0".
What should I do? 




--
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: textfile??????

2001-07-31 Thread Muhv

I have Apache 1.3.20 + PHP4.0.6 + Windows NT 4.0!

Is this problem, that I use Windows and not Linux??? File formats???

Muhv

> I tried it and it works good!
> 
> "Muhv" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi
> >
> > Why this code will make empty line between each text line???
> >
> > $linkFile='link.txt';
> > $links=file($linkFile);
> > $fs=fopen($linkFile,'w+');
> > for ($i=0; $i > if (count(explode(',',$links[$i]))==4){
> > $fout=fwrite($fs,$links[$i]);
> > }
> > }
> > fclose($fs);
> >
> > Same file before:
> > ---
> > http://www.mp3.com,MP3 Site,Official mp3 site,0
> > http://www.winamp.com,Winamp,Winamp - MP3 Player,0
> > ---
> >
> > ,and after running this script several times:
> > ---
> > http://www.mp3.com,MP3 Site,Official mp3 site,0
> >
> >
> >
> >
> > http://www.winamp.com,Winamp,Winamp - MP3 Player,0
> >
> >
> >
> >
> > ---
> >
> > I dont want those emty lines!
> >
> > Help please
> >
> >
> > -
> > Meeldetuletused kalendrist sms-lühisõnumina. Uuri järgi!
> > http://www.hot.ee
> >
> 
> 
> 
> -- 
> 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]
> 
> 

-
Meeldetuletused kalendrist sms-lühisõnumina. Uuri järgi!
http://www.hot.ee



-- 
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] Sort by bigger count(*)

2001-07-31 Thread elias

Hello,

I made a query that uses count(*)
now how can i get the results sorted following the biggest count(*) result?




-- 
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] window.open (javascript)

2001-07-31 Thread Eduardo Kokubo

I passed some vars to another page using window.open and it worked fine (but had to 
hide the toolbar). The problem is that wen I check their values like this:
Test: ";
  print $test;
  print "\n";}

if ($adicionais){
  print "Informações adicionais: ";
  print $adicionais;
  print "\n";}

?>
This code always prints Teste and a "0" when it shouldn't print anything. 

Test: ";
  print $test;
  print "\n";}

if ($adicionais != 0){
  print "Informações adicionais: ";
  print $adicionais;
  print "\n";}
 
?>

This one never prints anything. When I use " " or ' ' to check the 0, it happens the 
same thing that the first code.
The other vars that don't use if are working fine. Can anybody please explain this?



[PHP] Workaround for binary arithmatic

2001-07-31 Thread Richard Ellerbrock

I am looking for a php only workaround to do binary arithmatic on large numbers (ip 
addresses represented as integer). Works fine for small numbers (smaller than signed 
long), but ip addresses are unsigned long.

The following yeilds incorrect results:

echo 2473474821 & 4;

The correct answer is NOT 0;

I now have to call an external perl program to do the calc. I have a bug logged with 
php development, but the answer I got is that this will not work till you can have 
unsigned longs in php. I am using php 4.0.6

Please copy me on replies. TIA


--
Richard Ellerbrock
[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] Regex question

2001-07-31 Thread Boaz Yahav

In case anyone is interested, eregi("HTTP/1.[01].302",$output) seems to
work :)

berber

-Original Message-
From: Boaz Yahav 
Sent: Tuesday, July 31, 2001 2:03 PM
To: PHP General (E-mail)
Subject: [PHP] Regex question


I'm trying to find if a string exists inside a string. Instead of using
strstr() twice I want to use eregi() once.

What I want to check is if "HTTP/1.1 302" or "HTTP/1.0 302" exists in
some $output.

I'm trying something like : 

eregi("[\"HTTP/1.\"]+[0-1]+[\" 302\"]",$output)
eregi("[HTTP/1.]+[0-1]+[ 302]",$output)
eregi("HTTP/1.+[0-1]+ 302",$output)

But I must be off cause it doesn't work.

Anyone?

thanks


berber

-- 
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] also window.open(javascript)

2001-07-31 Thread Eduardo Kokubo

I know I sent I message to this list 10 seconds ago, but I have  forgot to ask this, 
it's a different problem. I asked for a file name to upload via html form and tried to 
pass this file to another page using window.open to redirect to a new window (I 
submited first and tried to redirect it from the following page) but it didn't work. 
Can I do anything about this?



[PHP] Upgrading to Windows 2000

2001-07-31 Thread Amarjit Jutley

We are presently running PHP on a Windows NT 4.0 platform and all is working
correctly, we however want to upgeade to Windows 2000 server platform

My question is the application compatible with Windows 2000.

I cannot find the version but listed the size and date of the files
installed.

PHP.exe20kb12/10/2000
PHP.ini24Kb06/10/2000
php4ts.dll964kb12/10/2000

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] Regex question

2001-07-31 Thread CC Zona

In article 
<[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Boaz Yahav) wrote:

> In case anyone is interested, eregi("HTTP/1.[01].302",$output) seems to
> work :)

"." == "any character" (including, but not necessarily, a period).  If you 
want to match a period, escape it or put it in square braces:

eregi("HTTP/1\.[01].302",$output)
   -or-
eregi("HTTP/1[.][01].302",$output)

You might also want to limit what's acceptable before the status code by 
changing ".302" to:
 " 302" //space
   -or-
"[ ]302" //space, made more obvious
   -or-
"[[:space:]]302" //any whitespace character

-- 
CC

-- 
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: HTTP header question.

2001-07-31 Thread Dave

>Matt has it right.  I'm trying to go for a more professional looking
>thing... and I do want it to display a notice when the login fails.  I
>have thought of another way to do it... but it's not pretty, so I'm
>still open to suggestions.  A while back I posted a pseudo-code
>explanation of what it is... attached to this e-mail is the actual
>page... Hopefully it will either shed some light on my predicament or
>help you all to alert me to any major errors that are probably hiding in
>there =>

Attached is your code modified to my way of thinking (not that I am right, just
a different way of doing things that will not require all the excessive code for
the header stuff).

I always try and limit the use of header calls to tasks that actually have to
move to another page.  As such this page does everything internally now (and has
been commented to show the logic train).

IMO it is far more clear, concise, and compact than calling to external classes
or including lots of header code...  which as I believe I've shown you can do
without and still not have ugly page descriptors.

Review and do with as you wish.

Dave



-- 
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] Example high-profile PHP sites

2001-07-31 Thread Dave

Napster follow-up Audio Galaxy http://www.audiogalaxy.com as well.

>-Original Message-
>From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, July 31, 2001 4:59 AM
>To: Maurice Rickard; [EMAIL PROTECTED]
>Subject: RE: [PHP] Example high-profile PHP sites
>
>
>here are a few:
>
>http://www.marketplayer.com: they provide the real-time stock market
>simulations for sites like etrade.com and smartmoney.com that have these
>games.
>
>http://www.chek.com/
>
>
>
>-Original Message-
>From: Maurice Rickard [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, July 26, 2001 9:36 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Example high-profile PHP sites
>
>For a number of reasons, I need to offer a client a list of big,
>impressive-sounding, high-profile sites using PHP.  I went looking
>for the list on PHP.net, and the closest I could find is
>http://pt2.php.net/sites.php  which, as you'll see, is suffering from
>a fatal error.
>
>I did find a list at http://php.datalogica.com/sites.php which, while
>helpful,  seems a bit dated.  Does anyone have some favorite examples
>that aren't on this list?
>
>I've been preparing other arguments as well, but the "all the cool
>people are doing it" examples will help.
>
>Thanks!
>--
>Maurice Rickard
>http://mauricerickard.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 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] php3 -> php4

2001-07-31 Thread Liviu POPESCU

I have a lot of php scripts developed with php3.
I've installed php4 and I get some warnings when I
evaluate variables there are not set (are empty).
In php3 there was no problem (no warning).
If I modify the code by using empty($var) or
isset($var) it's ok, but there are lots of  such
issues.
How could I manage this without major changes? 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.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] Re: window.open (javascript)

2001-07-31 Thread elias

can you show us the code that does the window.open('myfile.php?test=hey')
for example ?

"Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
016e01c119b4$d784d920$a102a8c0@cttmar">news:016e01c119b4$d784d920$a102a8c0@cttmar...
I passed some vars to another page using window.open and it worked fine (but
had to hide the toolbar). The problem is that wen I check their values like
this:
Test: ";
  print $test;
  print "\n";}

if ($adicionais){
  print "Informações adicionais: ";
  print $adicionais;
  print "\n";}

?>
This code always prints Teste and a "0" when it shouldn't print anything.

Test: ";
  print $test;
  print "\n";}

if ($adicionais != 0){
  print "Informações adicionais: ";
  print $adicionais;
  print "\n";}

?>

This one never prints anything. When I use " " or ' ' to check the 0, it
happens the same thing that the first code.
The other vars that don't use if are working fine. Can anybody please
explain this?




-- 
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] exec problem

2001-07-31 Thread KPortsmout

Hi I'm trying to create a script which my cron will run once a day to backup 
my MySQL database, but the exec command doesn't want to work no matter what I 
try... 

exec("mysqldump -h localhost -u user -p pass --opt DataBase > 
BACKUPS/backup.mysql") or die("Problem"); 

I have tried adding the full path to mysqldump, I have tried using my root 
access, I have tried using a different dir to store the files, changed 
permissions all sorts and nothing works. It always returns "Problem" and if I 
take out the or die then it just returns a blank screen. I also tried system 
() and that gave the same results. 

Anyone have any other ideas??? 

TIA


__
-Ade 

~~Good things come to those who wait~~

-- 
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: php3 -> php4

2001-07-31 Thread elias

Edit your PHP.ini file and change the error_reporting to:

error_reporting=E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; show only errors

"Liviu Popescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a lot of php scripts developed with php3.
> I've installed php4 and I get some warnings when I
> evaluate variables there are not set (are empty).
> In php3 there was no problem (no warning).
> If I modify the code by using empty($var) or
> isset($var) it's ok, but there are lots of  such
> issues.
> How could I manage this without major changes?
>
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.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] Re: window.open (javascript)

2001-07-31 Thread Eduardo Kokubo

This is the code. I use print (php) three times but in the end the code is
generated correctly (another test I'm doing) . I just noticed that the last
variable a pass can be checked using if, but the others can't. I also
changed the name of the variable. instead of $test I use $publicacoes.

\n";
if (!$foto){
 print "window.open (\"professor.php?nome=$nome & curriculo=$curriculo &
interesse=$interesse & adicionais=$adicionais & publicacoes=$publicacoes";
 print "\", \"Professor\", [\"toolbar=no\"]);\n";}
else{
 print "window.open (\"f3_professor.php?nome=$nome & curriculo=$curriculo &
interesse=$interesse & adicionais=$adicionais & publicacoes=$publicacoes";
 print "\", \"f3_professor\", [\"toolbar=no\"]);\n";}

print "";
?>
- Original Message -
From: elias <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 10:42 AM
Subject: [PHP] Re: window.open (javascript)


> can you show us the code that does the window.open('myfile.php?test=hey')
> for example ?
>
> "Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
> 016e01c119b4$d784d920$a102a8c0@cttmar">news:016e01c119b4$d784d920$a102a8c0@cttmar...
> I passed some vars to another page using window.open and it worked fine
(but
> had to hide the toolbar). The problem is that wen I check their values
like
> this:
>  if ($test){
>   print "Test: ";
>   print $test;
>   print "\n";}
>
> if ($adicionais){
>   print "Informações adicionais: ";
>   print $adicionais;
>   print "\n";}
>
> ?>
> This code always prints Teste and a "0" when it shouldn't print anything.
>
>  if ($test != 0){
>   print "Test: ";
>   print $test;
>   print "\n";}
>
> if ($adicionais != 0){
>   print "Informações adicionais: ";
>   print $adicionais;
>   print "\n";}
>
> ?>
>
> This one never prints anything. When I use " " or ' ' to check the 0, it
> happens the same thing that the first code.
> The other vars that don't use if are working fine. Can anybody please
> explain this?
>
>
>
>
> --
> 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] Re: window.open (javascript)

2001-07-31 Thread Dave

have used the following on occasion,


function Popup(page) {
OpenWin = this.open(page, "PopupWindow",
'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,
width=775,height=500');
}


http://mydomain.url/file.php?var=value')">link

don't recall any problems

Dave

>-Original Message-
>From: elias [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, July 31, 2001 9:42 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Re: window.open (javascript)
>
>
>can you show us the code that does the window.open('myfile.php?test=hey')
>for example ?
>
>"Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
>016e01c119b4$d784d920$a102a8c0@cttmar">news:016e01c119b4$d784d920$a102a8c0@cttmar...
>I passed some vars to another page using window.open and it worked fine (but
>had to hide the toolbar). The problem is that wen I check their values like
>this:
>if ($test){
>  print "Test: ";
>  print $test;
>  print "\n";}
>
>if ($adicionais){
>  print "Informações adicionais: ";
>  print $adicionais;
>  print "\n";}
>
>?>
>This code always prints Teste and a "0" when it shouldn't print anything.
>
>if ($test != 0){
>  print "Test: ";
>  print $test;
>  print "\n";}
>
>if ($adicionais != 0){
>  print "Informações adicionais: ";
>  print $adicionais;
>  print "\n";}
>
>?>
>
>This one never prints anything. When I use " " or ' ' to check the 0, it
>happens the same thing that the first code.
>The other vars that don't use if are working fine. Can anybody please
>explain this?
>
>
>
>
>--
>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] Trying to avoid code exploits..

2001-07-31 Thread Meir Kriheli

Hi,
I need another pair of eyes to see if I've overlooked something.

I'm developing a form class for a project. The class can generate the form 
and upon submission validate it through a rules system.

Rules are a valid php command which can evaluate as boolean, e.g.:

$form->addRule('strlen({uname})>0', 'You must specify a user name');

or 

$form->addRule('{pass1}=={pass2}','The passwords are not identical');

I hope you get the idea.

As you can see, the variable names are enclosed in {} and expanded when the 
rule is added. 

so 
'{pass1}=={pass2}' 

is converted to 
'$GLOBALS['pass1']==$GLOBALS['pass2']'

When to form is validated I'm running eval() to evaluate the expression. I'm 
concerned that there's an exploit somewhere, maybe a user entering some 
malicious data (I don't like using eval that often). But I'm not using eval() 
directly on user entered data, and I can't see where it is possible. 

Any comments ?

Thanks
-- 
Kriheli Meir

-- 
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] Customer info PHP script

2001-07-31 Thread Kraa de Simon

Hi,

I want to make (technical) information about our customers available to our
developers though the web.

Things like phone numbers, addresses, logins, passwords, IP's, dial-up info
etc.

Anyone know a good (open source) PHP script that can do this?

Thanks.

Met vriendelijke groet / With kind regards,

ICL Nederland B.V.  Simon de Kraa
e-Applications / Logistic Systems   Systems Architect
Het Kwadrant 1  Tel. +31 346 598865
Postbus 4000Fax  +31 346 562703
3600 KA  MAARSSEN
The Netherlands mailto:[EMAIL PROTECTED]

---

Progress 9.1b, Roundtable 9.1c, NuSphere Pro Advantage 2.2 @ MS Windows 2000
5.00.2195 SP 2
Progress 9.1b @ SCO UnixWare 7.1.1

-- 
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] Embedding PHP into another application...

2001-07-31 Thread Richard Lyle

Hi Everyone,

I'm currently looking at "Lua" for use as a embedded scripting language for
our game, DarkSpace, http://www.palestar.com.

However, I'd like to find out if PHP can be compiled into a LIB and linked
into another application to be used as a embedded scripting language, much
in the way that mod_php4 get's compiled for apache. Since PHP is so much
like C/C++ it makes it alot easier to write in than learn an entirely new
language.

Time is critical for us, since I need to begin work today..

Thanks,
Richard Lyle







-- 
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: window.open (javascript)

2001-07-31 Thread elias

There doesn't seem to be any errors,
but why don't you try to put the names near the '&' w/ space characters
between them:
  print "window.open
(\"professor.php?nome=$nome&curriculo=$curriculo&interesse=$interesse&adicio
nais=$adicionais&publicacoes=$publicacoes";

"Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
006d01c119c0$e6bac6a0$a102a8c0@cttmar">news:006d01c119c0$e6bac6a0$a102a8c0@cttmar...
> This is the code. I use print (php) three times but in the end the code is
> generated correctly (another test I'm doing) . I just noticed that the
last
> variable a pass can be checked using if, but the others can't. I also
> changed the name of the variable. instead of $test I use $publicacoes.
>
>  print "\n";
> if (!$foto){
>  print "window.open (\"professor.php?nome=$nome & curriculo=$curriculo &
> interesse=$interesse & adicionais=$adicionais & publicacoes=$publicacoes";
>  print "\", \"Professor\", [\"toolbar=no\"]);\n";}
> else{
>  print "window.open (\"f3_professor.php?nome=$nome & curriculo=$curriculo
&
> interesse=$interesse & adicionais=$adicionais & publicacoes=$publicacoes";
>  print "\", \"f3_professor\", [\"toolbar=no\"]);\n";}
>
> print "";
> ?>
> - Original Message -
> From: elias <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 10:42 AM
> Subject: [PHP] Re: window.open (javascript)
>
>
> > can you show us the code that does the
window.open('myfile.php?test=hey')
> > for example ?
> >
> > "Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
> > 016e01c119b4$d784d920$a102a8c0@cttmar">news:016e01c119b4$d784d920$a102a8c0@cttmar...
> > I passed some vars to another page using window.open and it worked fine
> (but
> > had to hide the toolbar). The problem is that wen I check their values
> like
> > this:
> >  > if ($test){
> >   print "Test: ";
> >   print $test;
> >   print "\n";}
> >
> > if ($adicionais){
> >   print "Informações adicionais: ";
> >   print $adicionais;
> >   print "\n";}
> >
> > ?>
> > This code always prints Teste and a "0" when it shouldn't print
anything.
> >
> >  > if ($test != 0){
> >   print "Test: ";
> >   print $test;
> >   print "\n";}
> >
> > if ($adicionais != 0){
> >   print "Informações adicionais: ";
> >   print $adicionais;
> >   print "\n";}
> >
> > ?>
> >
> > This one never prints anything. When I use " " or ' ' to check the 0, it
> > happens the same thing that the first code.
> > The other vars that don't use if are working fine. Can anybody please
> > explain this?
> >
> >
> >
> >
> > --
> > 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: Upgrading to Windows 2000

2001-07-31 Thread Steve Brett

instalation under windows 2000 is very simple. just reinstall php.

Steve

"Amarjit Jutley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> We are presently running PHP on a Windows NT 4.0 platform and all is
working
> correctly, we however want to upgeade to Windows 2000 server platform
>
> My question is the application compatible with Windows 2000.
>
> I cannot find the version but listed the size and date of the files
> installed.
>
> PHP.exe20kb12/10/2000
> PHP.ini24Kb06/10/2000
> php4ts.dll964kb12/10/2000
>
> 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] Example high-profile PHP sites

2001-07-31 Thread Maurice Rickard

Hey, thanks, everyone for the examples!  I also dug up a few others 
that are worth considering:

http://www.dc.com/  Deloitte Consulting.  Now *that's* a big name.

Also HP, IBM, and, yes, Microsoft all run _some_ Apache/PHP servers 
(looking it up on Netcraft--use their OS vendors search)

Thanks again to all who have helped!
-Maurice

At 1:58 AM -0700 7/31/01, Ralph Guzman wrote:
>here are a few:
>
>http://www.marketplayer.com: they provide the real-time stock market
>simulations for sites like etrade.com and smartmoney.com that have these
>games.
>
>http://www.chek.com/
>
-- 
Maurice Rickard
http://mauricerickard.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] Re: Upgrading to Windows 2000

2001-07-31 Thread Bernie Kruger

Hi,

I am running PHP 4.0.5 on Win2K.  The ISAPI module gave me lots of headaches
and crashed the server every other minute, but the CGI one runs like a
dream.  I am using IIS5.

BK

"Amarjit Jutley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> We are presently running PHP on a Windows NT 4.0 platform and all is
working
> correctly, we however want to upgeade to Windows 2000 server platform
>
> My question is the application compatible with Windows 2000.
>
> I cannot find the version but listed the size and date of the files
> installed.
>
> PHP.exe20kb12/10/2000
> PHP.ini24Kb06/10/2000
> php4ts.dll964kb12/10/2000
>
> 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] Re: exec problem

2001-07-31 Thread Steve Brett

if you have a shell account write a batch file and install it in the crontab
of the user whihc mysql runs under.

i did this at work for a postgresql database and it owrks perfectly.

something like this will work.

crontab -u  -e

add:
30 7-19/2,23 * * * /backup/dumpit

which runs /backup/dumpit every 2 hours  at 30 mins past the hour between
7am and 7 pm and then again at 11 pm

dumpit consists of:

#!/bin/sh
backdate=$(date +%Y%m%d%H%M.gz)
/usr/local/pgsql/bin/pg_dump XXX  | gzip > /backup/edb-backup_$backdate
cp /backup/edb-backup_$backdate /var/autofs/misc/ecalnet/

so i effect the file creates a file called edb-backup_ which
is a zipped copy of the dump file.

should be simple for you to substitute the mysql dump commands etc.

Steve




<[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi I'm trying to create a script which my cron will run once a day to
backup
> my MySQL database, but the exec command doesn't want to work no matter
what I
> try...
>
> exec("mysqldump -h localhost -u user -p pass --opt DataBase >
> BACKUPS/backup.mysql") or die("Problem");
>
> I have tried adding the full path to mysqldump, I have tried using my root
> access, I have tried using a different dir to store the files, changed
> permissions all sorts and nothing works. It always returns "Problem" and
if I
> take out the or die then it just returns a blank screen. I also tried
system
> () and that gave the same results.
>
> Anyone have any other ideas???
>
> TIA
>
>
> __
> -Ade
>
> ~~Good things come to those who wait~~



-- 
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: storing array in mysql

2001-07-31 Thread Warren Vail

What I have used to store an array in mysql is;

$value = addslashes(serialize($array));
$query = "INSERT INTO table (column) VALUES (\"$value\")"

and upon retrieval
$query = "SELECT column FROM table";
..
while($row = mysql_fetch_array($result)) {
$value = unserialize(stripslashes($row["column"]));
}

Note: serialize allows me to store the array in a single column and
addslashes makes the data mysql safe (i.e. allows me to store quotes in the
column, just in case they are in the array).

Warren Vail

-Original Message-
From:   elias [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, July 31, 2001 4:05 AM
To: [EMAIL PROTECTED]
Subject:[PHP] Re: storing array in mysql

when you submit this form, PHP will give a array variable called $name

you can store in in MySql as:



now to reget the array, you can select it back from MySql and split it as:


//elias
"Matthew Delmarter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I want to store the results of a multiple select input box in a mysql
> db. The box looks like this:
> 
> name
> 
>
> I cannot seem to store the array in a database and then output the
> result using foreach. Any tips?
>
> Regards,
>
> Matthew Delmarter
> Web Developer
>
> AdplusOnline.com Ltd
> www.adplusonline.com
>
> Phone: 06 8357684
> Cell: 025 2303630
>



--
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] Workaround for binary arithmatic

2001-07-31 Thread Phil Driscoll

Use the gmp extension.
-- 
Phil Driscoll

-- 
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

2001-07-31 Thread MindHunter

Hi,

Is it worth the while to read up on PEAR?  I have seen much of it but I
don't know much about it.  I am not a complete newbie anymore and I have
developed quite a few DB driven sites.  Any good readings that you know of?

Ciao
BK



-- 
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: Embedding PHP into another application...

2001-07-31 Thread elias

I suggest you go to http://www.nombas.com they have a library that can be
easily implemented in almost any language.
After you have it implemented you'll be having a new scripting language that
is like ECMAScript (or JavaScript)

So since you're looking for something easy, JavaScript is more easier than
PHP.

Good luck.

//elias
"Richard Lyle" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Everyone,
>
> I'm currently looking at "Lua" for use as a embedded scripting language
for
> our game, DarkSpace, http://www.palestar.com.
>
> However, I'd like to find out if PHP can be compiled into a LIB and linked
> into another application to be used as a embedded scripting language, much
> in the way that mod_php4 get's compiled for apache. Since PHP is so much
> like C/C++ it makes it alot easier to write in than learn an entirely new
> language.
>
> Time is critical for us, since I need to begin work today..
>
> Thanks,
> Richard Lyle
>
>
>
>
>
>



-- 
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: Pear

2001-07-31 Thread Henrik Hansen

[EMAIL PROTECTED] (Mindhunter) wrote:

 > Hi,
 > 
 > Is it worth the while to read up on PEAR?  I have seen much of it but I

I would say it is, but have in my that it's under development

 > don't know much about it.  I am not a complete newbie anymore and I have
 > developed quite a few DB driven sites.  Any good readings that you know of?

http://www.onlamp.com/pub/a/php/2001/05/24/pear.html
http://www.onlamp.com/pub/a/php/2001/07/19/pear.html

-- 
Henrik Hansen

-- 
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: storing array in mysql

2001-07-31 Thread elias

Yes true, you can use serialize.

But since you know the format of your $array variable (which is simply
holding one data type) you can safely use split() and join()
better and smaller when stored in that field because they are comma
seperated.

"Warren Vail" <[EMAIL PROTECTED]> wrote in message
001701c119c8$562b0ca0$b5887ed8@nicker">news:001701c119c8$562b0ca0$b5887ed8@nicker...
> What I have used to store an array in mysql is;
>
> $value = addslashes(serialize($array));
> $query = "INSERT INTO table (column) VALUES (\"$value\")"
>
> and upon retrieval
> $query = "SELECT column FROM table";
> .
> while($row = mysql_fetch_array($result)) {
> $value = unserialize(stripslashes($row["column"]));
> }
>
> Note: serialize allows me to store the array in a single column and
> addslashes makes the data mysql safe (i.e. allows me to store quotes in
the
> column, just in case they are in the array).
>
> Warren Vail
>
> -Original Message-
> From: elias [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 4:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: storing array in mysql
>
> when you submit this form, PHP will give a array variable called $name
>
> you can store in in MySql as:
>
>  // will make the $name as a comma seperated string
> $str = join(",", $name);
> insert into tablename(id, value) VALUES(null, '$str');
> ?>
>
> now to reget the array, you can select it back from MySql and split it as:
>$name = split(",", $str);
> ?>
>
> //elias
> "Matthew Delmarter" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> >
> > I want to store the results of a multiple select input box in a mysql
> > db. The box looks like this:
> > 
> > name
> > 
> >
> > I cannot seem to store the array in a database and then output the
> > result using foreach. Any tips?
> >
> > Regards,
> >
> > Matthew Delmarter
> > Web Developer
> >
> > AdplusOnline.com Ltd
> > www.adplusonline.com
> >
> > Phone: 06 8357684
> > Cell: 025 2303630
> >
>
>
>
> --
> 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: php_oci8.dll

2001-07-31 Thread elias

Basically if you don't have this file you can't use it.
try to see if it exist first. If not go to www.php4win.de or www.php.net and
download the complete PHP Win32 binaries.

"Liviu Popescu2" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have installed PHP4 manually to use it with Win2000
I did everything according to installation guide specifications.
I uncommented,  in php.ini, the line:
extension=php_oci8.dll
Afer I stopped and started the Web server, and try to load a page, I
get:
"PHP Warning: Unable to load dynamic library 'c:\php/php_oci8.dll' - The
specified procedure could not be found. in Unknown on line 0".
What should I do?






-- 
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: window.open (javascript)

2001-07-31 Thread Steve Brett

ive used a very similar function and found that javascript like single
queted strings passed into it.

i.e. java_function('link/to/file')

just noticed in the original post that double quotes were used

Steve

"Dave" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> have used the following on occasion,
>
> 
> function Popup(page) {
> OpenWin = this.open(page, "PopupWindow",
>
'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizabl
e=1,
> width=775,height=500');
> }
> 
>
> http://mydomain.url/file.php?var=value')">link
>
> don't recall any problems
>
> Dave
>
> >-Original Message-
> >From: elias [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, July 31, 2001 9:42 AM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] Re: window.open (javascript)
> >
> >
> >can you show us the code that does the window.open('myfile.php?test=hey')
> >for example ?
> >
> >"Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message
> >016e01c119b4$d784d920$a102a8c0@cttmar">news:016e01c119b4$d784d920$a102a8c0@cttmar...
> >I passed some vars to another page using window.open and it worked fine
(but
> >had to hide the toolbar). The problem is that wen I check their values
like
> >this:
> > >if ($test){
> >  print "Test: ";
> >  print $test;
> >  print "\n";}
> >
> >if ($adicionais){
> >  print "Informações adicionais: ";
> >  print $adicionais;
> >  print "\n";}
> >
> >?>
> >This code always prints Teste and a "0" when it shouldn't print anything.
> >
> > >if ($test != 0){
> >  print "Test: ";
> >  print $test;
> >  print "\n";}
> >
> >if ($adicionais != 0){
> >  print "Informações adicionais: ";
> >  print $adicionais;
> >  print "\n";}
> >
> >?>
> >
> >This one never prints anything. When I use " " or ' ' to check the 0, it
> >happens the same thing that the first code.
> >The other vars that don't use if are working fine. Can anybody please
> >explain this?
> >
> >
> >
> >
> >--
> >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: Session life time

2001-07-31 Thread Steve Brett

check this in php.ini

session.gc_maxlifetime specifies the number of seconds after which data will
be seen as 'garbage' and cleaned up

Steve

"Sheni R. Meledath" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I am using sessions for user authentication on one of our sites. I want to
> set up a time period for each session, ie, after a particular time period
> the session should automatically expire. How can this be achieved? Could
> you please help me.
>
> Many thanks
> Sheni R Meledath
> [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] Customer info PHP script

2001-07-31 Thread B. van Ouwerkerk

Hi,

Checkout sourceforce.net and freshmeat.net (I think).. one of them might 
have something..
If you've got the wrong freshmeat you'll get a lot of meat on your screen.. 
not the one that needs lots of coding ;-)

Or you could code one yourself..

Bye,


B.

At 15:10 31-7-01 +0200, Kraa de Simon wrote:
>Hi,
>
>I want to make (technical) information about our customers available to our
>developers though the web.
>
>Things like phone numbers, addresses, logins, passwords, IP's, dial-up info
>etc.
>
>Anyone know a good (open source) PHP script that can do this?
>
>Thanks.
>
>Met vriendelijke groet / With kind regards,
>
>ICL Nederland B.V.  Simon de Kraa
>e-Applications / Logistic Systems   Systems Architect
>Het Kwadrant 1  Tel. +31 346 598865
>Postbus 4000Fax  +31 346 562703
>3600 KA  MAARSSEN
>The Netherlands mailto:[EMAIL PROTECTED]
>
>---
>
>Progress 9.1b, Roundtable 9.1c, NuSphere Pro Advantage 2.2 @ MS Windows 2000
>5.00.2195 SP 2
>Progress 9.1b @ SCO UnixWare 7.1.1
>
>--
>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] Workaround for binary arithmatic

2001-07-31 Thread Richard Ellerbrock

I thought about that but that would require almost everybody using my app (OpenSource) 
requiring a rebuild of php. This would really detract from its usefulness.

--
Richard Ellerbrock
[EMAIL PROTECTED]

>>> Phil Driscoll <[EMAIL PROTECTED]> 2001/07/31 04:02:50 >>>
Use the gmp extension.
-- 
Phil Driscoll


--
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] Session life time

2001-07-31 Thread Sheni R. Meledath

Hi,

I am using sessions for user authentication on one of our sites. I want to 
set up a time period for each session, ie, after a particular time period 
the session should automatically expire. How can this be achieved? Could 
you please help me.

Many thanks
Sheni R Meledath
[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] Re: storing array in mysql

2001-07-31 Thread Warren Vail

I never seem to be lucky enough to be sure of the type of data stored in a
php array, since php handles mixtures of types so forgivingly, and because
most of my data comes from forms, with users key in what they like,
including double and single quotes, parentheses (and especially commas, how
do you prevent breaking up your array and putting it back together with a
different row count because someone keyed in a comma?), etc.  I would think
you would have to go to a lot of trouble to make sure that an array contains
only numeric data, or only strings that did not contain problem causing
characters.

You are right about more space being required for serialize, I often have to
resort to TEXT data types to provide enough space in the column for data
(65k runs out fast), and that is a bit slower as well.

Warren

-Original Message-
From:   elias [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, July 31, 2001 8:09 AM
To: [EMAIL PROTECTED]
Subject:Re: [PHP] Re: storing array in mysql

Yes true, you can use serialize.

But since you know the format of your $array variable (which is simply
holding one data type) you can safely use split() and join()
better and smaller when stored in that field because they are comma
seperated.

"Warren Vail" <[EMAIL PROTECTED]> wrote in message
001701c119c8$562b0ca0$b5887ed8@nicker">news:001701c119c8$562b0ca0$b5887ed8@nicker...
> What I have used to store an array in mysql is;
>
> $value = addslashes(serialize($array));
> $query = "INSERT INTO table (column) VALUES (\"$value\")"
>
> and upon retrieval
> $query = "SELECT column FROM table";
> .
> while($row = mysql_fetch_array($result)) {
> $value = unserialize(stripslashes($row["column"]));
> }
>
> Note: serialize allows me to store the array in a single column and
> addslashes makes the data mysql safe (i.e. allows me to store quotes in
the
> column, just in case they are in the array).
>
> Warren Vail
>
> -Original Message-
> From: elias [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 4:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: storing array in mysql
>
> when you submit this form, PHP will give a array variable called $name
>
> you can store in in MySql as:
>
>  // will make the $name as a comma seperated string
> $str = join(",", $name);
> insert into tablename(id, value) VALUES(null, '$str');
> ?>
>
> now to reget the array, you can select it back from MySql and split it as:
>$name = split(",", $str);
> ?>
>
> //elias
> "Matthew Delmarter" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> >
> > I want to store the results of a multiple select input box in a mysql
> > db. The box looks like this:
> > 
> > name
> > 
> >
> > I cannot seem to store the array in a database and then output the
> > result using foreach. Any tips?
> >
> > Regards,
> >
> > Matthew Delmarter
> > Web Developer
> >
> > AdplusOnline.com Ltd
> > www.adplusonline.com
> >
> > Phone: 06 8357684
> > Cell: 025 2303630
> >
>
>
>
> --
> 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] Re: Pear

2001-07-31 Thread Henrik Hansen

[EMAIL PROTECTED] (Henrik Hansen) wrote:

 > [EMAIL PROTECTED] (Mindhunter) wrote:
 > 
> > Hi,
> > 
> > Is it worth the while to read up on PEAR?  I have seen much of it but I
 > 
 > I would say it is, but have in my that it's under development
 > 
> > don't know much about it.  I am not a complete newbie anymore and I have
> > developed quite a few DB driven sites.  Any good readings that you know of?
 > 
 > http://www.onlamp.com/pub/a/php/2001/05/24/pear.html
 > http://www.onlamp.com/pub/a/php/2001/07/19/pear.html

there is just one more I want to mention:

http://php.weblogs.com/php_pear_tutorials

-- 
Henrik Hansen

-- 
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: Upgrading to Windows 2000

2001-07-31 Thread Steve Brett

indeed.

i also use the cgi version.

Steve

"Bernie Kruger" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I am running PHP 4.0.5 on Win2K.  The ISAPI module gave me lots of
headaches
> and crashed the server every other minute, but the CGI one runs like a
> dream.  I am using IIS5.
>
> BK
>
> "Amarjit Jutley" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > We are presently running PHP on a Windows NT 4.0 platform and all is
> working
> > correctly, we however want to upgeade to Windows 2000 server platform
> >
> > My question is the application compatible with Windows 2000.
> >
> > I cannot find the version but listed the size and date of the files
> > installed.
> >
> > PHP.exe20kb12/10/2000
> > PHP.ini24Kb06/10/2000
> > php4ts.dll964kb12/10/2000
> >
> > 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] disable?

2001-07-31 Thread Jeremy Morano

Hi,
I was wondering if there was any way to dissable something from the mouse
right click?
ex: When a user visits my site, I don't want them to be able to use the copy
shortcut on the right mouse click.
How would I do this?


-- 
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] Workaround for binary arithmatic

2001-07-31 Thread Phil Driscoll

On Tuesday 31 July 2001 15:26, Richard Ellerbrock wrote:
> I thought about that but that would require almost everybody using my app
> (OpenSource) requiring a rebuild of php. This would really detract from its
> usefulness.
>
> --
> Richard Ellerbrock
> [EMAIL PROTECTED]
>
> >>> Phil Driscoll <[EMAIL PROTECTED]> 2001/07/31 04:02:50 >>>
>
> Use the gmp extension.
Ok - then the only other solution I could think of (and for me it was easier 
just to build php with gmp) was to split all your integers up into 16 bit 
chunks and do the maths longhand on the 16 bit integers. That way, you'll 
avoid the top bit set problem.

Cheers
-- 
Phil Driscoll

-- 
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] Worldpay module an Exchange Project e-commerce site

2001-07-31 Thread Java Jock


I recently just started using PHP. I searched this list's archives first, 
but couldn't find an answer to my question:

Whenever I get a "syntax error" it's always reported "on line 1", even 
when it's obviously not on line 1. I *never* get an error reported on any 
other line #.

Any thoughts on this?

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]




  1   2   3   >