[PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Mathijs

Hello,

I Want to have a unique time stamp.
And for this i want to use the normal timestamp but it is possible that 
the seconds are the same, so i want to add the micro/milli seconds to 
the end of it.


So when i have something like this as unixtime 1134989511
It wil be 113498951100 or even 1134989511.
Where 00(00) will be the micro/milli time.

Is there a simple way to get this?

Thx in advanced.

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



Re: [PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Richard Heyes

Mathijs wrote:

Hello,

I Want to have a unique time stamp.
And for this i want to use the normal timestamp but it is possible that 
the seconds are the same, so i want to add the micro/milli seconds to 
the end of it.


So when i have something like this as unixtime 1134989511
It wil be 113498951100 or even 1134989511.
Where 00(00) will be the micro/milli time.

Is there a simple way to get this?


http://php.net/microtime

--
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Dragan Stanojevic - Nevidljivi

Mathijs wrote:

I Want to have a unique time stamp.
And for this i want to use the normal timestamp but it is possible that 
the seconds are the same, so i want to add the micro/milli seconds to 
the end of it.


So when i have something like this as unixtime 1134989511
It wil be 113498951100 or even 1134989511.
Where 00(00) will be the micro/milli time.

Is there a simple way to get this?


Heh, you were so close to it :]

http://www.php.net/microtime

bye,
N::

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



Re: [PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Zareef Ahmed
Hi, 

  use microtime function.

Zareef Ahmed 

- Original Message - 
From: Mathijs [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Monday, December 19, 2005 5:58 AM
Subject: [PHP] How to get a unixtime with micro/mille seconds


 Hello,
 
 I Want to have a unique time stamp.
 And for this i want to use the normal timestamp but it is possible that 
 the seconds are the same, so i want to add the micro/milli seconds to 
 the end of it.
 
 So when i have something like this as unixtime 1134989511
 It wil be 113498951100 or even 1134989511.
 Where 00(00) will be the micro/milli time.
 
 Is there a simple way to get this?
 
 Thx in advanced.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 




PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



[PHP] AJAX Framework

2005-12-19 Thread Erfan Shirazi

Hi all


Just wanted to get some feedback on which AJAX Framework people uses?
I use SAJAX, is there anybody which maybe has used SAJAX but are now 
using something else instead, maybe somebody knows some better frameworks?


Best Regards,
/Erfan

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



Re: [PHP] duplicate filenames but different .extention

2005-12-19 Thread Dragan Stanojevic - Nevidljivi

matt VanDeWalle wrote:

hello again
I am trying to figure out how i can read the list of files in a 
directory using the opendir() and readdir() functions.  Normally this 
goes fine but within the loop, what i am wanting to do is echo the 
filename if it is a jpg file, but if its a .gif, just continue.

I have several files i wish to seperate based on the basename of the file.
i read the basename help file and know how to use it even to exclude the 
.3letterextention.  I am however wanting to skip if it happens to be a 
.gif, is there some sort of way to i guess, do the basename function in 
reverse, e.g if it comes across xx.gif it would skip it but not 
skip over the xxx.jpg files?
that is my latest problem, it skips everything when i have a line like 
this in my loop


if($file = basename('.gif',$file))
continue;
else go on with code

this not only skips over .gif files, but everything is ignored
any ideas?


U have only one = in if! It always returns true upon execution...

try this:
// $file is filename like pic.gif
$ext = pathinfo( $file );
$ext = $ext[ 'extension' ];

if( $ext === 'gif' )
continue;

bye,
N::

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



Re: [PHP] AJAX Framework

2005-12-19 Thread Zareef Ahmed

Hi,

   You can try  pear package HTML_AJAX

http://pear.php.net/package/HTML_AJAX

Zareef Ahmed

- Original Message - 
From: Erfan Shirazi [EMAIL PROTECTED]
To: php-general@lists.php.net; Niklas Palmqvist [EMAIL PROTECTED]
Sent: Monday, December 19, 2005 6:04 AM
Subject: [PHP] AJAX Framework


 Hi all


 Just wanted to get some feedback on which AJAX Framework people uses?
 I use SAJAX, is there anybody which maybe has used SAJAX but are now
 using something else instead, maybe somebody knows some better frameworks?

 Best Regards,
 /Erfan

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






PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]




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



Re: [PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Mathijs

Zareef Ahmed wrote:
Hi, 


  use microtime function.

Zareef Ahmed 

- Original Message - 
From: Mathijs [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Monday, December 19, 2005 5:58 AM
Subject: [PHP] How to get a unixtime with micro/mille seconds



Hello,

I Want to have a unique time stamp.
And for this i want to use the normal timestamp but it is possible that 
the seconds are the same, so i want to add the micro/milli seconds to 
the end of it.


So when i have something like this as unixtime 1134989511
It wil be 113498951100 or even 1134989511.
Where 00(00) will be the micro/milli time.

Is there a simple way to get this?

Thx in advanced.

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








PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


Well i knew about microtime().
But i hoped i didn't had to use substr() to extract the unique numbers :).

But this will work also.

Anyway thx for the help.

Kind Regards,
Mathijs.

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



Re: [PHP] AJAX Framework

2005-12-19 Thread Miles Thompson

Search the archives for

[PHP] Rasmus' 30 second AJAX Tutorial - [was Re: [PHP] AJAX  PHP]

posted on July 21, 2005.

Miles

At 07:17 AM 12/19/2005, Zareef Ahmed wrote:


Hi,

   You can try  pear package HTML_AJAX

http://pear.php.net/package/HTML_AJAX

Zareef Ahmed

- Original Message -
From: Erfan Shirazi [EMAIL PROTECTED]
To: php-general@lists.php.net; Niklas Palmqvist [EMAIL PROTECTED]
Sent: Monday, December 19, 2005 6:04 AM
Subject: [PHP] AJAX Framework


 Hi all


 Just wanted to get some feedback on which AJAX Framework people uses?
 I use SAJAX, is there anybody which maybe has used SAJAX but are now
 using something else instead, maybe somebody knows some better frameworks?

 Best Regards,
 /Erfan

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






PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]




--
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] Write a FIFO file

2005-12-19 Thread Ruben Rubio Rey

Hi,

I have  a problem. I have created a fifo file (under linux) and I m not 
able to append some line from a php script.  There is not output error, 
php just is executing for ever ...


How can I write a fifo file?

Thanks in advance

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



Re: [PHP] accessing RAW response

2005-12-19 Thread tg-php
There's probably a better way to do it, but I'd start parsing your respond and 
search for ?xml version=1.0 encoding=iso-8859-1? and start your data 
collection after you see that.

If you're using PHP's XML parser (xml_parser_create() and such), then you don't 
have to worry about the header. It'll be disregarded since it's not 'contained' 
inside any tags.

Cheap hack, but should work fine.

-TG

= = = Original message = = =

Hi,

I am posting a request to a server from a PHP and getting a result. When I
trap the response, it comes with all the contents. Is there a method to
strip off the extra information and just capture the result?
For example I get

HTTP/1.1 200 OK
Date: Mon, 19 Dec 2005 07:25:38 GMT
Server: Apache/2.0.55 (Win32) PHP/5.1.1
X-Powered-By: PHP/5.1.1
Content-Length: 190
Connection: close
Content-Type: text/xml

?xml version=1.0 encoding=iso-8859-1?
responseValueblah blah/responseValue


Is it possible to just grab the responseValueblah blah/responseValue
directly or do I have to parse through this response to get it?

Thanks in advance.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] Write a FIFO file

2005-12-19 Thread Jay Blanchard
[snip]
I have  a problem. I have created a fifo file (under linux) and I m not 
able to append some line from a php script.  There is not output error, 
php just is executing for ever ...

How can I write a fifo file?
[/snip]

Please have a look here; http://www.php.net/file as a starting point for
file operations. You can append to a file with the fopen() function...
http://www.php.net/fopen

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



[PHP] ? Split string into smaller chunks

2005-12-19 Thread Labunski
I need to split a long string into smaler chunks (an array), as a separator 
using every third \n (and not just every \n).
I could use 'explode', but then it would produce too many chunks.

Thank you in advance!

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



Re: [PHP] PHP/MySQL noob rides again.. into trouble

2005-12-19 Thread Eric Butera

 Could you direct me towards any good resources on general security with
 php/mysql?




http://phpsec.org/library/

Make sure to read these:
- data filtering
- sql injection

. . .and all the others in time. =)


RE: [PHP] ? Split string into smaller chunks

2005-12-19 Thread Jay Blanchard
[snip]
I need to split a long string into smaler chunks (an array), as a separator 
using every third \n (and not just every \n).
I could use 'explode', but then it would produce too many chunks.
[/snip]

http://us2.php.net/manual/en/function.chunk-split.php

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



Re: [PHP] ? Split string into smaller chunks

2005-12-19 Thread Anas Mughal
Split them using explode and then combine the ones you need to combined.
Hope this helps.
--
Anas Mughal



On 12/19/05, Labunski [EMAIL PROTECTED] wrote:

 I need to split a long string into smaler chunks (an array), as a
 separator
 using every third \n (and not just every \n).
 I could use 'explode', but then it would produce too many chunks.

 Thank you in advance!

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




--
Anas Mughal


Re: [PHP] ? Split string into smaller chunks

2005-12-19 Thread David Grant
Labunski wrote:
 I need to split a long string into smaler chunks (an array), as a separator 
 using every third \n (and not just every \n).
 I could use 'explode', but then it would produce too many chunks.

php.net/preg_split

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

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



[PHP] nexcess.net

2005-12-19 Thread Miles Thompson

Anyone using nexecess.net, and have an opinion pro or con?

Miles

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



RE: [PHP] nexcess.net

2005-12-19 Thread Jay Blanchard
[snip]
Anyone using nexecess.net, and have an opinion pro or con?
[/snip]

Con -- the page cannot be displayed

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



RE: [PHP] nexcess.net

2005-12-19 Thread Erin Fortenberry
I think this is what he means;

http://www.nexcess.net/ 


I can say, using their Interworx product, that they have GREAT support. I
have never used their hosting.


-Erin
 

 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
 Sent: Monday, December 19, 2005 12:52 PM
 To: 'Miles Thompson'; php-general@lists.php.net
 Subject: RE: [PHP] nexcess.net
 
 [snip]
 Anyone using nexecess.net, and have an opinion pro or con?
 [/snip]
 
 Con -- the page cannot be displayed
 
 -- 
 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] nexcess.net

2005-12-19 Thread John Nichel

Jay Blanchard wrote:

[snip]
Anyone using nexecess.net, and have an opinion pro or con?
[/snip]

Con -- the page cannot be displayed



Well, depends on the contents of the page.  I've seen some sites where 
it would be considered a 'pro' if the page couldn't be displayed.  ;)


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] nexcess.net - Spelling!!

2005-12-19 Thread Miles Thompson

Apologies, I should have written,

Is anyone using nexcess.net? Opinion, pro or con?
I'm not usually swayed by advertising, but as they're supporting 
PHP|architect though they deserved a look.


Miles
At 01:48 PM 12/19/2005, Miles Thompson wrote:

Anyone using nexecess.net, and have an opinion pro or con?

Miles

--
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] Storing encrypted data into mysql: blob vs bin2hex

2005-12-19 Thread Mark Steudel
 
I have the following encryption function. And what I wanted to know is, Do I
need to convert this to hex before storing this in a mysql database? Or
could I store it into a blob and be fine?

// from zend code gallery
function RC4($keyfile, $data) { //ecncrypt $data with the key in $keyfile
with an rc4 algorithm 
$pwd = implode('', file($keyfile)); 
$pwd_length = strlen($pwd); 
for ($i = 0; $i  255; $i++) { 
  $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1)); 
$counter[$i] = $i; 
} 
for ($i = 0; $i  255; $i++) { 
$x = ($x + $counter[$i] + $key[$i]) % 256; 
$temp_swap = $counter[$i]; 
$counter[$i] = $counter[$x]; 
$counter[$x] = $temp_swap; 

} 
for ($i = 0; $i  strlen($data); $i++) { 
$a = ($a + 1) % 256; 
$j = ($j + $counter[$a]) % 256; 
$temp = $counter[$a]; 
$counter[$a] = $counter[$j]; 
$counter[$j] = $temp; 
$k = $counter[(($counter[$a] + $counter[$j]) % 256)]; 
$Zcipher = ord(substr($data, $i, 1)) ^ $k; 
$Zcrypt .= chr($Zcipher); 
} 
return $Zcrypt; 
} 

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



[PHP] Connecting to PHP

2005-12-19 Thread will
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?

thanks,
will

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



RE: [PHP] Connecting to PHP

2005-12-19 Thread Jay Blanchard
[snip]
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?
[/snip]

PHP has COM functions http://www.php.net/com but I am unsure that this
answers your question.

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



[PHP] PHP errors in Apache error logs

2005-12-19 Thread Jose Borquez
I am attempting to configure Group Office which is a Project Management 
suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, MySQL 5.0.16, 
PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error 
messages in my error logs when I attempt to open a php page:


[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to undefined 
function
session_save_path() in 
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.

php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
Fatal error

- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is?  Any 
help would be greatly appreciated.


Thanks in advance,
Jose

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



Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread John Nichel

Jose Borquez wrote:
I am attempting to configure Group Office which is a Project Management 
suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, MySQL 5.0.16, 
PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error 
messages in my error logs when I attempt to open a php page:


[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to undefined 
function
session_save_path() in 
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.

php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
Fatal error

- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is?  Any 
help would be greatly appreciated.


How is your version of PHP configured?  Was --disable-session set?

Setup a phpinfo page, and you'll be able to see the configuration line, 
and whether or not sessions are enabled.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Erin Fortenberry
It looks to me like the function session_save_path() does not exist.

You might look and see if Group Office supports PHP 5.1.x, you might have to
go back to an earlier version.


-Erin


 -Original Message-
 From: Jose Borquez [mailto:[EMAIL PROTECTED] 
 Sent: Monday, December 19, 2005 2:13 PM
 To: PHP Questions Lists
 Subject: [PHP] PHP errors in Apache error logs
 
 I am attempting to configure Group Office which is a Project 
 Management 
 suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, 
 MySQL 5.0.16, 
 PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error 
 messages in my error logs when I attempt to open a php page:
 
 [Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to 
 undefined 
 function
 session_save_path() in 
 /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
 php on line 792
 /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
 Fatal error
 - Call to undefined function session_save_path()
 
 Could someone please give me any ideas as to what the problem 
 is?  Any 
 help would be greatly appreciated.
 
 Thanks in advance,
 Jose
 
 -- 
 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] Connecting to PHP

2005-12-19 Thread tg-php
No.. it sounds like he wants to make function calls to PHP from another app..   
kind of the reverse of using PHP's COM calls.

I'm not aware that PHP has any registration in an OS or any kind of inherent 
listening mechanisms like COM has (I'm phrasing that poorly but you get the 
idea).

You can call PHP via command-line and tell it to execute a script or pass it 
PHP functions to execute.

You may be able to create something that actively hooks into the Windows API 
(or whatever your native OS's event handler is) and watches for certain events 
or conditions then responds to those events.  But that would mean actively 
running a PHP script.


The idea with COM is that you can treat applications as objects.  You call the 
object, perform functions, access internal objects and properties, get it to do 
some tricks, then unload the application. Sometimes without even seeing that 
app has been called.


If that's what you want to do with PHP... then it doesn't do it natively.


Kind of an interesting thought though..  register PHP as a COM-compliant object 
in Windows. Hmm..  Would require some kind of wrapper or whatever, but it'd 
open up PHP functionality to every Microsoft product (can you imagine calling 
PHP functions from within Access or Excel or Word?).   Probably pointless 
because 99% of what you can do in PHP you can do in VBA..  not as elegantly I 
think (I've worked extensively in both) but someone may have a need.


Any thoughts?

-TG

= = = Original message = = =

[snip]
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?
[/snip]

PHP has COM functions http://www.php.net/com but I am unsure that this
answers your question.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Erin Fortenberry
You also might try;

http://www.group-office.com/forum/

They have had several people asl about the same error.


-Ein


 -Original Message-
 From: Erin Fortenberry 
 Sent: Monday, December 19, 2005 2:23 PM
 To: Jose Borquez; PHP Questions Lists
 Subject: RE: [PHP] PHP errors in Apache error logs
 
 It looks to me like the function session_save_path() does not exist.
 
 You might look and see if Group Office supports PHP 5.1.x, 
 you might have to go back to an earlier version.
 
 
 -Erin
 
 
  -Original Message-
  From: Jose Borquez [mailto:[EMAIL PROTECTED] 
  Sent: Monday, December 19, 2005 2:13 PM
  To: PHP Questions Lists
  Subject: [PHP] PHP errors in Apache error logs
  
  I am attempting to configure Group Office which is a Project 
  Management 
  suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, 
  MySQL 5.0.16, 
  PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the 
 following error 
  messages in my error logs when I attempt to open a php page:
  
  [Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to 
  undefined 
  function
  session_save_path() in 
  /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
  php on line 792
  /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
  Fatal error
  - Call to undefined function session_save_path()
  
  Could someone please give me any ideas as to what the problem 
  is?  Any 
  help would be greatly appreciated.
  
  Thanks in advance,
  Jose
  
  -- 
  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: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Jose Borquez

John Nichel wrote:


Jose Borquez wrote:

I am attempting to configure Group Office which is a Project 
Management suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, 
MySQL 5.0.16, PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the 
following error messages in my error logs when I attempt to open a 
php page:


[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to 
undefined function
session_save_path() in 
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.

php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
Fatal error

- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is?  
Any help would be greatly appreciated.



How is your version of PHP configured?  Was --disable-session set?

Setup a phpinfo page, and you'll be able to see the configuration 
line, and whether or not sessions are enabled.


I installed PHP from the ports and did not do any configuration.  I set 
up the phpinfo page and the configuration line did not set disable session.


Thanks in advance,
Jose

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



Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jose Borquez wrote:
 I installed PHP from the ports and did not do any configuration.  I set
 up the phpinfo page and the configuration line did not set disable session.
 
 Thanks in advance,
 Jose
 

Maybe you have this:
'--disable-all'
(not sure, thou, this should enable sessions anyway, IIRC...)

Maybe you could point us to your phpinfo(), it sure would help.

Cheers
Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



[PHP] Re: [Bulk] Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Jose Borquez

Silvio Porcellana [tradeOver] wrote:


Jose Borquez wrote:
 


I installed PHP from the ports and did not do any configuration.  I set
up the phpinfo page and the configuration line did not set disable session.

Thanks in advance,
Jose

   



Maybe you have this:
'--disable-all'
(not sure, thou, this should enable sessions anyway, IIRC...)

Maybe you could point us to your phpinfo(), it sure would help.

Cheers
Silvio

 

The Makefile configuration did have --disable-all included.  Here is 
the link to my phpinfo page;

http://68.127.38.82/install/test.php

Thanks in advance,
Jose


Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread John Nichel

Jose Borquez wrote:
snip
The Makefile configuration did have --disable-all included.  Here is 
the link to my phpinfo page;

http://68.127.38.82/install/test.php


You have no session support.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Pblm with streaming ..

2005-12-19 Thread ganu

Hello,

I hv attatched a 33 mb .mpeg file a small clip in my project, but when I 
click it download the whole file then open/play.


I want like, in some site I have seen the buffering/streaming, that it 
will show some play for 1-2 min and again buffer something and again 
so user does'nt hv to wait for the full time.


any idea how to do? I am not getting any idea/starting how to do it ...

need help..

~ 10nx...
~ ganu...

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



[PHP] MySQL - PHP's configure failed with error

2005-12-19 Thread Scott Fletcher
I don't know what is the problem.  I'm using the GNU GCC and GNU Biutils.

--snip--
./configure --with-mysqli=../../mysql/bin/mysql_config --with-apxs2=../../ap
ache2/bin/apxs --with-unixODBC --with-openssl --with-curl --disable-libxml -
-disable-dom --enable-track-vars --enable-ftp --enable-sockets
--snip--

--snip--
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for msession support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... no
checking for specified location of the MySQL UNIX socket... no
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check
config.log for more information.
--snip--

config.log result...
--snip--
configure:53543: checking for mcrypt support
configure:54372: checking for mhash support
configure:54844: checking whether to include mime_magic support
configure:55199: checking for MING support
configure:56122: checking for msession support
configure:56830: checking for mSQL support
configure:57339: checking for MSSQL support via FreeTDS
configure:57987: checking for MySQL support
configure:58033: checking for specified location of the MySQL UNIX socket
configure:59186: checking for MySQLi support
configure:59232: checking whether to enable embedded MySQLi support
configure:59378: checking for mysql_set_server_option in -lmysqlclient
configure:59397: gcc -o
onftest -g -O2  -L/usr/local/src/php-5.1.1/../../mysql/lib -L/usr/local/src/
php-5.1.1/../../mysql/lib  -L/usr/local/ssl/lib -L/usr/local/ssl/lib -L/usr/
local/lib -L/usr/local/lib -lmysqlclient -lz -lcrypt -lnsl_r -lm
conftest.c -lmysqlclient  -liconv -lssl -lcrypto -lcurl -lssl -lcrypto -lm  
-lcurl -lssl -lcrypto 15
ld: 0711-317 ERROR: Undefined symbol: .mysql_set_server_option
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status
configure: failed program was:
#line 59386 configure
#include confdefs.h
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply.  */
char mysql_set_server_option();

int main() {
mysql_set_server_option()
; return 0; }
--snip--

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



[PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Jose Borquez

John Nichel wrote:


Jose Borquez wrote:
snip

The Makefile configuration did have --disable-all included.  Here 
is the link to my phpinfo page;

http://68.127.38.82/install/test.php



You have no session support.

I am not sure what to do now.  Do I need to uninstall and reinstall it 
with session support?  What is the configuration I need to specify?


Thanks in advance,
Jose

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



Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread John Nichel

Jose Borquez wrote:

John Nichel wrote:


Jose Borquez wrote:
snip

The Makefile configuration did have --disable-all included.  Here 
is the link to my phpinfo page;

http://68.127.38.82/install/test.php




You have no session support.

I am not sure what to do now.  Do I need to uninstall and reinstall it 
with session support?  What is the configuration I need to specify?


Check with your OS.  They _might_ have a package (port) you need to 
install.  Probably named something like php-session


Or...

./config
make
make install ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Passing $_POST values to a php script

2005-12-19 Thread Sumit Chachra

hi,

I am trying to develop a testing framework for a bunch of php scripts. These 
files expect various kinds of data from the $_POST array. They work fine 
when invoked from the browser.


But I am wondering if I can programmatically pass these values so that I can 
stress test them in a systematic manner.


thanks!
Sumit.

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



RE: [PHP] Passing $_POST values to a php script

2005-12-19 Thread Jay Blanchard
[snip]
I am trying to develop a testing framework for a bunch of php scripts. These

files expect various kinds of data from the $_POST array. They work fine 
when invoked from the browser.

But I am wondering if I can programmatically pass these values so that I can

stress test them in a systematic manner.
[/snip]

You will probably want to use http://www.php.net/curl

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



[PHP] Earlier versions hurt PHP 5

2005-12-19 Thread PHPDiscuss - PHP Newsgroups and mailing lists


As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.

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



Re: [PHP] Passing $_POST values to a php script

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jay Blanchard wrote:
 [snip]
 I am trying to develop a testing framework for a bunch of php scripts. These
 
 files expect various kinds of data from the $_POST array. They work fine 
 when invoked from the browser.
 
 But I am wondering if I can programmatically pass these values so that I can
 
 stress test them in a systematic manner.
 [/snip]
 
 You will probably want to use http://www.php.net/curl
 
You can also try the Apache benchmarking tool - ab
[http://httpd.apache.org/docs/2.0/programs/ab.html]

It can also do POST request (check the -p option)
quote from=http://httpd.apache.org/docs/1.3/programs/ab.html
-p POST file
A file containing data  that  the  program  will send  to  the
Apache  server  in  any HTTP POST requests. The contents of the
file  should  look like  name=valuesomething=other,  with
special characters URL encoded.
/quote

HTH, cheers

Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



RE: [PHP] Earlier versions hurt PHP 5

2005-12-19 Thread Jay Blanchard
[snip]
As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.
[/snip]

OK.


Merry Christmas.

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



Re: [PHP] Earlier versions hurt PHP 5

2005-12-19 Thread Warren Vail
Not sure where you are looking for web hosting companies, but my experience 
is that most hosting companies that offer Linux and Apache, love it, even 
back in the more stable PHP4 platform.  It has a small footprint, 
especially when the same server hosts many domains with many web 
applications and when coupled with MySQL which most are, it screams speed, 
with a very robust collection of functions and internet connectivity 
capability.


I think you might want to check your figures on what most web hosting 
companies offer.  I had a conversation with my host provider on this very 
subject and they are reporting week demand for php5, even though they 
expect that to change.


Warren Vail

Be careful when throwing out the bath water, there could still be a very 
valuable baby in it.  Many PHP open source applications like PHP-Nuke and, 
I believe, Sugar CRM, just to name a few, are remaining on PHP4, at least 
for a while longer.


At 12:34 PM 12/19/2005, PHPDiscuss - PHP Newsgroups and mailing lists wrote:



As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.

--
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] Earlier versions hurt PHP 5

2005-12-19 Thread Greg Donald
On 12/19/05, PHPDiscuss - PHP Newsgroups and mailing lists
[EMAIL PROTECTED] wrote:
 As a developer, I would love to use PHP 5+ for applications but I am
 afraid to do so because 90% of web hosting companies do not offer it. The
 biggest reason that that they do not offer it is because there is little
 demand for it. The reason why there is little demand for it is that
 developers do not use it because webhosts do not support it. A classic
 catch 22 situation!

I fail to see what this has to do with a 1961 novel.  Do you mean
chicken-egg perhaps?  There's nothing keeping _you_ from using one of
those 10% who are supporting PHP5.  If you aren't part of the
solution..

 I think that continuing to offer prominent download links for PHP 4
 versions on the same page as download links for php 5 on the php.net and
 Zend sites is a major contributor to this problem.

Doubtful.  I gotta think most people who use PHP do not install it
themselves.  Those who do install it themselves are probably smart
enough to find the older versions no matter where you hide them on the
site.

 To get PHP 5 accepted,
 links to download earlier versions should be hidden away in some obsure
 area.

PHP4 does what most people need it to do.  No reason to upgrade.  You
can't really fix that since there's nothing broken.

What is in PHP5 that you _need_ exactly?  If it's OO then there are
much, much better places to get your OO fix.  Not to mention I have
never once had a client ask for PHP specifically, much less PHP5.  I
use PHP 5 because I want to stay current with my skills, not because I
need language functionality that's missing in PHP4.  Same with Apache
2, PostgreSQL 8, and MySQL 5.


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



[PHP] Invalid argument supplied for foreach()

2005-12-19 Thread Jose Borquez

I am getting the following errors when accessing a php page:

/usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299) 
: Warni

ng - Invalid argument supplied for foreach()
[Mon Dec 19 15:10:52 2005] [error] PHP Warning:  Invalid argument 
supplied for f
oreach() in 
/usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php

on line 299

I solved previous php error problem by installing the php5-extensions, 
but now I am getting the following errors in my log files and I have no 
idea what it could be.  Any help would be greatly appreciated.


Thanks in advance,
Jose

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



[PHP] http curl to https is that a secure connection?

2005-12-19 Thread Mark Steudel
I was curious, if have a page at http and it initiates a curl session to a
https, is the information sent secure or open because the the curl session
is from a unecrypted page?
 
Mark


Re: [PHP] Pblm with streaming ..

2005-12-19 Thread Michael Hulse

On Dec 19, 2005, at 12:10 PM, ganu wrote:
... any idea how to do? I am not getting any idea/starting how to do 
it ...


Use Flash 8.

It will convert to .FLV format. Easy as cake.

Choose to make the file external. Then you can use Progressive 
download/play.


With Flash 8 it is really easy to create a kick-butt vid player. Check 
out http://video.google.com/ for example.


You can download the Flash 8 and use the free 30 day trial.

Another option would be real player... Some would say it is best to 
offer many different formats for your users to choose from.


Flash is my fav though.

Hth,
Cheers,
Micky

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



[PHP] Re: Invalid argument supplied for foreach()

2005-12-19 Thread David Robley
Jose Borquez wrote:

 I am getting the following errors when accessing a php page:
 
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299)
 : Warni
 ng - Invalid argument supplied for foreach()
 [Mon Dec 19 15:10:52 2005] [error] PHP Warning:  Invalid argument
 supplied for f
 oreach() in
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
 on line 299
 
 I solved previous php error problem by installing the php5-extensions,
 but now I am getting the following errors in my log files and I have no
 idea what it could be.  Any help would be greatly appreciated.
 
 Thanks in advance,
 Jose

foreach expects to have an array passed as its argument; the error message
suggests that what it is receiving is not an array. Without seeing your
code, the only suggestion we could make (well, me anyway) is to check what
is actually being passed, with print_r or var_dump.



Cheers
-- 
David Robley

Support bacteria - it's the only culture some people have!

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



RE: [PHP] Re: Invalid argument supplied for foreach()

2005-12-19 Thread Mark Steudel
Something that I use to make sure I don't give the user a nicer error

If ( is_array( $array ) )
{
foreach ( $array as $key = $value )
{
echo 
}
}
Else
{
exit('Expecting array')
} 

-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 19, 2005 5:21 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Invalid argument supplied for foreach()

Jose Borquez wrote:

 I am getting the following errors when accessing a php page:
 
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(29
 9)
 : Warni
 ng - Invalid argument supplied for foreach() [Mon Dec 19 15:10:52 
 2005] [error] PHP Warning:  Invalid argument supplied for f
 oreach() in
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
 on line 299
 
 I solved previous php error problem by installing the php5-extensions, 
 but now I am getting the following errors in my log files and I have 
 no idea what it could be.  Any help would be greatly appreciated.
 
 Thanks in advance,
 Jose

foreach expects to have an array passed as its argument; the error message
suggests that what it is receiving is not an array. Without seeing your
code, the only suggestion we could make (well, me anyway) is to check what
is actually being passed, with print_r or var_dump.



Cheers
--
David Robley

Support bacteria - it's the only culture some people have!

--
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] Access Headers Submitted by Browser

2005-12-19 Thread Michael B Allen
I want to read headers submitted by the client. Are these available
through some global array somewhere?

Thanks,
Mike

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



Re: [PHP] Access Headers Submitted by Browser

2005-12-19 Thread Curt Zirzow
On Mon, Dec 19, 2005 at 11:28:07PM -0500, Michael B Allen wrote:
 I want to read headers submitted by the client. Are these available
 through some global array somewhere?

You will notice all the  HTTP_* values in:
  var_dump($_SERVER);

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] http curl to https is that a secure connection?

2005-12-19 Thread Curt Zirzow
On Mon, Dec 19, 2005 at 04:01:34PM -0800, Mark Steudel wrote:
 I was curious, if have a page at http and it initiates a curl session to a
 https, is the information sent secure or open because the the curl session
 is from a unecrypted page?

The data sent back and forth to the curl session will be secure,
the data between the client and the script that calls curl will be
insecure.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] MySQL - PHP's configure failed with error

2005-12-19 Thread Curt Zirzow
On Mon, Dec 19, 2005 at 02:56:37PM -0500, Scott Fletcher wrote:
 I don't know what is the problem.  I'm using the GNU GCC and GNU Biutils.
 
 --snip--
 ./configure --with-mysqli=../../mysql/bin/mysql_config --with-apxs2=../../ap
 ache2/bin/apxs --with-unixODBC --with-openssl --with-curl --disable-libxml -
 -disable-dom --enable-track-vars --enable-ftp --enable-sockets
 --snip--
 
 --snip--
 checking for mcrypt support... no
 checking for mhash support... no
 checking whether to include mime_magic support... no
 checking for MING support... no
 checking for msession support... no
 checking for mSQL support... no
 checking for MSSQL support via FreeTDS... no
 checking for MySQL support... no
 checking for specified location of the MySQL UNIX socket... no
 checking for MySQLi support... yes
 checking whether to enable embedded MySQLi support... no
 checking for mysql_set_server_option in -lmysqlclient... no
 configure: error: wrong mysql library version or lib not found. Check
 config.log for more information.
 --snip--

What version of mysql is in the mysql directory? mysqli requires
4.1 or greater.

Curt.
-- 
cat .signature: No such file or directory

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



[PHP] pspell dictionary issue

2005-12-19 Thread Adi
I am having a problem switching dictionaries from 'american', 'british' and
'canadian' English in pspell. Pspell seems to test everything against the
american dictionary for some reason. I tested aspell on command line and
worked fine if I supplied the dictionary I wanted to use with the –d option.
Below is some basic code I used to test this in php:



?php

$string = color;



$pspell_link = pspell_new(en, canadian);



if (!pspell_check($pspell_link, $string)) {

   $suggestions = pspell_suggest($pspell_link, $string);



   foreach ($suggestions as $suggestion) {

   echo Possible spelling: $suggestionbr /;

   }

} else {

   echo All good;

}

?



The output was All good instead of a list of suggestions. Also, when I
tested the string colour with pspell_new(en, american); pspell
accepted the spelling…aspell on the other hand worked as expected in shell.



Any suggestions would be much appreciated.


Re: [PHP] Random Images with no duplicates?

2005-12-19 Thread Mike
I'd just like to thank everyone who helped me our with this. I think it's 
great that so many people would be so helpful and not expect anything in 
return. This list is quite a storehouse of info and I'm learning just from 
reading the posts since I joined last week!

Again, thanks all.

-Mike


Kilbride, James [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Actually with this idea all you do is reduce $max after each successful
pull and 'increment' over pictures you already have. That way you never
have to pull another random number. You just may have to increment
through the entire set of pulled images if you pulled a high enough
number.

for($i = 0; $i  $want; $i++) {
$random = mt_rand(0,$max);
for($j = 0; $j  $i; $j++) {
if ($retrieved[$j]  $random) {
$random++;
}
}
$retrieved[] = $random;
sort($retrieved);
$max--;
}

Guarentees unique choices.



  I'm still very green with PHP, but am working to fix that.
 
  I've searched high and low for an answer to this question
 and so far
  no solution has presented itself. I have a script to
 populate my web
  page with random images:
 
  ?php
  #random images example
  #this is your file
  $file = images.txt;
  #open the file
  $openFile = file($file);
  #generate a random number
  srand((double)microtime()*100);
  #get one of the entries in the file
  $random_image = $openFile[array_rand($openFile)]; #display
 the entry
  echo img src='$random_image' height='170' width='100'/img; ?
 
 
  This works beautifully, but my problem is that sometimes,
 the same image
  displays twice or more on the same page-load. My page
 requires 10 different
  places where my images need to load, but I can't have any
 duplicate images
  show up. 

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



[PHP] ID--how to keep them in order

2005-12-19 Thread Anasta
I have a script which outputs a movie title, rating and the ID number 
(below).
The ID number is also used in the admin section as a select for update and 
delete.

The problem i have is that as i delete certain entries then the number 
sequence on the display page has missing numbers--is there a way to move all 
rows down to the next number in the mysql DB so the ID remains there.
The easiest way is to not display the ID in the first place i am guessing, 
but it would be good to know if there is another way.



There are 16 DVDs titles.
  2 Monster in Law PG
  3 Pulp Fiction MA
  4 Bambi G
  5 Shrek PG
  6 Madagascar G
  7 Grease II PG
  8 Star Wars M
  9 Harry Potter-Askaban PG
  10 Lilo  Stitch G
  11 Garfield G
  13 Saw I MA
  14 Saw II MA
  15 Longest Yard R
  16 Robots PG
  17 Bewitched PG
  20 Team America PG

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



Re: [PHP] Invalid argument supplied for foreach()

2005-12-19 Thread Curt Zirzow
On Mon, Dec 19, 2005 at 03:48:53PM -0800, Jose Borquez wrote:
 I am getting the following errors when accessing a php page:
 
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299) 
 : Warni
 ng - Invalid argument supplied for foreach()
 [Mon Dec 19 15:10:52 2005] [error] PHP Warning:  Invalid argument 
 supplied for f
 oreach() in 
 /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
 on line 299

I would strongly suggest you seek the forum they have, You're odds
of someone actually using groupoffice there is a lot more likely
than here.


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] ID--how to keep them in order

2005-12-19 Thread Curt Zirzow
On Tue, Dec 20, 2005 at 02:12:43PM +0800, Anasta wrote:
 I have a script which outputs a movie title, rating and the ID number 
 (below).
 The ID number is also used in the admin section as a select for update and 
 delete.
 
 The problem i have is that as i delete certain entries then the number 
 sequence on the display page has missing numbers--is there a way to move all 
 rows down to the next number in the mysql DB so the ID remains there.
 The easiest way is to not display the ID in the first place i am guessing, 
 but it would be good to know if there is another way.
 
 There are 16 DVDs titles.
   2 Monster in Law PG
   3 Pulp Fiction MA

This is more of a db design issue, what your are looking at is the
issue with:

  surrogate key vs. natural key


Curt.
-- 
cat .signature: No such file or directory

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