Re: [PHP] PHP 5

2003-02-17 Thread Stephan Seidt
Hi,

Well, something very important in php5 is ZendEngine2:
http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES

bye

Adrian Portsmouth wrote:

Hi,

I have been checking out the books on Amazon.com and it seems there is a
PHP5 book in the works due to be released on March the 4th. Does anyone
know where I can find out information about this new release of PHP,
what changes there are etc?

TIA

Adrian

www.phpscriptsearch.com




--
if (!$TCPA-connect()) {
throw new Exception('Sorry, no coffe today', EX_FATAL);
}


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




Re: [PHP] pause_script($int)??

2003-02-01 Thread Stephan Seidt
what about sleep() ?

OjMyStEr wrote:

Hi,
Does anyone know if there is a way for me to produce a function in PHP to
pause the processing of the script for 3 seconds for example without eating
up the CPU bandwidth. I could do with quite accurate control. Is there a
better way that doing it like this:

?php

function pause_script($int){
 $start_time = time();
 while(time() = ($start_time+$int)){
// No functions take place inside the loop!
 }
}

echo The current time is  . time() . \n;
pause_script(10);
echo The current time is  . time() . \n;

?

The output is:
The current time is 1044105730
The current time is 1044105741

There is obviously an 11 second difference is the time that the two seperate
lines were printed.
Thing is, when I run this script the CPU usage goes to 100%

Anyone got any ideas?

Thanx

Josh







--
IPv6 + TCPA + wrecked Palladium server = NO COFFE!


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




Re: [PHP] Can't get HTTPS -- driving me mad -- please help

2003-01-21 Thread Stephan Seidt
Is fopen_wrapper in php.ini set to yes ?

Jonathan Boles wrote:

PHP 4.3.0, Apache, Win32.

I'm driving myself mad trying to work out why I can't get HTTPS pages. I
understand there are two options, using fopen() with openssl installed, and
using curl. I've installed openssl extension, but using fopen STILL won't
work. Don't have a clue why. Using curl, I can get the page easily enough,
but I can't put it into the file. If I try to set a file resource to save it
to, Apache crashes.

Here's the error message I get using fopen(https://[securewebsite];, r);

Warning: fopen(https://blahblahblah) [function.fopen]: failed to create
stream: No such file or directory in blah\blah\blah.php on line 50



And when I try to use Curl to save the https file, I get this:

APACHE caused an invalid page fault in
module KERNEL32.DLL at 0187:bff7b9a6.
Registers:
EAX= CS=0187 EIP=bff7b9a6 EFLGS=0246
EBX=02af796c SS=018f ESP=0167f398 EBP=0167f3b0
ECX=00fe6770 DS=018f ESI=7803b730 FS=19a7
EDX=7803b710 ES=018f EDI=100be740 GS=
Bytes at CS:EIP:
ff 76 04 e8 13 89 ff ff 5e c2 04 00 56 8b 74 24
Stack dump:
0032 00fd5131 7803b730 00fd523b 7803b710 0032 0001 00fc1ee8
00ff48ac 0001 0032 7803b710 0032 00ff4240 00ff48ac 00ff4801


Here is the code I'm using at that section:

 $ch = curl_init (https://blahblahblah;);
 $fp = fopen (output.txt, w);
 curl_setopt ($ch, CURLOPT_FILE, $fp);
 curl_setopt ($ch, CURLOPT_HEADER, 0);
 curl_exec ($ch);
 $ce = curl_error($ch);
 curl_close ($ch);
 fclose ($fp);



This is really driving me mad, someone please help :-(








--
IPv6 + TCPA + wrecked Palladium server = NO COFFE!


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




Re: [PHP] security question regarding including files..

2003-01-21 Thread Stephan Seidt
I guess you use some webserver, let's take apache.
Apache's mime.conf has set several extensions,
also php extensions. So only .php, .php3, .php4
 files will be parsed by php.

Chad Day wrote:

I want to give my users the ability to submit a URL to a database, then when
they pull up their page, their photo is included .. what I'm worried about
is them pointing the link to some malicious code or something..

Obviously I can validate the file extension (.gif or .jpg) .. and I'm going
to force the files to be stored offsite -  they dont get to upload anything
to the server.  I'm just a bit paranoid about this, so I'm hoping someone
more security-minded can tell me what to watch out for, what to check, if
I'm missing anything..

Thanks,
Chad





--
IPv6 + TCPA + wrecked Palladium server = NO COFFE!


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




Re: [PHP] Can't get HTTPS -- driving me mad -- please help

2003-01-21 Thread Stephan Seidt
ah sorry, mixed some configuration files ;)

Jonathan Boles wrote:

Do you mean allow_url_fopen? It is set to 'on'. There's no fopen_wrapper
setting

Reading from http:// using fopen works fine. It's the https:// that doesn't
work.

- Original Message -
From: Stephan Seidt [EMAIL PROTECTED]
To: Jonathan Boles [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 3:02 AM
Subject: Re: [PHP] Can't get HTTPS -- driving me mad -- please help




Is fopen_wrapper in php.ini set to yes ?

Jonathan Boles wrote:


PHP 4.3.0, Apache, Win32.

I'm driving myself mad trying to work out why I can't get HTTPS pages. I
understand there are two options, using fopen() with openssl installed,


and


using curl. I've installed openssl extension, but using fopen STILL


won't


work. Don't have a clue why. Using curl, I can get the page easily


enough,


but I can't put it into the file. If I try to set a file resource to


save it


to, Apache crashes.

Here's the error message I get using fopen(https://[securewebsite];,


r);


Warning: fopen(https://blahblahblah) [function.fopen]: failed to create
stream: No such file or directory in blah\blah\blah.php on line 50



And when I try to use Curl to save the https file, I get this:

APACHE caused an invalid page fault in
module KERNEL32.DLL at 0187:bff7b9a6.
Registers:
EAX= CS=0187 EIP=bff7b9a6 EFLGS=0246
EBX=02af796c SS=018f ESP=0167f398 EBP=0167f3b0
ECX=00fe6770 DS=018f ESI=7803b730 FS=19a7
EDX=7803b710 ES=018f EDI=100be740 GS=
Bytes at CS:EIP:
ff 76 04 e8 13 89 ff ff 5e c2 04 00 56 8b 74 24
Stack dump:
0032 00fd5131 7803b730 00fd523b 7803b710 0032 0001 00fc1ee8
00ff48ac 0001 0032 7803b710 0032 00ff4240 00ff48ac 00ff4801


Here is the code I'm using at that section:

$ch = curl_init (https://blahblahblah;);
$fp = fopen (output.txt, w);
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
$ce = curl_error($ch);
curl_close ($ch);
fclose ($fp);



This is really driving me mad, someone please help :-(








--
IPv6 + TCPA + wrecked Palladium server = NO COFFE!









--
IPv6 + TCPA + wrecked Palladium server = NO COFFE!


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




Re: [PHP] Text editors

2003-01-07 Thread Stephan Seidt
You wanted advert ;p www.weaverslave.de , has also a good english 
translation and many other languages.

Karl James wrote:
Hello guys,
Right now im using dreamweaver mx 
 
I was wondering if anyone knew of any good free text editors that has
line counts
And is good for php….
 
Thanks 
karl

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
 



--
When ipv6 and tcpa are there.. When this Palladium server wrecks..
I won't be able to drink my coffe then!


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




Re: [PHP] problems adjusting size of permissable file upload

2003-01-06 Thread Stephan Seidt
http://www.php.net/phpversion

Kenn Murrah wrote:

Greetings.

My code to upload file is working fine with very small files but not with
larger ones 

Here's what I've tried so far:

1.  I've edited my php.ini file to read: upload_max_filesize = 100M

2.  I've the following line to my html file:
input type=hidden name=MAX_FILE_SIZE value=1 

when i try to upload a file of about 5 megs, it's fine ... if i try about 8
megs, it isn't ...

Can anyone tell me what I'm doing wrong?

p.s. ... how do i determine what version of PHP is running on my server?

Thanks,







--
When ipv6 and tcpa are there.. When this Palladium server wrecks..
I won't be able to drink my coffe then!


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




Re: [PHP] include directory?

2003-01-06 Thread Stephan Seidt
That depends on where you want to point it at :)
In pear we always use something like :
require_once 'Package/File.php'
It's very usable to add the pear directory to php's
include path, but only if you have it ;)
Otherwhise, just don't think about that setting.

Rad Craig wrote:

Where should this point to?  Mine points to c:\php4\pear and I dont' have a
pear directory under \php4.



Rad Craig






--
When ipv6 and tcpa are there.. When this Palladium server wrecks..
I won't be able to drink my coffe then!


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




Re: [PHP] time stamp screwing up

2003-01-06 Thread Stephan Seidt
What sort of mysql field type did you use for dateAdded ?
You need UNIX_TIMESTAMP (or sth like that) for unix timestamp format.

- [ Paul Ferrie ] - wrote:

hey guys could someone help me
I have created a user login register system in  flash with PHP and Mysql.
Everthing Now works fine aprt from the time stamp of when the user
registered.

Code ---
// Get current date  time
$time = time();
// Connects to the Database.
$Connect = mysql_connect($dbServer, $dbUser, $dbPass);
mysql_select_db($dbName);
// Preforms the SQL query to see if user name already exsists
$query = SELECT name FROM contacts WHERE name='$name';
$rs_contacts = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($rs_contacts);
if ($row[name] == $name) {
print loginT=UserName in Usechecklog=2;
}else{
$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
(NULL, '$name', '$pass', '$email', '$time');
}


It inserts -00-00
instead of the current date

ideas

P.S
I am a newbie try keeping reponse's simple please






--
When ipv6 and tcpa are there.. When this Palladium server wrecks..
I won't be able to drink my coffe then!


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




Re: [PHP] time stamp screwing up

2003-01-06 Thread Stephan Seidt
yep i guess that, so NOW() is a mysql function.

- [ Paul Ferrie ] - wrote:

So Jason what your saying is this

$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES


(NULL, '$name', '$pass', '$email', '$time');


Should be

$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES


(NULL, '$name', '$pass', '$email', NOW());



??
cheers


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


On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote:


hey guys could someone help me
I have created a user login register system in  flash with PHP and


Mysql.


Everthing Now works fine aprt from the time stamp of when the user
registered.

Code ---
// Get current date  time
$time = time();
// Connects to the Database.
$Connect = mysql_connect($dbServer, $dbUser, $dbPass);
mysql_select_db($dbName);
// Preforms the SQL query to see if user name already exsists
$query = SELECT name FROM contacts WHERE name='$name';
$rs_contacts = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($rs_contacts);
if ($row[name] == $name) {
print loginT=UserName in Usechecklog=2;
}else{
$query = INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
(NULL, '$name', '$pass', '$email', '$time');
}


It inserts -00-00
instead of the current date


What column type is dateAdded? If it's a mysql DATE type then you should

replace:

 '$time'

with

 NOW()

--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
It's more than magnificent -- it's mediocre.
-- Sam Goldwyn
*/









--
When ipv6 and tcpa are there.. When this Palladium server wrecks..
I won't be able to drink my coffe then!


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




Re: [PHP] Re: include/require vs performance

2003-01-03 Thread Stephan Seidt
I guess that PHP will close file 1 before it opens
file 2 and so on.. For example :

include 'foo';
include 'bar';

When bar is being opened foo is already closed.

Leon Mergen wrote:

Radek Zajkowski [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]...


Is there, was there ever issue around including a lot files via
include(). I am running things on a local server so it's hard to gauge.



I think that the only source that could cause any problems with too many
files included will be your operating system (since that thing has certain
limitations on a max number of locked files for example) . Other than that,
I don't think so. I myself include about 15 files on certain pages. But it
is easy to make a test or anything...

Just make a PHP script that generates like 1000 php scripts called
include.test.x.php , where x is is a number, then the contents of those
scripts should by ? include(include.test. . (x+1) . .php);? or
something like that...

Then you are for sure, and you immediately also know how much performance is
lost for including 1000 files :)






--
I won't pay Bills'


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




Re: [PHP] Re: include/require vs performance

2003-01-03 Thread Stephan Seidt
well ok, if it's :

main.php :
include 'foo';

foo :
include 'bar';

bar :
include 'whatever';

...

there will be lots of used file descriptors at once

Leon Mergen wrote:

Stephan Seidt [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


I guess that PHP will close file 1 before it opens
file 2 and so on.. For example :

include 'foo';
include 'bar';

When bar is being opened foo is already closed.



Hmmm, i think the parser is built recursive, so at the moment it sees an
include 'foo'; , it will look in foo, parse that one, and after it has
finished foo, it will continue with the main script...






--
I won't pay Bills'


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




[PHP] Connecting binary php together

2002-12-03 Thread Stephan Seidt
Hi

I'm thinking about the best way to connect a c(++)
binary with the php interpreter. I thought the best
solution is to use a shared library which has been
built by php. Is libphp4.so always the same or are
the libraries for apache / apache2 / roxen / etc
different ? I think the parameter --with-apxs
or whatever is just given so that php knows
what it has to do, right ?

-- 
I won't pay Bill's

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




Re: [PHP] Re: Connecting binary php together

2002-12-03 Thread Stephan Seidt
Ok, I will see what --with-embed is going to show me ;)

On Tue, 03 Dec 2002 11:41:19 -0500
J Smith [EMAIL PROTECTED] wrote:

 
 Not exactly sure what you mean here. Do you mean you'd like to get a C or 
 C++ library to work inside PHP, or get PHP to work inside of a C or C++ 
 app/library?
 
 If it's the former, then you want to build an extension to PHP. There are 
 lots of examples in the ext directory.
 
 If it's the latter, then look at sapi/embed, which lets you cram the PHP 
 interpreter into any sort of application or library. It's still 
 experimental, but it's a step in the right direction.
 
 J
 
 
 Stephan Seidt wrote:
 
  Hi
  
  I'm thinking about the best way to connect a c(++)
  binary with the php interpreter. I thought the best
  solution is to use a shared library which has been
  built by php. Is libphp4.so always the same or are
  the libraries for apache / apache2 / roxen / etc
  different ? I think the parameter --with-apxs
  or whatever is just given so that php knows
  what it has to do, right ?
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
I won't pay Bill's

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




[PHP] Re: sockets (again)

2002-11-25 Thread Stephan Seidt
Hi,

You have to choose a protocol for AF_INET sockets.
Try getprotobyname() with tcp and udp to get one.

bye

On Mon, 25 Nov 2002 10:24:46 -0800
[EMAIL PROTECTED] (Gareth Thomas) wrote:

 Hi,
 
 I really need some help here because I am going to lose my mind otherwise!!
 A script that was running fine Friday has decided not to work for no
 apparent reason today. The problem seems to be with a socket_create that
 just stops the script, so I created a simple test script as shown below to
 see what happens. When I run this is simply drops out at the socket_create,
 no error message, nothing. Again this worked fine Friday and nothing has
 changed on my machine. I am running 4.2.3 on Win2K... any ideas? Help!!
 
 
 G.
 
 $zone = 192.168.0.60;
 $port = 1;
 $command = play;
 
 echo('here');
 
 $slip_socket = socket_create (AF_INET, SOCK_STREAM, 0);
 
 echo('here 2');
 
 if ($slip_socket  0) {
echo socket_create() failed: reason:  . socket_strerror ($slip_socket)
 . \n;
 } else {
$result = socket_connect ($slip_socket, $zone, $port);
if ($result  0) {
   echo socket_connect() failed.\nReason: ($result)  .
 socket_strerror($result) . \n;
}
 }
 
 $command=$command.\n;
 echo('Sending command: '.$command.' for '.$zone.'\n');
 socket_write ($slip_socket, $command, strlen ($command));
 
 
 

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




[PHP] Re: How do I Install PHP on Apache 2.0?

2002-11-24 Thread Stephan Seidt
Hi,

You must build a shared library by configuring php with --with-apxs2.

On Sun, 24 Nov 2002 09:42:40 -0500
[EMAIL PROTECTED] (Tweak2x) wrote:

 can somebody please help me? I cant figure it out.
 
 

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




[PHP] Re: How do I Install PHP on Apache 2.0?

2002-11-24 Thread Stephan Seidt
windows, unix ?


On Sun, 24 Nov 2002 10:26:21 -0500
[EMAIL PROTECTED] (Tweak2x) wrote:

 how do i do that?
 
 Stephan Seidt [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  You must build a shared library by configuring php with --with-apxs2.
 
  On Sun, 24 Nov 2002 09:42:40 -0500
  [EMAIL PROTECTED] (Tweak2x) wrote:
 
   can somebody please help me? I cant figure it out.
  
  
 
 

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




[PHP] Re: php and caching

2002-11-24 Thread Stephan Seidt
Maybe Pear's Cache class could help you..
But I'm not sure, never played around with it in detail.

On Sun, 24 Nov 2002 12:47:08 -0500
[EMAIL PROTECTED] (Alex) wrote:

 Hi,
 
 I have a few pages on my site that contains dynamical content that must be
 processed each time the page is loaded. But I'd also want to allow the
 users to be able to use the back button of their browser to go back to forms
 and that these forms still contain the information they entered (instead of
 being cleared).
 
 Can someone give me a hint on how to accomplish this if there's a way to do
 it?
 
 Thanks,
 
 Alexandre Soares
 
 

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




[PHP] Re: Passing Variables

2002-11-23 Thread Stephan Seidt
if you mean something like bla.php?foo=bar, etc and you have register_globas enabled
it'll be stored as $_GET['foo'] ($_REQUEST['foo'])

On Sat, 23 Nov 2002 11:42:49 -0800
[EMAIL PROTECTED] (Craig Edgmon) wrote:

 I am sure this question has been answered, but there is a ton of data to
 sift through on this. I am running Apache 1.3 and the latest PHP 4.2.3. .
 I am just working with variables and I cannot seem to get them to pass from
 my html file to the php call. I will get the html portion fine, but not the
 variable. I have checked my language and have compared my files with
 supposed good code from a reliable source with the same results. Any idea on
 this. It happens on multiple systems.
 
 

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




[PHP] Re: Secureing PHP.

2002-11-23 Thread Stephan Seidt
hi,

you should try to take the php.ini-recommended and edit it a little bit so that it 
fits your needs.
the settings there are very secure but also increase php's performance and coding 
standard.
if some settings won't fit to a single script, you can use ini_set(..., ...).
so you'll have to disable the output_buffer if you need implicit_flush.

and you safe_mode question.. sorry  i never played around with it ;)

bye

On Sun, 24 Nov 2002 17:41:20 +1100
[EMAIL PROTECTED] (Steven Adams) wrote:

 Hi,
 I am looking to secure my php install, like the settings in php.ini etc.
 
 I am using apache 1.3.27 and running latest php.
 
 Is there like a tut or something that can take u thought the php.ini and
 explain ina little more detail?
 
 safe_mode = Off
 
 is that a bad idea or should i leave it on..
 
 /Steve
 

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




[PHP] Re: foreach, side effect or good behaviour?

2002-09-23 Thread Stephan Seidt

It's good behavoiur because everytime even a reference gets a value,
also the target which it is pointing on should get the same value.

On Mon, 23 Sep 2002 12:57:56 +0200 (CEST), [EMAIL PROTECTED] (Jean-Pierre arneodo) 
wrote:

 Hi,
 
 $a=1;
 $b=$a;
 foreach(array(2,3) as $b);
 echo a=$a;
 
 // Print a=3
 
 Is it the behaviour expected
 in a foreach loop?
 
 JP
 
 
 ___
 Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
 Yahoo! Mail : http://fr.mail.yahoo.com

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




[PHP] Re: PHP source code

2002-09-19 Thread Stephan Seidt

On Thu, 19 Sep 2002 16:50:16 +0200
[EMAIL PROTECTED] (Oliver Witt) wrote:

 Hi,
 Is there any way to read php source code? I didn't think so until I
 heard about people you have done that...
 Kind regards,
 Oliver
 

Do you mean the source of php.net ?
Try http://de.php.net/source.php?url=/index.php

If you mean php's source, download it ;)

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




[PHP] Re: Cannot Redeclare Function

2002-09-19 Thread Stephan Seidt

Looks like you may not redeclare functions generally.
Because the function tbl2array can't be any kind of scope,
the functions declared inside it will be globally declared.

I think the solution is to take the functions like compname()
out of tbl2array and declare them really global.

On Thu, 19 Sep 2002 13:28:09 -0230
[EMAIL PROTECTED] (Robert Miller) wrote:

 Hello,
 
 My function to read a comma separated text file and return a sorted 
multi-dimensional array will not work if used more than once per page.
 
 I know why I'm having this problem. But, I don't know how to solve it. :-(
 
 
 
 
 
 Calling it Twice:
 $services = tbl2array (../locations/service.txt, default, $divdetail['id'], 0);
 $collections = tbl2array (../download/collection.txt, name, $divdetail['id'], 
4);
 
 
 The Error:
 Fatal error: Cannot redeclare compname() in ../tbl2array.inc on line 35
 
 
 Function Table 2 Array:
 ?php
 function tbl2array ($table, $sortby = default, $keyword = all, $keyfield = 0) {
 $fpointer = fopen ($table,r);
 $row = 1;
 $leaf = array();
 $heading = array();
 while ($data = fgetcsv ($fpointer,1000)) {
 if ($row == 1) {
 $heading = $data;
 }
 else {
 $count = 0;
 if ($keyword == all) {
 foreach ($data as $value) {
 $leaf[$heading[$count]] = $value;
 $count++;
 }
 $result[] = $leaf;
 }
 elseif (($keyword != all)  ($data[$keyfield] == $keyword)) {
 foreach ($data as $value) {
 $leaf[$heading[$count]] = $value;
 $count++;
 }
 $result[] = $leaf;
 }
 else {
 $count++;
 }
 }
 $row++;
 }
 fclose ($fpointer);
 
 function compname ($a, $b) {
 return strcmp ($a[name], $b[name]);
 }
 
 function comptitle ($a, $b) {
 return strcmp ($a[title], $b[title]);
 }
 
 function compcity ($a, $b) {
 return strcmp ($a[city], $b[city]);
 }
 
 function compdesc ($a, $b) {
 return strcmp ($a[description], $b[description]);
 }
 
 function compfile ($a, $b) {
 return strcmp ($a[filename], $b[filename]);
 }
 
 if ($sortby == name) {
 usort ($result, compname);
 }
 elseif ($sortby == title) {
 usort ($result, comptitle);
 }
 elseif ($sortby == city) {
 usort ($result, compcity);
 }
 elseif ($sortby == description) {
 usort ($result, compdesc);
 }
 elseif ($sortby == filename) {
 usort ($result, compfile);
 }
 
 return $result;
 }
 ?
 
 
 
 --
 Robert J. Miller
 Internet Support Specialist
 Department of Government Services and Lands
 P.O. Box 8700, St. John's, NF., A1B-4J6
 (709) 729-4520 (phone)
 (709) 729-4151 (facsimile)
 (709) 778-8746 (pager)
 
 http://www.gov.nf.ca/gsl/
 mailto:[EMAIL PROTECTED]
 --
 Simple things should be simple and hard things
 should be possible.
 --
 

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




[PHP] Re: File Access...

2002-09-19 Thread Stephan Seidt

I guess it is sth. like :

?php header('Redirect: http://www.domain.com/index.php'); ?

If it doesnt work try www.php.net/header, there is an example.

On Thu, 19 Sep 2002 17:21:15 +0100
[EMAIL PROTECTED] (Brian McGarvie) wrote:

 How could you redirect somone from directly accessing a file...
 
 Meaning... if an engine spiders www.domain.com/some.php
 
 How could you make some.php redirect to index.php
 
 However... the site is framed, and the menu uses content.php to display the
 selected content.
 
 Any ideas?
 
 

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




[PHP] Re: PHP source code

2002-09-19 Thread Stephan Seidt

Then be sure that nobody is able to read it.
Should be no problem ;)
There is no possibility to read php source,
the webserver will always count it as php file
and the file will be parsed by php.

Sure its possible to get the file over ftp, ssh, imap, etc,
but this is the problem with all the secret-file stuff.

bye,
blizz

On Thu, 19 Sep 2002 20:15:06 +0200, [EMAIL PROTECTED] (Oliver Witt) wrote:

 Stephan Seidt schrieb:
 
  On Thu, 19 Sep 2002 16:50:16 +0200
  [EMAIL PROTECTED] (Oliver Witt) wrote:
 
   Hi,
   Is there any way to read php source code? I didn't think so until I
   heard about people you have done that...
   Kind regards,
   Oliver
  
 
  If you mean php's source, download it ;)
 
 Well, but if I write a script with MySQl, there has to be my user name
 and password in the source code. If anybody could read it, anybody could
 have access to my databases!
 Oliver
 
 
 

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