[PHP] Serializing of OOP into sessions

2002-03-13 Thread David Tandberg-Johansen

Hello could somone please explain to me HOW I serialize classes into session
and how I get the on the next page!??

Must I do $object = new ObjectName on the next page for the object to be
used??

How does this work?

Thanks
David



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




RE: [PHP] reset auto_increment field mysql

2002-03-13 Thread Claudiu

It continues incrementing the id field from where it left..
But i found the solution on the web;
it's as simple as :
TRUNCATE mytable; (which deletes the contents and also resets
auto_increment field to 0)

Thanks !

On Tue, 12 Mar 2002, Rick Emery wrote:

 It worked for me.

 What results did you get?


 -Original Message-
 From: Claudiu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 12, 2002 8:51 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] reset auto_increment field mysql


 I wish it was that simple...
 No.. It doesn't work this way...

 On Tue, 12 Mar 2002, Rick Emery wrote:

  your query is:   DELETE FROM mytable;
 
  -Original Message-
  From: Claudiu [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, March 12, 2002 5:09 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] reset auto_increment field mysql
 
 
  I have a mysql table which contains an id field which is set to
  auto_increment.
  I have a script which empties this database at regular intervals.
  My problem is that the auto_increment field won't reset to 0 after
  deleting all of tha data, but continue incrementing from where it left.
 
  How can i solve this problem..
  I want id to reset to 0 when i delete the contents of the table.
  Can someone help?
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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

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



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




Re: [PHP] Serializing of OOP into sessions

2002-03-13 Thread ayukawa


Hello could somone please explain to me HOW I serialize classes into session
and how I get the on the next page!??

Must I do $object = new ObjectName on the next page for the object to be
used??

No.

Try this.
File test.inc--
?php
class Object{
var $name;
var $id;

function pt(){
print ($this-id).:.($this-name);
}
}
?
---

File test.php--
?php
require_once(test.inc);
session_start();
session_register(obj);
if(!$obj) $obj=new Object();
$obj-id++;
$obj-name.=;
$obj-pt();
?
brbr
a href='test.php'Next/a


And open test.php with your brouser  click 'Next'.
No special serialization is required.

Regards,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php

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




[PHP] Array

2002-03-13 Thread Roman Duriancik

I have one small problem. I have array e.g $array but I don't know
how to finding arguments and values of this array.

e.g

$array[aa] = 1;
$array[ab] = some;
...

and script send me :

arguments aa : values 1
arguments bb : values some



thanks, roman


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




[PHP] Splitting Header and Body of an Email?

2002-03-13 Thread J.Mueller, pro.vider.de GmbH

Hello List,

I'm trying aroung to split the header and the body of an email but
can't get it to work.

First I read in the email:

$fp = fopen(php://stdin,r); 
$count = 0;
while (!feof($fp)) 
{ $data = fgets($fp,4096);
  $data = chop($data);
  $count = $count + 1;
  $content[] = $data;
} 
fclose($fp); 

and then

for ($x=0; $x = $count; $x++)
{ $sent_data .= $content[$x]\n;
}

Then I tried stuff like

$mail_split = explode(\r\n\r\n,$sent_data);


How would it work?

Thanks a lot,
Juergen






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




[PHP] Re: PHP based search engine

2002-03-13 Thread Eric Persson

David Robley wrote:
 PHP from around 4.05 has functions available to interface with the 
 mnoGOSearch search engine, available from http://www.mnogosearch.ru/
 
 I recommend you look at this combination.

I recommend this one to, its a very good alternative which I used for 
several projects.

The nice thing is that you can easily update and keep the index updated 
by yourself, no need for that stupid indexer that comes along to crawl 
around your site.

I have a small script which inserts new keywords/descriptions/titles 
directly in the index on update of something that should be searchable.
This is probably easiest to do when you're using a database as a backend 
for the search.

Another soloution is to have a hourly cronscript that updates the index. 
I have used that on bookmarks.egp.cx . Since I have a  modification 
timestamp on each link there I only need to update those who where 
changed since the last indexinground. Often there are no links modified 
in the last hour, so its not very resourcehungry, but that depends on 
the data off course. :)

Just my ideas. :)

Good luck!
Eric


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




Re: [PHP] include() .htaccess

2002-03-13 Thread Patrick Teague

I'm having problems with .htaccess files setting up the php_value
include_dir on both my development  test servers.  I'm using php4 under
apache on win2k for development  php4 under apache on unix as a test
server.  I've currently done the following on the win server

Directory
php_value include_dir .;C:/home/plugged/common/
/Directory

 done the following on the unix server

Directory
php_value include_dir .:/home/plugged/common/
/Directory

neither works...  am I doing something wrong here or am I forgetting
something?

Patrick



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




Re: [PHP] Array

2002-03-13 Thread Hiroshi Ayukawa

How about using the function print_r()  ?

Regards,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php

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




[PHP] Broken DLL's ...

2002-03-13 Thread Marcel Besancon

Hi everybody,

is it possible that there are some broken DLL's in the distributions ??
For example the php_curl.dll . I tried to uncomment it in the php.ini-file
and got an error. But by replacing the php_curl.dll with another
php_curl.dll from the net it works fine.

Is it only me who has this kind of error ???

Bye, Marcel

--
registered Fli4l-User #0388



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




[PHP] Pattern matching in PHP

2002-03-13 Thread Claudiu

Hello!

I have a number... say 12234109 i want to transform it to 12,234,109
or 10312 transformed to 10,312 ... i guess you got my point..


Is there a way doing this... I believe pattern matching...but i dont know
how to do it...
Or any other solution?
Thanks...


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




[PHP] Mail Attachment for Photo

2002-03-13 Thread Mark Lo

Hi All,

I am trying to do a mail attachment for photo(jpeg file) by using
php mail function and qmail server.  I have used the following mime format
to send out photo attachment provide by
http://planetkiller.shadow.net.au/mime-php.txt.  But When I received the
mail in Outlook Express, they are in garbage like 1253254dfafafadgas.

   And the most funny things is that if the mail message has been
modified on the server before downloading to Outlook Express.  Then, I am
able to received the mail in normal situation when downloaded to Outlook
Express.

   By modified I means just to delete a quote or a word, then add it
back and then save the file.

The code is below.  Any body having any ideas.

Thanks in advance

Mark Lo
?
Function mailattachments($to,$subject,$body,$attacharray,$extraheaders)
   {
// Generate a unique boundary
 $mail_boundary =b. md5(uniqid(time()));
// MIME-compliant headers
  $mailheaders = $extraheaders
   .MIME-Version: 1.0\r\n
   .Content-Type:
multipart/mixed;boundary=\$mail_boundary\\r\n
   .\r\n
   .This is a multi-part in MIME format\r\n
   .\r\n;

// Body. The part that gets displayed as the message:
 $mailbody = --$mail_boundary\r\n
.Content-Type: text/plain;charset=\iso-88592\\r\n
.Content-Transfer-Encoding: 7bit\r\n
.\r\n
.$body
.\r\n;

// Now, do the attachments
  for ($i = 0; $i  count($attacharray); $i++)
 {
   $fp = fopen($attacharray[$i][filename], r);
   $file = fread($fp, filesize($attacharray[$i][filename]));
   $file = base64_encode($file);  // BASE64-encoded. Text. Nice.
   $file = chunk_split($file);// Now in handy bite-sized 76-char
chunks.
   $filename = basename($attacharray[$i][filename]);
$mailbody .= --$mail_boundary\r\n
  .Content-Type:
.$attacharray[$i][mimetype].;name=.\$filename\\r\n
  .Content-Transfer-Encoding: base64\r\n
  .Content-Disposition: attachment;
  .filename=.\$filename\\r\n
   .\r\n
   .$file
   .\r\n
   .\r\n;
 }

// End of mail
  $mailbody .= --$mail_boundary--;
  mail($to, $subject, $mailbody, $mailheaders);
 }

$fileattach[] =
array(filename=/home/timeking/product/bigpic/yellowcomb.jpg,
  mimetype=image/jpeg);

Mailattachments(([EMAIL PROTECTED]),(Subject),(BodyMessages),($fileattach)
,(X-mailer));
?


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




[PHP] Renaming of files after a special pattern possible?

2002-03-13 Thread Andy

Hi there,

I am wondering if this is possible in php:

I have a whole bunch of files named after countrycodes. E.g. CA-map.gif

Now I would like to rename those files after the country. This is listed in
a dbtable containing the countrycode and countryname. E.g. CA - Canada

How could I generate a php script which scannes the dir for matching
Countrycode patterns and renames the filename ?
E.g.: Make out of CA-map.gif - canada-map.gif?

Thanx for any hint,

andy





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




[PHP] Renaming files after a name in the db field

2002-03-13 Thread Andy

Hi there,

I am wondering if this is possible in php:

I have a whole bunch of files named after countrycodes. E.g. CA-map.gif

Now I would like to rename those files after the country. This is listed in
a dbtable containing the countrycode and countryname. E.g. CA - Canada

How could I generate a php script which scannes the dir for matching
Countrycode patterns and renames the filename ?
E.g.: Make out of CA-map.gif - canada-map.gif?

Thanx for any hint,

andy



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




[PHP] download 32000 images another server server

2002-03-13 Thread Vishak Tomy

Hello,

i tried to download 32000 images from another to my server, through the
code,


$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

if ((!$conn_id) || (!$login_result)) {
echo Ftp connection has failed!;
echo Attempted to connect to $ftp_server for user $user;
die;
} else {
echo Connected to $ftp_server, for user $user;
}
$arr = ftp_nlist ($conn_id, .);

for($i=0;$i=sizeof($arr); ++$i) {
$dir_first = substr($arr[$i],0,1);
$dir_second = substr($arr[$i],0,2);
$target_name = strtolower($arr[$i]);
   $upload = ftp_get($conn_id,
../images/photos/$dir_first/$dir_second/$target_name, $arr[$i],
FTP_BINARY);
 }
}
  }

if (!$upload) {
echo Ftp upload has failed!;
} else {
echo Uploaded source_file to $ftp_server as destination_file;
}

ftp_quit($conn_id);

the file names are from
4_0.jpg,4_1.jpg,41000_0.jpg...49000_0.jpg etc
5_0.jpg,5_1.jpg,51000_0.jpg...59000_0.jpg
all files starting 4_0.jpg will download to
../images/photos/4/40/4_0.jpg
all files starting 41000_0.jpg will download to
../images/photos/4/41/4_0.jpg
..
all files starting 5_0.jpg will download to
../images/photos/5/50/4_0.jpg
all files starting 51000_0.jpg will download to
../images/photos/5/51/4_0.jpg

is any better method than above
the problem is that all afiles aare not downloading, then showing the
message
cannot find server in IE. around 1 files downloaded.
any body please solve this

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




RE: [PHP] session OR variables

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]]
 Sent: 11 March 2002 21:23
 
 I have a question. I am working on a submit form that will
 ask you for confirmation of info. I.e. I need to move values
 submitted via form through 2 different pages. One of the ways
 to do it is via session_start(). Another way to do is it via
 storing variables in a QUERY_STRING and that's my favourite to
 be honest (page.php?a=432b=$this)
 
 The question is how reliable the session is? In other words
 I understand session works based on cookies right? So if the client
 browser has cookies disabled the session is not going to work 
 right?

Wrong.  The *session id* is stored using a cookie if cookies are enabled; otherwise it 
is passed from page to page as part of the URL.  In either case, all the session's 
data are actually stored on the *server*, and the session id is used as a key to them.

Cheers!

Mike

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

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




[PHP] input

2002-03-13 Thread John Gurley

hello,
Someone was kind enough to give me this code for sending a value from 
one page to another, but it doesn't work. I wonder if anyone can see 
anything wrong:

?php
echo '
input name=inp type=hidden value=', $_POST['inp'], '
';
?

I want to pass $inp to another pagee.

Thanks In advance
John

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] PHP and permissions

2002-03-13 Thread Don

I did.  That's why I'm confused.  phpinfo() is telling me that the user is
myself (I don't see the group).  So what is the permission difference
between running PHP and logging on to the server via telnet as myself?


 On Tue, 12 Mar 2002, Don wrote:

 use phpinfo() to find that out...

  Hi,
 
  I have a question about how PHP runs.  I have a file on my FreeBSD
server that is owned by another user but is the same group as myself.  The
file has read/write permissions for the user only.  Therefore, when I log
onto the server I cannot read or write to the file.  In fact, I can not even
FTP it.
 
  The funny thing is, I wrote a PHP script to read the file (it's actually
a CSV file) into an array using the function fgetcsv and display the values
within the browser.  This worked.
 
  So my question is, what user is PHP run under that allows me to access
another user's file (but the same group)?
 
  Thanks,
  Don
 

 --
 Jan Rademaker [EMAIL PROTECTED]
 http://www.ottobak.com





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




[PHP] how could i resize image in PHP

2002-03-13 Thread Vishak Tomy


hello,
how clud i resize images im php with the , is the script below rezize it
if it work where shuld i place this script?
can i give relate path for the jpg file?
is it need to place this script in a php file call this in the
img src=filename.php
please help

Header(Content-type: image/jpeg);

// $size and $string are passed from the URL

//$font = /home/joel/public_html/ARIALBD.TTF; // load the font
$im = imagecreatefromjpeg(../images/6/62/621345_0.jpg); // create the 
source image from jpeg file

if(ImageSX($im)  ImageSY($im)) // image is wider than it is tall
{
$width = $size;
$height = $width * (ImageSY($im) / ImageSX($im));
}
else // image is taller than it is wide, or both dimensions are the same
{
$height = $size;
$width = $height * (ImageSX($im) / ImageSY($im));
}

$im2=ImageCreate($width, $height); // create the destination image, with the 
correct dimensions

$white = ImageColorAllocate ($im2, 255, 255, 255); // allocate a white color
$black = ImageColorAllocate ($im2, 0, 0, 0); // allocate a black color

imagecopyresized($im2, $im, 0,0,0,0, $width, $height, ImageSX($im), 
ImageSY($im)); // do the resizing

//$text_size = ImageTTFBBox(12, 0, $font, $string);

//ImageTTFText ($im2, 12, 0, $width - 6 - $text_size[4], $height - 6 - 
$text_size[1], $white, $font,
$string);

Imagejpeg($im2,'', 75); // display the new, resized image

ImageDestroy($im);
ImageDestroy($im2);

regards
vishak

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




RE: [PHP] input

2002-03-13 Thread Rick Emery

?php
echo '
input name=inp type=hidden value='. $_POST['inp']. '
';
?

-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 6:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] input


hello,
Someone was kind enough to give me this code for sending a value from 
one page to another, but it doesn't work. I wonder if anyone can see 
anything wrong:

?php
echo '
input name=inp type=hidden value='. $_POST['inp'], '
';
?

I want to pass $inp to another pagee.

Thanks In advance
John

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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

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




Re: [PHP] input

2002-03-13 Thread Edward van Bilderbeek - Bean IT

 the single quotes you use for your echo indicate that the variable in your
echoed string won't be parsed double quotes indicate that it will be
parsed...

e.g.

$test = 1

echo '$test'   // prints: $test
echo $test  // prints: 1

Greets,

Edward


  hello,
  Someone was kind enough to give me this code for sending a value
from
  one page to another, but it doesn't work. I wonder if anyone can see
  anything wrong:
 
  ?php
  echo '
  input name=inp type=hidden value=', $_POST['inp'], '
  ';
  ?
 
  I want to pass $inp to another pagee.
 
  Thanks In advance
  John
 
  _
  Chat with friends online, try MSN Messenger: http://messenger.msn.com
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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




[PHP] Superuser for PHP Script

2002-03-13 Thread Johannes Tyra [BrainData]

Hi,

I need superuser rights for a PHP Script, called by the Apache Webserver.

Is it possible to do this with ? exec (su)?? ? What is with the root
password??
Is there an other better way to do this?

How can I print the current user/group under php is running?

Thanx,
--
Mit freundlichem Gruß,
Johannes Tyra


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




Re: [PHP] input

2002-03-13 Thread Jason Wong

On Wednesday 13 March 2002 20:54, John Gurley wrote:
 hello,
 Someone was kind enough to give me this code for sending a value from
 one page to another, but it doesn't work. I wonder if anyone can see
 anything wrong:

 ?php
 echo '
 input name=inp type=hidden value=', $_POST['inp'], '
 ';
 ?

 I want to pass $inp to another pagee.

Please, we're not mind-readers, *how* doesn't it work? Errors? Nothing?

Also what version of PHP are you using?


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
When in doubt, have a man come through the door with a gun in his hand.
-- Raymond Chandler
*/

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




RE: [PHP] input

2002-03-13 Thread Rick Emery

Nope, that's not the problem.  the $_POST[] is NOT inside single-quotes.
The problem is he used commas before and after the $_POST[].


-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 7:02 AM
To: PHP-General
Subject: Re: [PHP] input


 the single quotes you use for your echo indicate that the variable in your
echoed string won't be parsed double quotes indicate that it will be
parsed...

e.g.

$test = 1

echo '$test'   // prints: $test
echo $test  // prints: 1

Greets,

Edward


  hello,
  Someone was kind enough to give me this code for sending a value
from
  one page to another, but it doesn't work. I wonder if anyone can see
  anything wrong:
 
  ?php
  echo '
  input name=inp type=hidden value=', $_POST['inp'], '
  ';
  ?
 
  I want to pass $inp to another pagee.
 
  Thanks In advance
  John
 
  _
  Chat with friends online, try MSN Messenger: http://messenger.msn.com
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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

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




Re: [PHP] input

2002-03-13 Thread Jason Wong

On Wednesday 13 March 2002 21:02, Edward van Bilderbeek - Bean IT wrote:
  the single quotes you use for your echo indicate that the variable in your
 echoed string won't be parsed double quotes indicate that it will be
 parsed...

 e.g.

 $test = 1

 echo '$test'   // prints: $test
 echo $test  // prints: 1

But the way it's being used is:

 echo 'xxx', $XXX, 'xxx';

ie the variable is not inside the single-quotes.


 Greets,

 Edward

   hello,
   Someone was kind enough to give me this code for sending a value

 from

   one page to another, but it doesn't work. I wonder if anyone can see
   anything wrong:
  
   ?php
   echo '
   input name=inp type=hidden value=', $_POST['inp'], '
   ';
   ?



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
The Pig, if I am not mistaken,
Gives us ham and pork and Bacon.
Let others think his heart is big,
I think it stupid of the Pig.
-- Ogden Nash
*/

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




Re: [PHP] Pattern matching in PHP

2002-03-13 Thread RIVES Sergio

i guess you are searching for this function :
number_format($number);
http://www.php.net/manual/en/function.number-format.php

Hope it could help you

SR

Claudiu a écrit :

Claudiu a écrit :

 Hello!

 I have a number... say 12234109 i want to transform it to 12,234,109
 or 10312 transformed to 10,312 ... i guess you got my point..

 Is there a way doing this... I believe pattern matching...but i dont know
 how to do it...
 Or any other solution?
 Thanks...

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


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




[PHP] Adding --with-openssl Not Working

2002-03-13 Thread Ezra Freelove

Solaris 8
PHP 4.1.2 (and 4.1.1)

In researching a problem with a script I discovered that I needed to
recompile PHP with OpenSSL support. So I successfully compiled PHP using
--with-openssl without errors. I did have an issue with libcrypto not
being found, but that was resolved by giving configure the location of
openssl by --with-openssl=/usr/local/ssl/. 

The phpinfo script does not report that OpenSSL was installed. The make
install screen output did have Making install in openssl. The contents
of ext/openssl inside the source directory of php did have libraries
created. The script calling for openssl_get_publickey() still seems to
think that the function is undefined.

Ezra S Freelove
Computer Supp Spec, Web Services
Information Technology
Valdosta State University
http://www.valdosta.edu/~esfreelo/
[EMAIL PROTECTED]



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




Re: [PHP] input

2002-03-13 Thread Jason Wong

On Wednesday 13 March 2002 21:07, Rick Emery wrote:
 Nope, that's not the problem.  the $_POST[] is NOT inside single-quotes.
 The problem is he used commas before and after the $_POST[].


You can use commas to separate expressions when using echo. So that's not the 
problem. AFAICS the code *is* valid.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
It is easier to resist at the beginning than at the end.
-- Leonardo da Vinci
*/

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




[PHP] Re: setcookie problem: Cannot add header information - headers already sent by

2002-03-13 Thread Frank Ramsay

Cookies have to be set before the HTML block begins.

-fjr

Bob wrote:

 here is the example:
 
 ?php
 // Beginning php
 
 // Saving the page header in the variable $head.
 $head = ENDH
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN
 html
   head
 titleFeedback form/title
   /head
 
   body bgcolor=white
 h1 align=centerFeedback form/h1
 ENDH;
 // End of page header
 
 // Saving the page footer in the variable $tail.
 $tail = ENDT
 hr
   /body
 /html
 ENDT;
 // End of page footer
 
 // Set up variables that will be saved in the cookies
 // Define unique cookie prefix
 $ID = My_ID;
 // Cookie lifetime in seconds (in this example, three days)
 $cookie_life = 60;
 // Name of cookie that holds the user's name
 $n_name = $ID . _Name;
 // Name of cookie that holds the user's email
 $n_email = $ID . _Email;
 // Name of cookie that holds the user's last login
 $n_last = $ID . _Last;
 
 // These lines print the form with user input and mails to the
 webmaster.
 if( isset($sfeedback)) {
 Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
 print $head;
 ?
 Thanks for your feedback, ?php echo $name ?. Here is what you
 said:br
 Name: ?php echo $name ?br
 Email: ?php echo $email ?br
 Feedback: ?php echo $feedback ?br
 ?php
 // Mails the feedback to the webmaster.
 $subject = Feedback from your site;
 $sendto = [EMAIL PROTECTED];
 $header = From: $email;
 mail($sendto, $subject, $feedback, $header);
 print Thank you.  Your comments have been sent to the
 webmaster\n;
 // Print end and leave
 print $tail;
 exit();
 }
 
 // This loop treats users who have not been to the site before.
 if(!$$n_last) {
 if( ! isset($name)) { // if no name - display the form
 echo $head;
 ?
 Welcome to our system! Please fill in the following information:
 !-- $PHP_SELF is the PHP way of referring to the current page --
 form action=?php echo $PHP_SELF ? method=POST
 Name: input type=text name=namebr
 Email: input type=text name=emailbr
 !-- Submit button --
 input type=submit value=Submit/form
 ?php
 echo $tail;
 exit;
 } else {
 // Set cookies and continue
 Setcookie($n_name,$name,time()+$cookie_life);
 Setcookie($n_email,$email,time()+$cookie_life);
 $$n_name = $name;
 $$n_email = $email;
 }
 }
 
 // This loop treats repeat users.
 Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
 echo $head;
 ?
 Welcome back to our system, ?php echo $$n_name ?.
 ?php
 // Have previous login
 if($$n_last)
 echo Your last login was on  . $$n_last . .;
 
 // User fills in feedback form
 ?
 form action=?php echo $PHP_SELF ? method=POST
 Name: input type=text name=name value=?php echo $$n_name
 ?br
 Email: input type=text name=email value=?php echo $$n_email
 ?br
 Feedback:br
 textarea name=feedback wrap=virtual cols=40 rows=5
 /textarea
 br
 !-- Submit button --
 input type=submit value=Submit name=sfeedback
 /form
 ?php echo $tail ?
 
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 75
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 76
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 83
 
 what' wrong?
 thanks!


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




[PHP] apache htpasswd win32

2002-03-13 Thread DrouetL


Hi everybody

I would like to know if somebody already wrote a script to allow apache
user administration from php under Win32

All the scripts I found are made for linux (using crypt function) I tried
to generate the password with the md5 function but it's not working
perhaps I don't know how to use it.

Could you help me ?

Laurent Drouet



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




Re: [PHP] PHP and permissions

2002-03-13 Thread Jason Wong

On Wednesday 13 March 2002 08:55, Don wrote:

 I did.  That's why I'm confused.  phpinfo() is telling me that the user is
 myself (I don't see the group).  So what is the permission difference
 between running PHP and logging on to the server via telnet as myself?

  On Tue, 12 Mar 2002, Don wrote:
 
  use phpinfo() to find that out...
 
   Hi,
  
   I have a question about how PHP runs.  I have a file on my FreeBSD

 server that is owned by another user but is the same group as myself.  The
 file has read/write permissions for the user only.  Therefore, when I log
 onto the server I cannot read or write to the file.  In fact, I can not
 even FTP it.

   The funny thing is, I wrote a PHP script to read the file (it's
   actually

 a CSV file) into an array using the function fgetcsv and display the values
 within the browser.  This worked.

   So my question is, what user is PHP run under that allows me to access

 another user's file (but the same group)?


If it's true that the file in question is only rw by the user ie 0600 or 

-rw---1 user user

then it cannot be read by you OR the webserver -- unless the webserver is 
running as root (unlikely). So the question is, are you 100% positively sure 
that the permissions are as you said only read/write  for the user?


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Lord, defend me from my friends; I can account for my enemies.
-- Charles D'Hericault
*/

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




RE: [PHP] Re: setcookie problem: Cannot add header information - headers already sent by

2002-03-13 Thread Rick Emery

He IS setting cookie before sending HTML block.  Note, that he is storing
the beginning of HTL block in a HEREDOC, which he prints after setting
cookie.

Somewhere, he may be printing a blank line prior to setting cookie...that
problem has bitten me more than once, so now I'm on the look-out for it in
my code.

Bob: after the page bombs-out with error message, do a view source on the
displayed web-page

-Original Message-
From: Frank Ramsay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 7:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: setcookie problem: Cannot add header information -
headers already sent by


Cookies have to be set before the HTML block begins.

-fjr

Bob wrote:

 here is the example:
 
 ?php
 // Beginning php
 
 // Saving the page header in the variable $head.
 $head = ENDH
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN
 html
   head
 titleFeedback form/title
   /head
 
   body bgcolor=white
 h1 align=centerFeedback form/h1
 ENDH;
 // End of page header
 
 // Saving the page footer in the variable $tail.
 $tail = ENDT
 hr
   /body
 /html
 ENDT;
 // End of page footer
 
 // Set up variables that will be saved in the cookies
 // Define unique cookie prefix
 $ID = My_ID;
 // Cookie lifetime in seconds (in this example, three days)
 $cookie_life = 60;
 // Name of cookie that holds the user's name
 $n_name = $ID . _Name;
 // Name of cookie that holds the user's email
 $n_email = $ID . _Email;
 // Name of cookie that holds the user's last login
 $n_last = $ID . _Last;
 
 // These lines print the form with user input and mails to the
 webmaster.
 if( isset($sfeedback)) {
 Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
 print $head;
 ?
 Thanks for your feedback, ?php echo $name ?. Here is what you
 said:br
 Name: ?php echo $name ?br
 Email: ?php echo $email ?br
 Feedback: ?php echo $feedback ?br
 ?php
 // Mails the feedback to the webmaster.
 $subject = Feedback from your site;
 $sendto = [EMAIL PROTECTED];
 $header = From: $email;
 mail($sendto, $subject, $feedback, $header);
 print Thank you.  Your comments have been sent to the
 webmaster\n;
 // Print end and leave
 print $tail;
 exit();
 }
 
 // This loop treats users who have not been to the site before.
 if(!$$n_last) {
 if( ! isset($name)) { // if no name - display the form
 echo $head;
 ?
 Welcome to our system! Please fill in the following information:
 !-- $PHP_SELF is the PHP way of referring to the current page --
 form action=?php echo $PHP_SELF ? method=POST
 Name: input type=text name=namebr
 Email: input type=text name=emailbr
 !-- Submit button --
 input type=submit value=Submit/form
 ?php
 echo $tail;
 exit;
 } else {
 // Set cookies and continue
 Setcookie($n_name,$name,time()+$cookie_life);
 Setcookie($n_email,$email,time()+$cookie_life);
 $$n_name = $name;
 $$n_email = $email;
 }
 }
 
 // This loop treats repeat users.
 Setcookie($n_last,Date(H:i d/m/Y),time()+$cookie_life);
 echo $head;
 ?
 Welcome back to our system, ?php echo $$n_name ?.
 ?php
 // Have previous login
 if($$n_last)
 echo Your last login was on  . $$n_last . .;
 
 // User fills in feedback form
 ?
 form action=?php echo $PHP_SELF ? method=POST
 Name: input type=text name=name value=?php echo $$n_name
 ?br
 Email: input type=text name=email value=?php echo $$n_email
 ?br
 Feedback:br
 textarea name=feedback wrap=virtual cols=40 rows=5
 /textarea
 br
 !-- Submit button --
 input type=submit value=Submit name=sfeedback
 /form
 ?php echo $tail ?
 
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 75
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 76
 
 Warning: Cannot add header information - headers already sent by
 (output started at C:\WebShare\wwwroot\last\cookie.php:59) in
 C:\WebShare\wwwroot\last\cookie.php on line 83
 
 what' wrong?
 thanks!


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

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




[PHP] Re: download 32000 images another server server

2002-03-13 Thread Julio Nobrega Trabalhando

  You could try to compress the images using php or telnet, or do it in
batchs from 5000 files.

--

Julio Nobrega.

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



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




Re: [PHP] PHP and permissions

2002-03-13 Thread Jan Rademaker

On Tue, 12 Mar 2002, Don wrote:

 I did.  That's why I'm confused.  phpinfo() is telling me that the user is
 myself (I don't see the group).  So what is the permission difference
 between running PHP and logging on to the server via telnet as myself?

you should be able to find the group id in the same place as the
userid (after the /), eg.:

user(1234)/group(4323)
or
user(1234)/4323

Maybe this helps you out a little further...

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



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




Re: [PHP] PHP and permissions

2002-03-13 Thread Jan Rademaker

On Wed, 13 Mar 2002, Jan Rademaker wrote:

 On Tue, 12 Mar 2002, Don wrote:
 
  I did.  That's why I'm confused.  phpinfo() is telling me that the user is
  myself (I don't see the group).  So what is the permission difference
  between running PHP and logging on to the server via telnet as myself?
 
 you should be able to find the group id in the same place as the
 userid (after the /), eg.:
 
 user(1234)/group(4323)
 or
 user(1234)/4323
 
 Maybe this helps you out a little further...

i forgot to mention that you can find user/group ids in the apache section
of phpinfo();

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



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




[PHP] passing values

2002-03-13 Thread John Gurley

this is still not working for passing a value from one page to another:

?php
echo '
input name=inp type=hidden value='. $_POST['inp']. '
';
?

When I look at the source this appears:
input name = inp type = hidden value = 

which I take to mean that it does not know what $inp is. could it be 
something with my browser, or am I still doing something wrong (I wouldn't 
be a bit surprised)

Thanks
John

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] Superuser for PHP Script

2002-03-13 Thread Dimitris Kossikidis

If you want to use sudo you can do it with the fowling function:

function loginsu(){
$fhandle = @popen($sudo_path -u root clear, w);
$fputs( $fhanlde, $supassword);
@pclose($fhandle);
}

Dont forget to edit /etc/sudoers adding  the folowing line
apache ALL=PASSWD:ALL

Do it at your own risk

- Original Message -
From: Johannes Tyra [BrainData] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 3:06 PM
Subject: [PHP] Superuser for PHP Script


 Hi,

 I need superuser rights for a PHP Script, called by the Apache Webserver.

 Is it possible to do this with ? exec (su)?? ? What is with the root
 password??
 Is there an other better way to do this?

 How can I print the current user/group under php is running?

 Thanx,
 --
 Mit freundlichem Gruß,
 Johannes Tyra


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



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




RE: [PHP] passing values

2002-03-13 Thread Hunter, Ray

Are you using the post form method to post this variable to the next page.
The value $_POST['inp'] is not present or set...there is a null value there.
You will need to set the value with a post inorder to access it with the
predefined variable $_POST...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 13, 2002 6:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] passing values


this is still not working for passing a value from one page to another:

?php
echo '
input name=inp type=hidden value='. $_POST['inp']. '
';
?

When I look at the source this appears:
input name = inp type = hidden value = 

which I take to mean that it does not know what $inp is. could it be 
something with my browser, or am I still doing something wrong (I wouldn't 
be a bit surprised)

Thanks
John

_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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



[PHP] Newbie Question

2002-03-13 Thread Greg

I have an app that worked with mySQL, but now I'm trying to make it use
SQL Server. The function that connected to to the mySQL was:
 
mysql_pconnect($db_host, $db_user, $db_pass) or die(Unable to connect
to SQL server);
 
I tried to change it to sql_pconnect($db_host, $db_user, $db_pass) or
die(Unable to connect to SQL server); but I get an error that the
function doesn't exist. I'm sure it's something simple, but what's the
php function that will let me connect to the SQL Server?



RE: [PHP] Newbie Question

2002-03-13 Thread Hunter, Ray

What type of OS are you running this application on and how was php
compiled?



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Greg [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 13, 2002 6:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie Question


I have an app that worked with mySQL, but now I'm trying to make it use SQL
Server. The function that connected to to the mySQL was:
 
mysql_pconnect($db_host, $db_user, $db_pass) or die(Unable to connect to
SQL server);
 
I tried to change it to sql_pconnect($db_host, $db_user, $db_pass) or
die(Unable to connect to SQL server); but I get an error that the
function doesn't exist. I'm sure it's something simple, but what's the php
function that will let me connect to the SQL Server?



Re: [PHP] parse error? how can I print spesific message for all error mesage

2002-03-13 Thread Ceyhun Güler

Thanks Jan!!! It Works



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




RE: [PHP] Newbie Question

2002-03-13 Thread Jon Haworth

 I'm sure it's something simple, but what's the
 php function that will let me connect to the 
 SQL Server?

mssql_*, instead of mysql_*

See them all at http://www.php.net/manual/en/ref.mssql.php

HTH
Jon

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




[PHP] Re: apache htpasswd win32

2002-03-13 Thread Nico Vrouwe

You could do it like this:
exec( htpasswd -b $passwdfile $username $password );

/nico

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi everybody

 I would like to know if somebody already wrote a script to allow apache
 user administration from php under Win32

 All the scripts I found are made for linux (using crypt function) I tried
 to generate the password with the md5 function but it's not working
 perhaps I don't know how to use it.

 Could you help me ?

 Laurent Drouet





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




[PHP] RE: passing values

2002-03-13 Thread John Gurley

Ray,
I am using the post method, and the $_POST is inside FORM/FORM,
but the value is still not passed. Although I'm not sure what you mean by 
You will need to set the value with a post inorder to access it with the 
predefined variable $_POST Could you explain this please.
Thanks again
John


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




RE: [PHP] RE: passing values

2002-03-13 Thread Rick Emery

John,

Post your code.  We're all operating in the dark here and we want to help
you.

-Original Message-
From: John Gurley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: passing values


Ray,
I am using the post method, and the $_POST is inside FORM/FORM,
but the value is still not passed. Although I'm not sure what you mean by 
You will need to set the value with a post inorder to access it with the 
predefined variable $_POST Could you explain this please.
Thanks again
John


_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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

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




[PHP] re: passing inputs

2002-03-13 Thread John Gurley

Sorry,
 Didn't mean to keep everyone in the dark here is the code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
!-- saved from url=(0031)http://godel/jgurley/form1.html --
HTMLHEADTITLEUntitled Document/TITLE
META content=text/html; charset=iso-8859-1 http-equiv=Content-Type
META content=MSHTML 5.00.2314.1000 name=GENERATOR/HEAD
BODY background= backgrnd.gif text=ff8c00 link = ff vlink = 00
FORM action=newtune.php method=post name=form1 form
  div align=center
h1WEB BASED MUSIC COMPOSITION/h1
hr

?
echo $inp;
?

img src =notes.gif
h3nbsp;/h3
a href =help.htmimg src =help1.gif
/a
h3Tune Type/h3
SELECT
name=tune
  OPTION selected value=1Jig/OPTION
  OPTION
value=2Reel/OPTION
/SELECT
  /div
  P align=centernbsp;/P
  div align=center
h3Playback Tempo/h3
SELECT name=tempo
  OPTION selected
  value=1Slow/OPTION
  OPTION value=2Medium/OPTION
  OPTION
  value=3fast/OPTION
/SELECT
  /div
  P align=centernbsp;
  P align=center
  h3 align=center Form/h3
  center
select name=form
  option selected value=1A B A B C D C B/option
  option value=2A B A C D E D C/option
/select
  /center
  h3 P align=center Please enter tonerow, selecting from the following 
pitch
es:/h3
  h3 P align=centerDEFGABCcdefgab/h3
  P align=center
INPUT name=tonerow
  /P




P align=center
INPUT name=Submit type=submit value=Submit
  /P
  P align=centernbsp;/P
  P align=centernbsp;/P

?php
echo $inp;
echo 'input name = inp type = hidden value = '.$_POST['$inp'].'';
?


/FORM

/BODY
/HTML



Thanks so much for the help.
John


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] register_globals and E_ALL error reporting

2002-03-13 Thread Richard Ellerbrock

The following code generates a warning when register_globals=off and
error reporting is set to E_ALL. How do I define the constant in another
way not to generate a warning? This is with php 4.1.1. I use defines
extensively throughout my code and it is making my debugging difficult
through the transition to register_global=off code.

?php

define(DBF_HOST, localhost);

echo DBF_HOST;

?

Warning: Use of undefined constant DBF_HOST - assumed 'DBF_HOST' in
var/www/html/iptrackdev/test.php on line 3 localhost

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




RE: [PHP] Persistent Links help needed

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 00:51
 
 Hi All,
 I have multiple PHP pages and make my connection to the MySQl 
 db in one of
 these pages.  When I go to the next one any mysql  commands 
 seem not to work
 - it look like the connection to the DB is lost!  I have a 
 feeling this is
 to do with persistent connections so here is the relevant parts of the
 phpinfo() output.
 My question is - what do I have to set and how do I do it so 
 the connection
 remains

You can't -- it doesn't work like that.

 or do I have to reconnect in every php file?? 

Yes -- there is no way to have a connection that persists between scripts.

A persistent connection is only persistent as far as your Web server's connection to 
MySQL is concerned -- the advantage is that the Web server doesn't have to remake the 
connection each time a script demands it.  A non-persistent connection, however, is 
completely dropped when you close it (either explicitly or by default when your script 
terminates), so that subsequent scripts requiring an identical connection have to bear 
the cost of starting up a whole new connection to MySQL.  As far as your script is 
concerned, you can do nothing with persistent connections over and above what you can 
do with non-persistent ones -- the difference is purely in how (often) the server 
makes and breaks the connections.

Cheers!

Mike

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

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




Re: [PHP] newbie: using sessions

2002-03-13 Thread Martín Marqués

On Wed, 13 Mar 2002, Faisal Abdullah wrote:

 Don't you have to assign the login value to the session variable first?

 session_start();
 $login = $HTTP_POST_VARS(login);
 session_register(login);

It's the same.

Saludos... :-)

Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-


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




[PHP] Re: register_globals and E_ALL error reporting

2002-03-13 Thread Peter Clarke


Richard Ellerbrock [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The following code generates a warning when register_globals=off and
 error reporting is set to E_ALL. How do I define the constant in another
 way not to generate a warning? This is with php 4.1.1. I use defines
 extensively throughout my code and it is making my debugging difficult
 through the transition to register_global=off code.

 ?php

 define(DBF_HOST, localhost);

 echo DBF_HOST;

 ?

 Warning: Use of undefined constant DBF_HOST - assumed 'DBF_HOST' in
 var/www/html/iptrackdev/test.php on line 3 localhost

if (defined(DBF_HOST)) {
echo DBF_HOST;
} else {
echo DBF_HOST not defined;
}


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




RE: [PHP] include() .htaccess

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Patrick Teague [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 10:48
 
 
 I'm having problems with .htaccess files setting up the php_value
 include_dir on both my development  test servers.  I'm using 
 php4 under
 apache on win2k for development  php4 under apache on unix as a test
 server.  I've currently done the following on the win server
 
 Directory
 php_value include_dir .;C:/home/plugged/common/
 /Directory
 
  done the following on the unix server
 
 Directory
 php_value include_dir .:/home/plugged/common/
 /Directory
 
 neither works...  am I doing something wrong here or am I forgetting
 something?

Uh, well, including the name of the Directory you want it to apply to might be nice: 
just because the .htaccess file is in a particular directory doesn't mean that's used 
as the default -- you still have to specify it in full in the Directory  tag.

Cheers!

Mike

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

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




[PHP] re: passing values

2002-03-13 Thread John Gurley

Thanks everyone for the help. Finally got it working using this:

?php

echo 'input name = inp type = hidden value =';
echo ($_POST '$inp');
echo '';

?

Don't hhave a clue why this worked and the others didn't?!?!?
thanks
John

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] re: passing inputs

2002-03-13 Thread Erik Price

John,

It seems that you're using two different conventions here.  This is 
inconsistent, and confusing to me (at least, and possibly others trying 
to help you).  Let me show you what I am talking about:


On Wednesday, March 13, 2002, at 09:20  AM, John Gurley wrote:

 Sorry,
 Didn't mean to keep everyone in the dark here is the code:

... snip ...

 hr

 ?
 echo $inp;
 ?

Okay, see above?  You've used $inp.  Now read on to another part of 
your code:

 ?php
 echo $inp;
 echo 'input name = inp type = hidden value = 
 '.$_POST['$inp'].'';
 ?

Okay, now here, you're echoing $inp again, but then in the second echo 
statement you are echoing $_POST['$inp']

Please don't be insulted if I make an assumption about what you know 
about the use of variables within scripts, I'm going to do my best to 
explain this and I can't know how much you know or don't.  Here's how it 
works:

On a script, you have access to any variable that you create within that 
script.  Thus, if you create a variable named $inp, you can then echo 
that variable or manipulate it in any way.  Like this:

$inp = blue;   // this assigns the string blue to the $inp variable
echo $inp;   // this echoes blue
$outp = green;  // this assigns green (a string) to the $outp 
variable
$outp . $inp;   // this combines (concatenates) the two variables 
together
 // and results in the string greenblue

Okay, you probably already know all of that.  But my point is that these 
variables are accessible to this particular script.  NOT TO OTHER 
SCRIPTS.  If you need a variable to be accessible to another script, you 
must pass the variable along.  There are a few ways to do this:

1) You can make the value of this variable a form field value, like this:
echo input type=\hidden\ name=\inp\ value=\$inp\ /;
(or this way, with single quotes:)
echo 'input type=hidden name=inp value=' . $inp . ' /';
note that in the above example, I have jumped out of the string being 
echoed and concatenated the $inp variable to the string, then 
concatenated the last part of the string (' /').  This is because 
within single-quotes, variables won't expand -- the buck ($) is treated 
as a literal buck, not a variable marker.

2) You can put the variable name and value into the querystring of a 
hyperlink, like this:
echo a href=\./form2?inp=$inp\Next/a;
(or this way, with single quotes:)
echo 'a href=./form2?inp=' . $inp . 'Next/a';
see how I've again jumped out of the singlequoted string and 
concatenated the variable?  Same reason -- variables don't expand within 
singlequoted strings (though they do within doublequoted strings).

3) You can put the variable's value into a session variable.  How you do 
this depends on which version of PHP you are using.  You can learn more 
about session variables later, it's easy but you should get the hidden 
form field technique or querystring technique down first.

These are ways you can pass variables to other scripts.  Ignore the 
session bit if you haven't yet learned sessions.

So in your example, you are echoing the value of $inp.  But I don't see 
where you've done the ASSIGNMENT of any value to $inp.  For this reason, 
you will simply get an empty string:

echo $inp;   // this results in nothing
echo input type=\hidden\ name=\inp\ value=\$inp\ /;
   // this results in 'input type=hidden name=inp value= /'

If you had passed the $inp variable from a previous script to this one, 
then you would use either $_GET['inp'] or $_POST['inp'] to access the 
variable, assuming you have register_globals turned off in your php.ini 
(if you don't then don't worry about this).

echo $_POST['inp']; // if the form from the previous script was 
'method=post'
echo $_GET['inp'];  // if the form from the previous script was 
'method=get'

But if you do this:

echo $_POST['$inp'];

Then nothing will happen because the $inp part is between single quotes, 
and single quotes don't expand variables -- the buck is treated as part 
of the variable name (when it's not, it's supposed to be an indicator).

Even this:

echo $_POST[$inp];

probably won't do what you want, because what will happen is the 
variable $inp (inside of the brackets) will evaluate first, and then 
whatever that evaluates to will become the name within $_POST['   
and'].  Unless you have defined $inp somewhere, that's just a 
mistake.  Don't use the $ symbol within $_POST or $_GET variables until 
you have a reason to do so.

So, in your script, you've called the inp variable both $inp and 
$_POST['$inp'].  You probably really only want to use one or the 
other -- use the first one if register_globals is turned on, and the 
second one if register_globals is turned off.  But remember, this trick 
is used only for accessing variables that have been passed to this 
script from another script, not for accessing variables that have been 
defined within this script.


This may have been overly explanatory and confusing, but if you have a 
question about it, ask us.


[PHP] sessions concurrency

2002-03-13 Thread Shane Wright

Hi

If I set up a session while generating a page, and I store some data in it, 
when does that data become available for other connections from the same user 
(same session)?

I.e. If I have a complex page with some session data that is used to 
dynamically generate some of the images in the page, it is conceivably 
possible that the browser could receive the HTML and IMG tags for the images 
before the page itself finishes building.

I'm thinking that the session data probably isnt written until the PHP script 
exits, and that there probably isnt any locking.  Is this the case?

I imagine that if this is true I could write my own session save/load 
handlers to install with session_set_save_handler() and handle 
locking/concurrency issues - if so would these work if written in C as a php 
extension?

Any info appreciated,

Thanks

--
Shane

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




[PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Richard Davey

Hi all,

I have a global array $mtxt that is created in my script.
I have a function from which I want to access a value from that array:

$mtxt[1] = Test;
$text = $GLOBALS['mtxt[1]'];

Except that gives me the Warning Undefined index;

I can use $GLOBALS['mtxt'] to access a global variable without an error,
just not a specific element of a global array.
Does anyone know the correct syntax for this?

I have tried:

$text = $GLOBALS[mtxt[1]];
$text = $GLOBALS[{mtxt[1]}];

But both fail too.

Cheers,

Richard
--
Fatal Design
http://www.fatal-design.com
Atari / DarkBASIC / Coding / Since 1995



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




RE: [PHP] Array

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Roman Duriancik [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 08:40
 
 I have one small problem. I have array e.g $array but I don't know
 how to finding arguments and values of this array.
 
 e.g
 
 $array[aa] = 1;
 $array[ab] = some;
 ...
 
 and script send me :
 
 arguments aa : values 1
 arguments bb : values some

foreach ($array as $arg=$val):
   echo arguments $arg : values $valbr\n;
endforeach;

Cheers!

Mike

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

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




RE: [PHP] registering $_REQUEST variables as session variables.

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Gonzalez, Zara E [mailto:[EMAIL PROTECTED]]
 Sent: 11 March 2002 17:54
 
 I was just wondering if anyone knew an easy way to register 
 all $_REQUEST
 variables as session variables.

I haven't seen this solution on the list, but what about:

foreach ($_REQUEST as $key=$val):
   $_SESSION[$key] = $val;
endforeach;  

Cheers!

Mike

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

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




Re: [PHP] re: passing values

2002-03-13 Thread Jason Wong

On Wednesday 13 March 2002 23:37, John Gurley wrote:
 Thanks everyone for the help. Finally got it working using this:

 ?php

 echo 'input name = inp type = hidden value =';
 echo ($_POST '$inp');
 echo '';

 ?

 Don't hhave a clue why this worked and the others didn't?!?!?


This isn't working correctly. The fact that it 'works' is just a fluke.

I asked many posts earlier what version of PHP you was using, I don't seem to 
have gotten an answer. But your subsequent posts seems to suggest that you're 
using php  4.1.1 and hence why $_POST['inp'] does not work.


php = 4.0.6 used $HTTP_POST_VARS[] to hold the values which are the result 
of a POST.

With php = 4.1.1 $HTTP_POST_VARS[] has become $_POST[].


So if my assumption is correct in that you're using php  4.1.1 then

 echo ($_POST '$inp');

is in fact equivalent to:

 echo ( '$inp');  ## because $_POST is most likely undefined

That is why it seems to work, but you're getting an extra space and single 
quotes around your value.


To really get it working, you should probably use:

 echo ($HTTP_POST_VARS[inp]);

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
To the landlord belongs the doorknobs.
*/

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




[PHP] Opening new browser window.

2002-03-13 Thread Way, Paul

Is there anyway that I can open a new browser window in php, like you are
able to do in JavaScript (window.open()). I have had a look around and can't
find any information on how this can be done.


Many thanks.

PW..

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




RE: [PHP] Opening new browser window.

2002-03-13 Thread Caspar Kennerdale

embed the javascript within the php using echo or print

-Original Message-
From: Way, Paul [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 16:26
To: '[EMAIL PROTECTED]'
Subject: [PHP] Opening new browser window.


Is there anyway that I can open a new browser window in php, like you are
able to do in JavaScript (window.open()). I have had a look around and can't
find any information on how this can be done.


Many thanks.

PW..

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


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




RE: [PHP] register_globals and E_ALL error reporting

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Richard Ellerbrock [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 14:25
 
 The following code generates a warning when register_globals=off and
 error reporting is set to E_ALL. How do I define the constant 
 in another
 way not to generate a warning? This is with php 4.1.1. I use defines
 extensively throughout my code and it is making my debugging difficult
 through the transition to register_global=off code.
 
 ?php
 
 define(DBF_HOST, localhost);
 
 echo DBF_HOST;
 
 ?
 
 Warning: Use of undefined constant DBF_HOST - assumed 'DBF_HOST' in
 var/www/html/iptrackdev/test.php on line 3 localhost

That has nothing to do with register_globals!  You're getting the error because you 
have error_reporting set to E_ALL.  The error is that both arguments to define should 
be strings, thus:

define('DBF_HOST', 'localhost');

The way you have it, the naked DBF_HOST looks like a reference to a constant, but when 
PHP looks it up it can't find it because it hasn't been defined yet because the define 
contains a reference to the constant DBF_HOST which hasn't been defined yet so when 
PHP looks it up it can't find it because... oh, well, you get the idea!

Cheers!

Mike

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

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




RE: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Richard Davey [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 16:02
 
 I have a global array $mtxt that is created in my script.
 I have a function from which I want to access a value from that array:
 
 $mtxt[1] = Test;
 $text = $GLOBALS['mtxt[1]'];
 
 Except that gives me the Warning Undefined index;
 
 I can use $GLOBALS['mtxt'] to access a global variable 
 without an error,
 just not a specific element of a global array.
 Does anyone know the correct syntax for this?

$GLOBALS['mtxt'][1]

Cheers!

Mike

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

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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Richard Davey

Mike Ford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 $GLOBALS['mtxt'][1]

Fantastic :)

That's totally illogical but it works a treat.
PHP has some weird syntax rules sometimes!

Cheers,

Rich
--
Fatal Design
http://www.fatal-design.com
Atari / DarkBASIC / Coding / Since 1995



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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Rasmus Lerdorf

I don't understand why you think it is illogical.  How else would you
dereference a multi-dimensional array?

On Wed, 13 Mar 2002, Richard Davey wrote:

 Mike Ford [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  $GLOBALS['mtxt'][1]

 Fantastic :)

 That's totally illogical but it works a treat.
 PHP has some weird syntax rules sometimes!

 Cheers,

 Rich
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995



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



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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

IMO it is not weird. Think about $GLOBALS['mtxt'] as a pointer to array(it is not but 
this is a good example).
$GLOBALS is a hash list. So it has sub elements - zvals (internal _zend_value ). Every 
from these zvals can hold zvals. In C the
syntax is arFooBar[1][2], not arFooBar[[1][2]]

I am not nagging(not sure for the word) at you.


Best regards,
Andrey Hristov
- Original Message -
From: Richard Davey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 6:52 PM
Subject: Re: [PHP] How to access arrays from $GLOBAL?


 Mike Ford [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  $GLOBALS['mtxt'][1]

 Fantastic :)

 That's totally illogical but it works a treat.
 PHP has some weird syntax rules sometimes!

 Cheers,

 Rich
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995



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




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




RE: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Hunter, Ray

Where is some good documentation on how $GLOBALS works and what is really
going on in the background?


Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 13, 2002 9:53 AM
To: Richard Davey
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to access arrays from $GLOBAL?


I don't understand why you think it is illogical.  How else would you
dereference a multi-dimensional array?

On Wed, 13 Mar 2002, Richard Davey wrote:

 Mike Ford [EMAIL PROTECTED] wrote in message 
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
 ..
  $GLOBALS['mtxt'][1]

 Fantastic :)

 That's totally illogical but it works a treat.
 PHP has some weird syntax rules sometimes!

 Cheers,

 Rich
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995



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



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



Re: [PHP] Renaming files after a name in the db field

2002-03-13 Thread Analysis Solutions

On Wed, Mar 13, 2002 at 01:45:21PM +0100, Andy wrote:
 
 How could I generate a php script which scannes the dir for matching
 Countrycode patterns and renames the filename ?
 E.g.: Make out of CA-map.gif - canada-map.gif?

First, make an array of countries codes and names (see below for one I 
created for you).  Second, loop through each file in the directory.  
Third, do a preg_replace() which grabs the existing country code out of 
the name and replaces it with the value of the corresponding array.  
Fourth, rename the file with the new name.

Untested example of the Third step (assuming the array has already been 
created before going into the while loop of the directory listing):

   $New = preg_replace('/^(\w\w)(-map\.gif)$/i',
$Countries[\\1]\\2, $FileName);


The array with Country Codes as the key and the Country Name as the 
value (put this before the other steps):

$Countries['AF'] = 'Afghanistan';
$Countries['AL'] = 'Albania';
$Countries['DZ'] = 'Algeria';
$Countries['AS'] = 'American Samoa';
$Countries['AD'] = 'Andorra';
$Countries['AO'] = 'Angola';
$Countries['AI'] = 'Anguilla';
$Countries['AQ'] = 'Antarctica';
$Countries['AG'] = 'Antigua and Barbuda';
$Countries['AR'] = 'Argentina';
$Countries['AM'] = 'Armenia';
$Countries['AW'] = 'Aruba';
$Countries['AU'] = 'Australia';
$Countries['AT'] = 'Austria';
$Countries['AZ'] = 'Azerbaijan';
$Countries['BS'] = 'Bahamas';
$Countries['BH'] = 'Bahrain';
$Countries['BD'] = 'Bangladesh';
$Countries['BB'] = 'Barbados';
$Countries['BY'] = 'Belarus';
$Countries['BE'] = 'Belgium';
$Countries['BZ'] = 'Belize';
$Countries['BJ'] = 'Benin';
$Countries['BM'] = 'Bermuda';
$Countries['BT'] = 'Bhutan';
$Countries['BO'] = 'Bolivia';
$Countries['BA'] = 'Bosnia and Herzegovina';
$Countries['BW'] = 'Botswana';
$Countries['BV'] = 'Bouvet Island';
$Countries['BR'] = 'Brazil';
$Countries['IO'] = 'British Indian Ocean Territory';
$Countries['BN'] = 'Brunei';
$Countries['BG'] = 'Bulgaria';
$Countries['BF'] = 'Burkina Faso';
$Countries['BI'] = 'Burundi';
$Countries['KH'] = 'Cambodia';
$Countries['CM'] = 'Cameroon';
$Countries['CA'] = 'Canada';
$Countries['CV'] = 'Cape Verde';
$Countries['KY'] = 'Cayman Islands';
$Countries['CF'] = 'Central African Republic';
$Countries['TD'] = 'Chad';
$Countries['CL'] = 'Chile';
$Countries['CN'] = 'China';
$Countries['CX'] = 'Christmas Island';
$Countries['CC'] = 'Cocos (Keeling) Islands';
$Countries['CO'] = 'Colombia';
$Countries['KM'] = 'Comoros';
$Countries['ZR'] = 'Congo, Democratic Republic of the';
$Countries['CG'] = 'Congo, Republic of the';
$Countries['CK'] = 'Cook Islands';
$Countries['CR'] = 'Costa Rica';
$Countries['CI'] = 'Cote dIvoire';
$Countries['HR'] = 'Croatia';
$Countries['CU'] = 'Cuba';
$Countries['CY'] = 'Cyprus';
$Countries['CZ'] = 'Czech Republic';
$Countries['DK'] = 'Denmark';
$Countries['DJ'] = 'Djibouti';
$Countries['DM'] = 'Dominica';
$Countries['DO'] = 'Dominican Republic';
$Countries['TP'] = 'East Timor';
$Countries['EC'] = 'Ecuador';
$Countries['EG'] = 'Egypt';
$Countries['SV'] = 'El Salvador';
$Countries['GQ'] = 'Equatorial Guinea';
$Countries['ER'] = 'Eritrea';
$Countries['EE'] = 'Estonia';
$Countries['ET'] = 'Ethiopia';
$Countries['FK'] = 'Falkland Islands (Islas Malvinas)';
$Countries['FO'] = 'Faroe Islands';
$Countries['FJ'] = 'Fiji';
$Countries['FI'] = 'Finland';
$Countries['FR'] = 'France';
$Countries['GF'] = 'French Guiana';
$Countries['PF'] = 'French Polynesia';
$Countries['TF'] = 'French Southern and Antarctic Lands';
$Countries['GA'] = 'Gabon';
$Countries['GM'] = 'Gambia';
$Countries['GE'] = 'Georgia';
$Countries['DE'] = 'Germany';
$Countries['GH'] = 'Ghana';
$Countries['GI'] = 'Gibraltar';
$Countries['GR'] = 'Greece';
$Countries['GL'] = 'Greenland';
$Countries['GD'] = 'Grenada';
$Countries['GP'] = 'Guadeloupe';
$Countries['GU'] = 'Guam';
$Countries['GT'] = 'Guatemala';
$Countries['GN'] = 'Guinea';
$Countries['GW'] = 'Guinea-Bissau';
$Countries['GY'] = 'Guyana';
$Countries['HT'] = 'Haiti';
$Countries['HM'] = 'Heard Island and McDonald Islands';
$Countries['VA'] = 'Holy See (Vatican City)';
$Countries['HN'] = 'Honduras';
$Countries['HK'] = 'Hong Kong';
$Countries['HU'] = 'Hungary';
$Countries['IS'] = 'Iceland';
$Countries['IN'] = 'India';
$Countries['ID'] = 'Indonesia';
$Countries['IR'] = 'Iran';
$Countries['IQ'] = 'Iraq';
$Countries['IE'] = 'Ireland';
$Countries['IL'] = 'Israel';
$Countries['IT'] = 'Italy';
$Countries['JM'] = 'Jamaica';
$Countries['JP'] = 'Japan';
$Countries['JO'] = 'Jordan';
$Countries['KZ'] = 'Kazakhstan';
$Countries['KE'] = 'Kenya';
$Countries['KI'] = 'Kiribati';
$Countries['KP'] = 'Korea, North';
$Countries['KR'] = 'Korea, South';
$Countries['KW'] = 'Kuwait';
$Countries['KG'] = 'Kyrgyzstan';
$Countries['LA'] = 'Laos';
$Countries['LV'] = 'Latvia';
$Countries['LB'] = 'Lebanon';
$Countries['LS'] = 'Lesotho';
$Countries['LR'] = 'Liberia';
$Countries['LY'] = 'Libya';
$Countries['LI'] = 'Liechtenstein';
$Countries['LT'] = 'Lithuania';
$Countries['LU'] = 'Luxembourg';

Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

Sources.

Andrey 

- Original Message - 
From: Hunter, Ray [EMAIL PROTECTED]
To: 'Rasmus Lerdorf' [EMAIL PROTECTED]; Richard Davey [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 6:59 PM
Subject: RE: [PHP] How to access arrays from $GLOBAL?


 Where is some good documentation on how $GLOBALS works and what is really
 going on in the background?
 
 
 Thank you,
 
 Ray Hunter
 Firmware Engineer
 
 ENTERASYS NETWORKS
 
 
 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, March 13, 2002 9:53 AM
 To: Richard Davey
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] How to access arrays from $GLOBAL?
 
 
 I don't understand why you think it is illogical.  How else would you
 dereference a multi-dimensional array?
 
 On Wed, 13 Mar 2002, Richard Davey wrote:
 
  Mike Ford [EMAIL PROTECTED] wrote in message 
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
  ..
   $GLOBALS['mtxt'][1]
 
  Fantastic :)
 
  That's totally illogical but it works a treat.
  PHP has some weird syntax rules sometimes!
 
  Cheers,
 
  Rich
  --
  Fatal Design
  http://www.fatal-design.com
  Atari / DarkBASIC / Coding / Since 1995
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Richard Davey

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I don't understand why you think it is illogical.  How else would you
 dereference a multi-dimensional array?

Because in my mind (which I know is totally wrong in this instance, I'm just
explaining for your benefit) using:

$GLOBALS['mtxt'][1];

is like saying give me element 1 of the globals array when I was thinking
but I want element 1 of the mtxt array which is why I tried the various
combinations of mtxt[1] _inside_ of the globals[].

Hope that explains a little.

Cheers,

Richard
--
Fatal Design
http://www.fatal-design.com
Atari / DarkBASIC / Coding / Since 1995




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




RE: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Rasmus Lerdorf

I am not sure there is any.  $GLOBALS is simply an array that contains
individual references to each global variable.

For example:

  $a = 1;
  $GLOBALS['a'] = 2;
  echo $a;

gives you 2

The best documentation is probably the basic explanation of how references
work.  http://php.net/references

-Rasmus

On Wed, 13 Mar 2002, Hunter, Ray wrote:

 Where is some good documentation on how $GLOBALS works and what is really
 going on in the background?


 Thank you,

 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 13, 2002 9:53 AM
 To: Richard Davey
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] How to access arrays from $GLOBAL?


 I don't understand why you think it is illogical.  How else would you
 dereference a multi-dimensional array?

 On Wed, 13 Mar 2002, Richard Davey wrote:

  Mike Ford [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
  ..
   $GLOBALS['mtxt'][1]
 
  Fantastic :)
 
  That's totally illogical but it works a treat.
  PHP has some weird syntax rules sometimes!
 
  Cheers,
 
  Rich
  --
  Fatal Design
  http://www.fatal-design.com
  Atari / DarkBASIC / Coding / Since 1995
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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



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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

to add that $GLOBALS has reference to itself but when used in non-function context. 
Try ?php var_dump($GLOBALS);? and ?php
function a(){ var_dump($GLOBALS); } a(); ?

Regards,
Andrey Hristov

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Hunter, Ray [EMAIL PROTECTED]
Cc: Richard Davey [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 7:09 PM
Subject: RE: [PHP] How to access arrays from $GLOBAL?


 I am not sure there is any.  $GLOBALS is simply an array that contains
 individual references to each global variable.

 For example:

   $a = 1;
   $GLOBALS['a'] = 2;
   echo $a;

 gives you 2

 The best documentation is probably the basic explanation of how references
 work.  http://php.net/references

 -Rasmus

 On Wed, 13 Mar 2002, Hunter, Ray wrote:

  Where is some good documentation on how $GLOBALS works and what is really
  going on in the background?
 
 
  Thank you,
 
  Ray Hunter
  Firmware Engineer
 
  ENTERASYS NETWORKS
 
 
  -Original Message-
  From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, March 13, 2002 9:53 AM
  To: Richard Davey
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] How to access arrays from $GLOBAL?
 
 
  I don't understand why you think it is illogical.  How else would you
  dereference a multi-dimensional array?
 
  On Wed, 13 Mar 2002, Richard Davey wrote:
 
   Mike Ford [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
   ..
$GLOBALS['mtxt'][1]
  
   Fantastic :)
  
   That's totally illogical but it works a treat.
   PHP has some weird syntax rules sometimes!
  
   Cheers,
  
   Rich
   --
   Fatal Design
   http://www.fatal-design.com
   Atari / DarkBASIC / Coding / Since 1995
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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




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




[PHP] --enable-xslt

2002-03-13 Thread Erik Price

A few days ago I upgraded to 4.1.2 on my RH 7.2 server.

I used --enable-xslt and --with-sablot in my configure parameters 
because I thought it would be fun to learn more about XSLT with PHP.  
But there were problems (I don't have the actual error message, and 
would like to avoid re-configuring to reproduce it if possible), and I 
needed to drop both of these parameters to the configure script.

I was thinking of recompiling with these parameters, and was wondering 
if anyone on this list knows what is required to do this -- do I need to 
install a program called Sablotron first?  It seems like it.

If anyone has a resource or somewhere I should be looking, please by all 
means point me in the right direction.


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] re: passing inputs

2002-03-13 Thread Jim Long

THANKS TO ERIK PRICE !

You ablility to explain php concepts in simple langauge is exactly why I
signed up for this list! 

I will be deeply greatful for any other tutorials like this one on
passing imputs.

THANKS AGAIN,
Jim Long

Erik Price wrote:

 John,
 
 It seems that you're using two different conventions here.  This is 
 inconsistent, and confusing to me (at least, and possibly others trying 
 to help you).  Let me show you what I am talking about:


 Please don't be insulted if I make an assumption about what you know 
 about the use of variables within scripts, I'm going to do my best to 
 explain this and I can't know how much you know or don't.  Here's how it 
 works:

 On a script, you have access to any variable that you create within that 
 script.  Thus, if you create a variable named $inp, you can then echo 
 that variable or manipulate it in any way.  Like this:
 
 $inp = blue;   // this assigns the string blue to the $inp variable
 echo $inp;   // this echoes blue
 $outp = green;  // this assigns green (a string) to the $outp 
 variable
 $outp . $inp;   // this combines (concatenates) the two variables 
 together
  // and results in the string greenblue
 
 Okay, you probably already know all of that.  But my point is that these 
 variables are accessible to this particular script.  NOT TO OTHER 
 SCRIPTS.  If you need a variable to be accessible to another script, you 
 must pass the variable along.  There are a few ways to do this:
 
 etc..etc..etc..

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




RE: [PHP] Comparing two dynamic dates

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Erick [mailto:[EMAIL PROTECTED]]
 Sent: 12 March 2002 01:47
 
 
 I've been working on this for a little while now, without success. I 
 want to compare the current date to a certain recurring date (ie: 
 compare todays date to the date of the second Sunday of the a certain 
 month). I have an event that happens on the second Sunday of 
 each month, 
 and I want to show the next date on which the event occurs, 
 without just 
 listing the next few months. Can anyone help?

Amazingly, I believe the following will do the trick:

   $second_sun_next_month = strtotime('2sunday', strtotime('+month 1 '.date('F')));

Or, breaking it down into understandable chunks:

   $this_month = date('F'); // 'March', as I write this!
   $first_of_next_month = strtotime(+month 1 ${this_month});
  // interpreted by strtotime as one month after the 1st of this month -- i.e. 
1st April
  // returned value is a UNIX timestamp
   $second_sun_next_month = strtotime('2sunday', $first_of_next_month);
  // returns date of second Sunday counting from 1st of next month.

strtotime is actually quite a powerful beast, especially in its range of relative 
dates -- go to http://uk.php.net/manual/en/function.strtotime.php and follow the Date 
Input Formats link to get the full picture.

HTH

Cheers!

Mike

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

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




RE: [PHP] How to access arrays from $GLOBAL?

2002-03-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Richard Davey [mailto:[EMAIL PROTECTED]]
 Sent: 13 March 2002 17:12
 
 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I don't understand why you think it is illogical.  How else 
 would you
  dereference a multi-dimensional array?
 
 Because in my mind (which I know is totally wrong in this 
 instance, I'm just
 explaining for your benefit) using:
 
 $GLOBALS['mtxt'][1];
 
 is like saying give me element 1 of the globals array when 
 I was thinking
 but I want element 1 of the mtxt array

But $GLOBALS['mtxt'] *is* the mtxt array -- so logically element 1 of it can only be 
$GLOBALS['mtxt'][1].

Cheers!

Mike

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

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




[PHP] Credit Card Processing

2002-03-13 Thread David Johansen

I was just wondering what people thought was the best credit card processing
place. I've been looking at Authorize.net and PayFlow Pro and I was just
wondering if people had any experience with them and had any thoughts on
which one was easiest to work with and which one worked best. Thanks,
Dave



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




Re: [PHP] Re: PHP based search engine

2002-03-13 Thread Tim Thorburn

I've gone to the mnoGoSearch page - it does look like it would do the job 
nicely, however my hosting company absolutely refuses to upgrade to 
anything above PHP 3.0.16, also it appears as though I'd have to compile a 
good portion of mnoGoSearch on the server itself - another thing I'm not 
allowed to do.

I think I've got the Fluid Dynamics search engine working fairly well now - 
its not perfect, but it'll do until I can come up with something better.

Thanks
-Tim


At 11:39 AM 3/13/2002 +0100, you wrote:
David Robley wrote:
PHP from around 4.05 has functions available to interface with the 
mnoGOSearch search engine, available from http://www.mnogosearch.ru/
I recommend you look at this combination.

I recommend this one to, its a very good alternative which I used for 
several projects.

The nice thing is that you can easily update and keep the index updated by 
yourself, no need for that stupid indexer that comes along to crawl around 
your site.

I have a small script which inserts new keywords/descriptions/titles 
directly in the index on update of something that should be searchable.
This is probably easiest to do when you're using a database as a backend 
for the search.

Another soloution is to have a hourly cronscript that updates the index. I 
have used that on bookmarks.egp.cx . Since I have a  modification 
timestamp on each link there I only need to update those who where changed 
since the last indexinground. Often there are no links modified in the 
last hour, so its not very resourcehungry, but that depends on the data 
off course. :)

Just my ideas. :)

Good luck!
 Eric


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




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




Re: [PHP] re: passing inputs

2002-03-13 Thread Rasmus Lerdorf

 echo 'input name = inp type = hidden value = '.$_POST['$inp'].'';

First of all, $_POST will only work in PHP 4.1.x so make sure you are
running a recent version.  And second, I bet you mean $_POST['inp'] there.

-Rasmus


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




Re: [PHP] --enable-xslt

2002-03-13 Thread Anas Mughal

http://www.devshed.com/Server_Side/XML/XSLTrans/print


--- Erik Price [EMAIL PROTECTED] wrote:
 A few days ago I upgraded to 4.1.2 on my RH 7.2
 server.
 
 I used --enable-xslt and --with-sablot in my
 configure parameters 
 because I thought it would be fun to learn more
 about XSLT with PHP.  
 But there were problems (I don't have the actual
 error message, and 
 would like to avoid re-configuring to reproduce it
 if possible), and I 
 needed to drop both of these parameters to the
 configure script.
 
 I was thinking of recompiling with these parameters,
 and was wondering 
 if anyone on this list knows what is required to do
 this -- do I need to 
 install a program called Sablotron first?  It seems
 like it.
 
 If anyone has a resource or somewhere I should be
 looking, please by all 
 means point me in the right direction.
 
 
 Erik
 
 
 
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Anas Mughal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel: 973-249-6665

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

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




[PHP] php setup questions

2002-03-13 Thread Dennis Gearon

When the apache server goes to an error document, specifically, 404, do
the post variables go with it? Could I 'vector' off of the 404 document
and serve virtual pages out of the database?

Also, what's the best way to execute php code that resides in a
database?
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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




[PHP] Re: Random Selecting from mySQL

2002-03-13 Thread Julio Nobrega Trabalhando

  You could store the results in a session var to carry along the pages.
Then on the second just retrieve them.

  Or maybe a second table with this info. Give each search an ID and store
the results there. It would be easy to implement:

INSERT INTO table ('',field) SELECT field FROM table ORDER BY rand()

  The first '' is for the autoincrement that will be used as your search id.

--

Julio Nobrega.

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

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


Georgie Casey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I know how to use the ORDER BY rand() command on the end of queries to
 randomize selection, but that's no good when you want to only display 10
 results per page. The next page the user chooses, randomizes again and
could
 show duplicate fields and not at all show other fields.

 Does anyone know a way round this?

 --
 Regards,
 Georgie Casey
 [EMAIL PROTECTED]

 ***
 http://www.filmfind.tv
 Ireland's Online Film Production Directory
 ***





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




[PHP] Own ErrorHandler but standard ErrorMsg

2002-03-13 Thread Malte Hübner

Hi!

I've got a little Problem with my ErrorHandler.

set_error_handler('ErrorHandler'); is executed on top of my script. Right
after it the ErrorHandler function.

After the ErrorHandler function there is a require('foo.php');

foo.php does not exist, so there should be an error message thrown out from
my ErrorHandler - but the error message which i get is the standard-php
error message.

My ErrorHandler function works really fine and i only get the php-standard
error from not existing includes or requires.
Does anyone know how to solve this?

error_reporting is set to 2039 in php.ini

Thanks for helping!

malte


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




[PHP] Re: Random number Question

2002-03-13 Thread Ralph Friedman

In article [EMAIL PROTECTED], Jennifer Downey wrote:

 input type=text size=3
 INPUT TYPE=submit VALUE=Submit my number NAME=guess

you've got the Name attribute attached to the wrong INPUT element:

 INPUT type=text size=3  name=guess
 INPUT type=submit value=Submit my number

 if($guess = = $number) {

incorrect syntax here. that should be:
 if ($guess == $number) {
 
 better would be:
 
 if (trim($guess) == $number {
 
 this will assure that there's no whitespace in $guess
 
-- 
Rgds
Ralph



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




[PHP] Targetted redirection?

2002-03-13 Thread Ben Cheng

I have a page within a frame that uses Header() to redirect to another page.
However, I don't want the redirection to take place just within that frame
set.  I want the page that it redirects to to cover over the frame.  Is this
possible?

-Ben


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




Re: [PHP] Own ErrorHandler but standard ErrorMsg

2002-03-13 Thread Lars Torben Wilson

On Wed, 2002-03-13 at 11:06, Malte Hübner wrote:
 Hi!
 
 I've got a little Problem with my ErrorHandler.
 
 set_error_handler('ErrorHandler'); is executed on top of my script. Right
 after it the ErrorHandler function.
 
 After the ErrorHandler function there is a require('foo.php');
 
 foo.php does not exist, so there should be an error message thrown out from
 my ErrorHandler - but the error message which i get is the standard-php
 error message.
 
 My ErrorHandler function works really fine and i only get the php-standard
 error from not existing includes or requires.
 Does anyone know how to solve this?
 
 error_reporting is set to 2039 in php.ini
 
 Thanks for helping!
 
 malte

From the manual (http://www.php.net/manual/en/function.require.php):

 require() and include() are identical in every way except how they 
 handle failure. include() produces a Warning while require() results 
 in a  Fatal Error. In other words, don't hesitate to use require() if 
 you want a missing file to halt processing of the page. include() does 
 not behave this way, the script will continue regardless. Be sure to 
 have an appropriate include_path setting as well.

And since you can't catch Fatal errors, you can't do this. If you want
to prevent the script from displaying this error, set display_errors = 
Off. If you want the script to not halt there, use include.


Hope this helps,

Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Targetted redirection?

2002-03-13 Thread Erik Price


On Wednesday, March 13, 2002, at 03:15  PM, Ben Cheng wrote:

 I have a page within a frame that uses Header() to redirect to another 
 page.
 However, I don't want the redirection to take place just within that 
 frame
 set.  I want the page that it redirects to to cover over the frame.  Is 
 this
 possible?

Hm... I don't think that frames were ever intended to be manipulated at 
the level of headers!  Otherwise you could use a target attribute or 
something.  If you're willing to use a bit of JavaScript, you might be 
able to reference a new window or something like a target=_blank and 
THEN call the header() function from there... but that's more of a 
workaround than a solution.

Good luck, sorry I don't have any other ideas.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Targetted redirection?

2002-03-13 Thread Joe Webster

If you were going to use javascript to do that, use _parent as the target --
that should reuse the window rather than making a new window.


-Joe


Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, March 13, 2002, at 03:15  PM, Ben Cheng wrote:

  I have a page within a frame that uses Header() to redirect to another
  page.
  However, I don't want the redirection to take place just within that
  frame
  set.  I want the page that it redirects to to cover over the frame.  Is
  this
  possible?

 Hm... I don't think that frames were ever intended to be manipulated at
 the level of headers!  Otherwise you could use a target attribute or
 something.  If you're willing to use a bit of JavaScript, you might be
 able to reference a new window or something like a target=_blank and
 THEN call the header() function from there... but that's more of a
 workaround than a solution.

 Good luck, sorry I don't have any other ideas.


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




[PHP] Re: Targetted redirection?

2002-03-13 Thread Philip Hallstrom

Some browsers (IE I think) understand a Window-target: targetname
header.  I don't think it works very reliably nor do I remember exactly
what versions, but if you search for Window-target you might find some
more info.

I'd go the javascript route if you can or find another solution...

On Wed, 13 Mar 2002, Ben Cheng wrote:

 I have a page within a frame that uses Header() to redirect to another page.
 However, I don't want the redirection to take place just within that frame
 set.  I want the page that it redirects to to cover over the frame.  Is this
 possible?

 -Ben


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



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




Re: [PHP] accessing data from classes

2002-03-13 Thread Jeff Warrington

In [EMAIL PROTECTED], Samuel Ottenhoff wrote:

 It is good that you are looking into classes and functions. The
 concept you are missing is that of returning a result.
 
 At the end of your function mysql_query, add a line:
 
 return $result;
 
 Then, when you call that function, make it like this:
 
 $resultArray = $TemplateTable-mysql_query(select );
 
 Now you can pass $resultArray on to a different function.
 
 Sam
 

Alternatively, you can define a class variable where you
will be storing the query results and then access that
variable from outside.

so,

class foo {

var $results;

function bar($query) {
 while {
 $this-results[] = $row;
 }
}
}

Then, from outside the class, you can access the variable.

$bar = new foo();
$bar-bar(select foo...);

print($bar-results);

etc...

Jeff



 
 On 3/12/02 3:48 PM, caspar kennerdale [EMAIL PROTECTED] wrote:
 
 I am just getting my head around classes, so forgive me if this is a
 schoolboy error!
 
 In order to learn I am re-writing my content management system and am
 in the process of writing an HTML.class and a MYSQL.class.
 
 so far so good. I spawn new instances of a table for example, sending
 parameter,and a table is output.
 
 now in my MYSQL.class- I want to send a query to my class which then
 returns an array- my database row or rows.
 
 the problem is that whilst my array is created- I only seem to be able
 to manipulate it within my MYSQL class. This is not satisfactory as I
 really want to be able to send it on to my HTML.class for formatting
 etc.
 
 I obvioulsy do not want to format any 'echoed' output from within my
 databasee class.
 
 Here is a bit of sample code-
 
 Once my database is open I call my query like this-
 
 $TemplateTable = new DB;
 $TemplateTable-mysql_query('SELECT * FROM template ORDER BY name ASC
 LIMIT 10');
 
 This is the function within my MYSQL.class
 
 function mysql_query($query){
 $a= 0;
 while($row=mysql_fetch_row($SQL)) {
 $new_row =  join('***',$row);
 $result[] = $new_row;
 echo $result[$a].br;
 $a++;
 }
 }
 
 
 So here I am creating a string with each row in my database which is
 delimted by *** - $new_row.and am placing each row in anew array
 called $result.
 
 I can evaluate and format either $new_row or $result from within
 mysql_query() but I really want to do is to send it on to another
 funtion or even better another class- or access the values glabbally as
 variables.
 
 Any ideas or am I missing something really obvious?
 
 Thanks in advance


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




Re: [PHP] --enable-xslt

2002-03-13 Thread Erik Price


On Wednesday, March 13, 2002, at 01:58  PM, Anas Mughal wrote:

 http://www.devshed.com/Server_Side/XML/XSLTrans/print

Actually, that's the very tutorial that led me to ask about installing 
with XSLT configure parameters.  I'm building it now, as I write this.  
But I was wondering about some XSLT/PHP style advice...

How much of a burden does on-the-fly XSLT place on the server?  I mean, 
relative to a typical setup.  I'm playing with the idea of changing all 
my old HTML to proper XML files, and having PHP generate XML rather than 
HTML (seems trivial, since PHP doesn't really care what markup language 
I use to output data -- I could even do it in plain text if I was so 
inclined).  But as PHP generates the XML, there is another step now, and 
that is the step of running the XML data through one of the XSLT 
functions (such as xslt_create  xslt_run or xslt_process).  I'm sure 
that it all depends on the strength of the server being used, but does 
anyone have a rough estimate of what kind of burden this extra 
processing has?  Or a reference?

Speed isn't the biggest concern, since I don't have a large number of 
users like some public sites.  Mine is an internal site, run off a Linux 
server w/256MB RAM.  But it seems like a lot of work for Apache to 
process the incoming request, hit up the PHP script, fetch data from 
MySQL, format the database output into XML, and then run the XML through 
XSLT to get HTML.  And to answer the question do you really need your 
data in XML?, the answer is no, but this kind of thing gives my boss 
something to brag about to visitors: this is our temp, he's building 
our internal schedule-managing database-driven XML-based web 
application...we pay him little more than minimum wage and he gets no 
benefits, but he's happy with the work.  Plus, it'll look good in the 
portfolio.


Thanks in advance,


Erik


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




[PHP] banner ads

2002-03-13 Thread tom hilton

Hi, does anyone know of a simple banner ad rotation script that can rotate
animated gifs.



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




Re: [PHP] Targetted redirection?

2002-03-13 Thread Analysis Solutions

On Wed, Mar 13, 2002 at 03:52:42PM -0500, Erik Price wrote:
 
 On Wednesday, March 13, 2002, at 03:15  PM, Ben Cheng wrote:
 
 However, I don't want the redirection to take place just within that 
 frame
 set.  I want the page that it redirects to to cover over the frame.  Is 
 this
 possible?
 
 Hm... I don't think that frames were ever intended to be manipulated at 
 the level of headers!

Weird.  This is the third time this question has been asked and answered
in the past couple days...

Put the following in before your header('Location: ...') call 
something along the lines of...
  header('Window-target: _top');

or...
  header('Window-target: _blank');

Does that do what you want?

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




[PHP] Random Selecting from mySQL

2002-03-13 Thread Georgie Casey

I know how to use the ORDER BY rand() command on the end of queries to
randomize selection, but that's no good when you want to only display 10
results per page. The next page the user chooses, randomizes again and could
show duplicate fields and not at all show other fields.

Does anyone know a way round this?

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Ireland's Online Film Production Directory
***



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




[PHP] RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Gurhan Ozen

are you just looking for a way to display 10  results per page? If yes then
you can just use LIMIT to limit your result to 10 .. So, for the first page,
you can do SELECT  LIMIT 1, 10; and for the second page SELECT ...
LIMIT 11, 20 etc etc .
  You can sure use ORDER BY with LIMIT to to sort the results for a
given criteria ..

Gurhan


-Original Message-
From: Georgie Casey [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 2:00 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Random Selecting from mySQL


I know how to use the ORDER BY rand() command on the end of queries to
randomize selection, but that's no good when you want to only display 10
results per page. The next page the user chooses, randomizes again and could
show duplicate fields and not at all show other fields.

Does anyone know a way round this?

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Ireland's Online Film Production Directory
***



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


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




[PHP] finding and appending txt files on server

2002-03-13 Thread Gav

I'm adapting some ecard code for my site so that users can save the position
of various objects within my flash movie.  At the moment I create a random
file name for the text file which is saved to my server.  The user is sent
an email saying to go to this.swf?theinfo=randomtextfile.txt.  The info in
the text file saves a string separated by commas of what objects are on the
stage.  No text or _x or _y positions are needed e.g -

itemString=blue,red,square,trianglecontentLoaded=true

This part works fine.

What I do want to do though is create a gallery feature so what I believe I
need to do is to append the info above into a textfile named total.txt or
something.  So that everytime a separate file is saved on to the server,
it's info is added to this total file.  Is this the way to go about it?  Or
is there a php function that can see what files are in the directory, open
them and then use the info that way?

I was told that a database is the way to go but I have no experience of
these at all.

Any help is appreciated.

Gav



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




[PHP] getting values from multiple select

2002-03-13 Thread Scott St. John

Hi gang-

I am working on a javascript box that will allow the user to drag values 
from one select box to another.  I will use this box to set the values.
This is a standard, multiple select box.  On the next page I need to 
figure out what PHP is doing with the data coming in.

If I send 5 fields to the next page PHP will show me one when I echo the 
variable to the page.  If I try to split the varaiable I still get only 
one value in the echo.  Tried to reponse.write it in asp and I get the 
string with comma seperate values.

Help!

Thanks,

-Scott


-- 



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




[PHP] Redirect?

2002-03-13 Thread Randum Ian

Hi there, I have recently finished a redesign of a website which I have =
put in the directory v2.

If I get someone going to http://www.boo.com is it possible to =
automatically redirect it to http://www.boo.com/v2 and so on?

Basically I need the basehref to be http://www.boo.com/v2 NOT =
http://www.boo.com is this possible?

Regards, Ian.

DJ / Producer / Reviewer / Webdesigner, DancePortal (UK) Limited
[EMAIL PROTECTED] - 07814 364277 (new number)
Webmaster: http://www.randumian.co.uk
Webmaster: http://www.randumiancharts.co.uk
Webmaster: http://www.danceportal.co.uk
Webmaster: http://www.vivienmarkey.com
Webmaster: http://www.yamnd.org.uk
Webdesigner: http://www.allstargambling.co.uk




Re: [PHP] Redirect?

2002-03-13 Thread Hiroshi Ayukawa

You can do it by modifying the setting of your HTTP server.
But if you want to do it by PHP, write

header(Location; http://www.boo.com/v2;);

in your PHP script of http://www.boo.com/index.php.

Regards ,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top

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




[PHP] ICAP/ MCAL Calendaring

2002-03-13 Thread Jackson Miller

I am having a hard time
finding recent mentions of
using MCAL or ICAP with PHP.
I need to add some shared
calendaring to an project I am
working on.  I have been
looking at MCAL and ICAP
hoping to find out if they are
viable.

Is the best way to do
calendaring in PHP to use a
database or is there a better
way (and is it MCAL or ICAP?)?

Thanks,

-Jackson


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




[PHP] XSLT parsing causes passed by reference error

2002-03-13 Thread Edward Tanguay

I get the error:

Fatal error: Only variables can be passed by reference in
/home/tanguay/test/testxslt.php on line 7

when I run this code:

?php

// Allocate a new XSLT processor
$xh = xslt_create();

// Process the document, returning the result into the $result variable
$result = xslt_process($xh, 'content.xml', 'website.xsl');
if ($result) {
print SUCCESS, sample.xml was transformed by sample.xsl into the
\$result;
print  variable, the \$result variable has the following
contents\nbr\n;
print pre\n;
print $result;
print /pre\n;
}
else {
print Sorry, sample.xml could not be transformed by sample.xsl into;
print   the \$result variable the reason is that  . xslt_error($xh) .
print  and the error code is  . xslt_errno($xh);
}

xslt_free($xh);

?

Can anyone tell me why? Is this a problem with the parser or some other
problem.
I am new to the XSLT functions.

Thanks,

Edward




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




[PHP] Mini CMS (content management system) (plase cc me, I'm on digest)

2002-03-13 Thread Dennis Gearon

I'm trying to get all requests from a DOMAIN to go through one file,
something like:

http://www.mydomain.com/all_accesses.php

They can come IN as http requests of:

http://www.mydomain.com/any_directory/any_filename?any_vars with any
POST or COOKIE vars.

Anyone have any ideas? I'm trying to make this as DROP in as possible on
a shared ISP, i.e. asking for as little help/sys mods as possible from
the ISP. Zope can be run this way, but it's in Python, and I don't want
to learn that now.


The reason why .. is that:
this allows me to keep the directory structure in the data base, keep
very granular role based permissions on the directory structure, down to
the file, and have a web based interface to upload/download content,
with a powerful auth/perm system. The only files to get into the file
system are binary ones, images, flash, that sort of stuff. I haven't
quite figured out the permissions system for accessing those, yet.
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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




  1   2   >