Fwd: Re: Re: [PHP] Re: PHP 4.2

2002-06-24 Thread Dreamriver.com


Rasmus,
Yes, thank you, that's the function I wanted and didn't see ...


Kind Regards,
richard.


> You mean like php.net/version_compare ?
>
> On Mon, 24 Jun 2002, Dreamriver.com wrote:




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




Re: [PHP] Seperating presentation from logic

2002-06-24 Thread René Moonen

You might want to start by looking (download, instal, try) at available 
content managers like
PHPWebSite   http://phpwebsite.appstate.edu/ 
PHPNukehttp://phpnuke.org/

They do exactly that; seperate content from programming logic. As an 
admin you can assign certain users as beining authors. Authors can 
upload contents to the web-server without every having to know anything 
about PHP, webservers or databases. As an admin you can change the look 
and feel of the webpage without having to know much about PHP. It's 
designing a new 'skin' rather than desiging a complete new PHP project.
It might very well be that these content managers do not fit your needs, 
but if you start from scratch they are certainly worth looking into 
before you take off on a large PHP project.

good luck

René

Jean-Christian Imbeault wrote:

> I'm just about to start a large PHP project in which I get to work 
> with professional designers/layout people. I want to separate all the 
> programming logic from the presentation but I am not sure how to do this.
>
> Can anyone point me to resources (web tutorials/articles or books) 
> that would help me figure out how best to separate my programming work 
> from designer's work and how best to integrate them?
>
> Sorry for asking such a generic question but I don't know how to best 
> phrase it. I did look on the web but the best I could find were some 
> mentions of templates. While templates seems ok they don't address all 
> the issues of separation presentation from code (if I understand them 
> correctly).
>
> Thanks!
>
> Jc
>
>


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




RE: [PHP] looping through numbers

2002-06-24 Thread Martin Towell

I think you mean

for ($i = 200; $i <= 250; $i++)
print "$i ";

(:

-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 5:05 PM
To: Php-General
Subject: RE: [PHP] looping through numbers


for ($i = 200; $i <= 200; $i++)
print "$i ";


Niklas


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 25. kesäkuuta 2002 10:05
To: [EMAIL PROTECTED]
Subject: [PHP] looping through numbers


Hello ,

How do I do a loop that will increase a number tell it reaches another
number

I what it to print out every number starting at 200 and ending at 250 so
it would print out 200 201 202 203 204


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




RE: [PHP] looping through numbers

2002-06-24 Thread Niklas Lampén

it should ofcourse be

for ($i = 200; $i <= 250; $i++)
print "$i ";


:)



-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]] 
Sent: 25. kesäkuuta 2002 10:05
To: Php-General
Subject: RE: [PHP] looping through numbers


for ($i = 200; $i <= 200; $i++)
print "$i ";


Niklas


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 25. kesäkuuta 2002 10:05
To: [EMAIL PROTECTED]
Subject: [PHP] looping through numbers


Hello ,

How do I do a loop that will increase a number tell it reaches another
number

I what it to print out every number starting at 200 and ending at 250 so
it would print out 200 201 202 203 204



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


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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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




RE: [PHP] looping through numbers

2002-06-24 Thread Niklas Lampén

for ($i = 200; $i <= 200; $i++)
print "$i ";


Niklas


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 25. kesäkuuta 2002 10:05
To: [EMAIL PROTECTED]
Subject: [PHP] looping through numbers


Hello ,

How do I do a loop that will increase a number tell it reaches another
number

I what it to print out every number starting at 200 and ending at 250 so
it would print out 200 201 202 203 204



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


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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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




[PHP] looping through numbers

2002-06-24 Thread rdkurth

Hello ,

How do I do a loop that will increase a number tell it reaches another
number

I what it to print out every number starting at 200 and ending at 250
so it would print out 200 201 202 203 204



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


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




[PHP] Seperating presentation from logic

2002-06-24 Thread Jean-Christian Imbeault

I'm just about to start a large PHP project in which I get to work with 
professional designers/layout people. I want to separate all the 
programming logic from the presentation but I am not sure how to do this.

Can anyone point me to resources (web tutorials/articles or books) that 
would help me figure out how best to separate my programming work from 
designer's work and how best to integrate them?

Sorry for asking such a generic question but I don't know how to best 
phrase it. I did look on the web but the best I could find were some 
mentions of templates. While templates seems ok they don't address all 
the issues of separation presentation from code (if I understand them 
correctly).

Thanks!

Jc


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




Re: [PHP] using variables in a function within a fuction

2002-06-24 Thread Michael P. Carel

thanks




>  function test1()
> {return "hello";}
>
> function test2()
> {$hello = test1();
> print $hello;}
>
> test2();
>
> ?>
>
> or make it (argh) global
>
> -Original Message-
> From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 3:14 PM
> To: php
> Subject: [PHP] using variables in a function within a fuction
>
>
> Hi to all,
> Have problem with this. Im want to use a variable in a function into
another
> function. such as:
>
>  function test1()
> {$hello="hello";}
>
> function test2()
> {test1();
> print $hello;}
>
> test2();
>
> ?>
> This should print hello. But it does'nt work. Any idea?
>
> Regards
> mike
>
>
> --
> 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] Re: Re: PHP 4.2

2002-06-24 Thread Rasmus Lerdorf

You mean like php.net/version_compare ?

On Mon, 24 Jun 2002, Dreamriver.com wrote:

>
> Hello All,
> I also have the challenge of distributing php code to unknown php versions. There is 
>a wide discrepancy in the functionality of even various PHP 4.x code. Since at the 
>time of coding I don't know the version, I test for it when I need to, and include 
>code accordingly.
>
>
> For example, in the case of image uploads I find out what PHP version the server is 
>running. I declare a 'yardstick' value. If the server version is less than the 
>yardstick then I include one block of code. If the server version is equal to or 
>greater than the 'yardstick' value then I include another, different block of code. 
>It's messy, and extra code, but it works...
>
>
> While there is a user contributed function for checking the difference of two php 
>versions:
>
> http://www.php.net/manual/en/function.phpversion.php
>
> interfear01 at hotmail dot com
> 09-Jun-2002 03:00
> function check_php_version ($version)
>
>
> ... wouldn't it be really nice to have the PHP development team make up a formal, 
>built in function to handle this growing need to check versions?
>
>
> If such a function was made now, then we could rely on its availability some years 
>in the future...
>
>
> Kind Regards,
>
> Richard Creech
> [EMAIL PROTECTED]
> Phone 250.744.3350 Pacific Time, Canada
> Easily create your very own Yellow Pages - free download
> http://www.dreamriver.com
>
>
> >Message-ID: <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >From: "Peter" <[EMAIL PROTECTED]>
> >Date: Mon, 24 Jun 2002 21:24:13 +0100
> >Subject: Re: PHP 4.2
> >
> >If you want an all in one solution without having to have two versions,
> >can't you read the status of register_globals from the config file and base
> >the rest of the script on this?
> >eg
> >if (register_globals == 'on') {
> >$name = _POST['name'];
> >$address = _GET['address'];
> >}
> >
> >then you can access the variables as if register_globals = on even if it
> >isn't
> >"Simon Troup" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> I've written a small freeware script that gets installed on a variety of
> >> different platforms running various PHP versions.
> >>
> >> I've read through the manual about the super global arrays and how post
> >and
> >> get vars are no longer registered by default, but am confused about when
> >it
> >> would be a good idea to "upgrade" the script.
> >>
> >> If I change everything in the script and use $_GET and $_POST etc. then
> >> those people who are still using earlier versions won't be able to
> >upgrade.
> >>
> >> Does anyone know what the uptake of the latest version is? What is
> >everyone
> >> else doing about this? If I were developing for one client it wouldn't be
> >a
> >> problem as obviously you'd know what you were developing for.
> >>
> >> I'd just like some feedback on when would be a good time to upgrade the
> >> scripts while causing the minimum disruption and maintaining maximum happy
> >> users.
> >>
> >> Thanks
> >>
> >> Zim
>
>
>
> --
> 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: Re: PHP 4.2

2002-06-24 Thread Dreamriver.com


Hello All,
I also have the challenge of distributing php code to unknown php versions. There is a 
wide discrepancy in the functionality of even various PHP 4.x code. Since at the time 
of coding I don't know the version, I test for it when I need to, and include code 
accordingly.


For example, in the case of image uploads I find out what PHP version the server is 
running. I declare a 'yardstick' value. If the server version is less than the 
yardstick then I include one block of code. If the server version is equal to or 
greater than the 'yardstick' value then I include another, different block of code. 
It's messy, and extra code, but it works...


While there is a user contributed function for checking the difference of two php 
versions:

http://www.php.net/manual/en/function.phpversion.php

interfear01 at hotmail dot com
09-Jun-2002 03:00
function check_php_version ($version)


... wouldn't it be really nice to have the PHP development team make up a formal, 
built in function to handle this growing need to check versions? 


If such a function was made now, then we could rely on its availability some years in 
the future...


Kind Regards,

Richard Creech
[EMAIL PROTECTED]
Phone 250.744.3350 Pacific Time, Canada
Easily create your very own Yellow Pages - free download
http://www.dreamriver.com


>Message-ID: <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>From: "Peter" <[EMAIL PROTECTED]>
>Date: Mon, 24 Jun 2002 21:24:13 +0100
>Subject: Re: PHP 4.2
>
>If you want an all in one solution without having to have two versions,
>can't you read the status of register_globals from the config file and base
>the rest of the script on this?
>eg
>if (register_globals == 'on') {
>$name = _POST['name'];
>$address = _GET['address'];
>}
>
>then you can access the variables as if register_globals = on even if it
>isn't
>"Simon Troup" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> I've written a small freeware script that gets installed on a variety of
>> different platforms running various PHP versions.
>>
>> I've read through the manual about the super global arrays and how post
>and
>> get vars are no longer registered by default, but am confused about when
>it
>> would be a good idea to "upgrade" the script.
>>
>> If I change everything in the script and use $_GET and $_POST etc. then
>> those people who are still using earlier versions won't be able to
>upgrade.
>>
>> Does anyone know what the uptake of the latest version is? What is
>everyone
>> else doing about this? If I were developing for one client it wouldn't be
>a
>> problem as obviously you'd know what you were developing for.
>>
>> I'd just like some feedback on when would be a good time to upgrade the
>> scripts while causing the minimum disruption and maintaining maximum happy
>> users.
>>
>> Thanks
>>
>> Zim



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




RE: [PHP] using variables in a function within a fuction

2002-06-24 Thread Martin Towell



or make it (argh) global

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 3:14 PM
To: php
Subject: [PHP] using variables in a function within a fuction


Hi to all,
Have problem with this. Im want to use a variable in a function into another
function. such as:


This should print hello. But it does'nt work. Any idea?

Regards
mike


-- 
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] using variables in a function within a fuction

2002-06-24 Thread Michael P. Carel

Hi to all,
Have problem with this. Im want to use a variable in a function into another
function. such as:


This should print hello. But it does'nt work. Any idea?

Regards
mike


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




[PHP] php parsing problem with chat

2002-06-24 Thread Deadsam

Im using a php/flash chat, I added some parsing in it, but now Im having one
problem left to solve, after nickname plus the message (msg) its suppose to
create a new line \n, but if I parse it, and type a link or a swear word
that uses the bad word filtering, it doesnt create a new line after you
press send. It just continues on after you type something in again.I'll add
the script so you can look it over amd let me know if you know where I can
add another \n to make sure it gives me a line break after the parsing.

http://www.flashbuilder.ch
based on the http://www.peopleforfun.com version */
/*Original script by Nicola Delbono <[EMAIL PROTECTED]>*/
/*Modified by Mario http://www.bludocks.com   */
/*Modified by Deadsam at http://www.deadsam.com // added parsing for
links and bad word filter */
?>

", " ", $nickname);
$nickname = stripslashes ($nickname);
?>

&output=
 $max_file_size) {
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
$msg_old =  $lines[$i] . $msg_old;
}
$deleted = unlink($chat_file);
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, $msg_old);
fclose($fp);
}
$msg = str_replace ("\\","", $message);
//
//IF THE FORGOT TO ADD HTTP:THIS WILL DO IT FOR THEM
$webStart = Array ('WWW', 'www');
$changeWebstart = 'http://www';
$msg = str_replace ($webStart, $changeWebstart, $msg);

//this will take away the double http part
$webDouble = Array ('http://http://www');
$changeWebSingle = 'http://www';
$msg = str_replace ($webDouble, $changeWebSingle, $msg);

// Swear Word Filtering Section
$badwords = Array ("fuck", "shit", "bastard", "fucker", "fucking",  "bitch",
"cunt", "pussy", "dick",);
$changeto = '**';
$msg = str_replace ($badwords, $changeto, $msg);

// EMAIL PARSER
$msg = ereg_replace("[[:alpha:]]+@[^<>[:space:]]+[[:alnum:]]","mailto:\\0\";>\\0", $msg);

//
// URL PARSER FOR MESSAGE
$msg  = ereg_replace ("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]]", "\\0",
$msg);
//$msg = ereg_replace("\[url\]([^\[]+)\[/url\]", "\\1",
$msg);

//
// BOLD, ITALICS, UNDERLINE AND PRE PARSER
$searchFor = Array ('[b]', '[/b]', '[pre]', '[/pre]', '[i]', '[/i]', '[u]',
'[/u]');
$replaceWith = Array ('', '', '', '', '', '',
'', '');
$msg = str_replace ($searchFor, $replaceWith, $msg);

//
// END PARSING SECTION


$msg = stripslashes($msg);
if ($msg != ""){
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, " $nickname : $msg\n");
fclose($fp);}
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
echo $lines[$i];
}

?>
Thanks in advance for anyone who can help me out
Deadsam



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




Re: [PHP] what is wrong with this simple query?

2002-06-24 Thread Julie Meloni

PS> Here is my code...

PS> $query = "SELECT max(id) FROM bc_topic";
PS> $result = mysql_query($query);
PS> $temp = mysql_result($result, 0, "id");  <- this is line 8
PS> echo $temp[id];

PS> Here is the error I get ...

PS> Warning: id not found in MySQL result index 2 in /.../upload2.php on
PS> line 8

PS> What am I doing wrong here?

PS> I know for sure that there definately is a column named 'id' and it's
PS> the primary key and also an auto_increment.

You are not selecting id, you're selecting max(id).  If you do not use
 AS to make an alias, then you use max(id) as the third parameter of
 mysql_result()



- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] what is wrong with this simple query?

2002-06-24 Thread Chris Shiflett

Try this:

$query="select max(id) as id from bc_topic";

Leave the rest the same. I'm not so sure that the max(id) selection will 
populate a column named id necessarily (in fact, I think it doesn't). 
That may be your problem.

Chris

Phil Schwarzmann wrote:

>Here is my code...
>
>$query = "SELECT max(id) FROM bc_topic";
>$result = mysql_query($query);
>$temp = mysql_result($result, 0, "id");  <- this is line 8
>echo $temp[id];
>


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




[PHP] why do I need ssl, kerberos for imap?

2002-06-24 Thread General

Why do I need them, kerberos is screwing up all my plans to get this to compile
...I hate it, I don't want it. is there a way around it
signed - got pist off but back to trying this again!


Thanks,
-Eric

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




[PHP] what is wrong with this simple query?

2002-06-24 Thread Phil Schwarzmann

Here is my code...

$query = "SELECT max(id) FROM bc_topic";
$result = mysql_query($query);
$temp = mysql_result($result, 0, "id");  <- this is line 8
echo $temp[id];

Here is the error I get ...

Warning: id not found in MySQL result index 2 in /.../upload2.php on
line 8

What am I doing wrong here?

I know for sure that there definately is a column named 'id' and it's
the primary key and also an auto_increment.



[PHP] Session Events

2002-06-24 Thread Joe Krause

Is there anyway to have PHP execute a function or object method
automatically when a session is expired? In JAVA, you can define an
httpSessionBindingEvent which will notify an object when it is bound to or
unbound from a session. This may be the result of a servlet programmer
explicitly unbinding an attribute from a session, due to a session being
invalidated, or due to a session timing out. I need this behavior in PHP.

Joe Krause







Re: [PHP] fsockopen

2002-06-24 Thread Gerard Samuel

Worked perfectly.
Thanks.

Evan Nemerson wrote:

>Try
>
>fputs ($fp,"GET ".$url[path]." HTTP/1.0\r\nHost: " . $url[host] . "\r\n\r\n");
>
>Your old request looked like "GET / HTTP/1.0\r\nHost:value_of_host/\r\n\r\n", 
>hence the 400.
>
>
>On Monday 24 June 2002 17:40 pm, Gerard Samuel wrote:
>  
>
>>Im trying to figure out fsockopen to grab an rdf file.
>>Here is the code ->
>>-
>>>
>>$str = 'http://slashcode.com/slashcode.rss';
>>$url = parse_url($str);
>>
>>$path = ($url['path']) ? $url['path'] : '/';
>>$port = ($url['port']) ? $url['port'] : '80';
>>
>>if ($fp = fsockopen($url['host'], $port, &$errno, &$errstr, 5))
>>{
>>fputs ($fp,"GET / HTTP/1.0\r\nHost:" . $url[host] . $url[path] .
>>"\r\n\r\n");
>>while (!feof($fp))
>>{
>>echo fgets($fp, 1024);
>>}
>>
>>fclose ($fp);
>>}
>>else
>>{
>>echo "Problem: $errno";
>>}
>>
>>?>
>>-
>>
>>Its coming back with a HTTP/1.1 400 Bad Request
>>
>>Any help would be greatly appreciated.
>>Thanks
>>
>>
>
>  
>

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




RE: [PHP] finding the highest primary key in a table

2002-06-24 Thread John Holmes

> I want to find the number of the highest primary key in a particular
> MySQL table.

SELECT MAX(ID) FROM table

Can you tell us why you need to do this? I have a feeling you're doing
something bad...

---John Holmes...


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




Re: [PHP] Standard Input?

2002-06-24 Thread Michael: Dave II, Electric Boogaloo

"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message

> On Mon, Jun 24, 2002 at 02:07:28PM -0700, Michael wrote:
> > Are there functions in PHP that will allow me to read in a variable via
> > standard input?  I just wanted to do something like this:
>
> http://www.php.net/manual/en/function.fopen.php

Perfect!  Thank you!

Anyway, for anyone else who's interested in the answer and doesn't want to
dig through the user contributed notes for fopen

function read($length='255'){
if (!isset($GLOBALS['StdinPointer'])){
$GLOBALS['StdinPointer']=fopen("php://stdin","r");
}
$line=fgets($GLOBALS['StdinPointer'],$length);
return trim($line);
}


Michael



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




RE: [PHP] newbie on security

2002-06-24 Thread SP

The guy behind the popular free php accelerator
(http://www.php-accelerator.co.uk) is doing an encoder
(http://www.php-encoder.com).  It's not launched yet so you'll have to wait
a bit.




-Original Message-
From: Craig Williams [mailto:[EMAIL PROTECTED]]
Sent: June 24, 2002 7:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] newbie on security


Will PHP ever support code protection ? Something to encrypt the php
file so when customers get copies they can't tamper with the code ;-) I
know Zend have a solution but its too bloody expensive and must be
supported by the hosting isp.

Craig



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




RE: [PHP] finding the highest primary key in a table

2002-06-24 Thread Martin Towell

$query = "SELECT max(id) FROM table";


-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 10:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] finding the highest primary key in a table


I want to find the number of the highest primary key in a particular
MySQL table.

I could do something like...

$query = "SELECT id FROM table";

...then run the query, then create a loop and check all the ID's
(primary key) for the highest...

...but that seems like way too much.

Any ideas ??

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




[PHP] finding the highest primary key in a table

2002-06-24 Thread Phil Schwarzmann

I want to find the number of the highest primary key in a particular
MySQL table.

I could do something like...

$query = "SELECT id FROM table";

...then run the query, then create a loop and check all the ID's
(primary key) for the highest...

...but that seems like way too much.

Any ideas ??



Re: [PHP] fsockopen

2002-06-24 Thread Evan Nemerson

Try

fputs ($fp,"GET ".$url[path]." HTTP/1.0\r\nHost: " . $url[host] . "\r\n\r\n");

Your old request looked like "GET / HTTP/1.0\r\nHost:value_of_host/\r\n\r\n", 
hence the 400.


On Monday 24 June 2002 17:40 pm, Gerard Samuel wrote:
> Im trying to figure out fsockopen to grab an rdf file.
> Here is the code ->
> -
> 
> $str = 'http://slashcode.com/slashcode.rss';
> $url = parse_url($str);
>
> $path = ($url['path']) ? $url['path'] : '/';
> $port = ($url['port']) ? $url['port'] : '80';
>
> if ($fp = fsockopen($url['host'], $port, &$errno, &$errstr, 5))
> {
> fputs ($fp,"GET / HTTP/1.0\r\nHost:" . $url[host] . $url[path] .
> "\r\n\r\n");
> while (!feof($fp))
> {
> echo fgets($fp, 1024);
> }
>
> fclose ($fp);
> }
> else
> {
> echo "Problem: $errno";
> }
>
> ?>
> -
>
> Its coming back with a HTTP/1.1 400 Bad Request
>
> Any help would be greatly appreciated.
> Thanks

-- 
Only one who devotes himself to a cause with his whole strength and soul can 
be a true master. For this reason mastery demands all of a person.

Albert Einstein


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




[PHP] fsockopen

2002-06-24 Thread Gerard Samuel

Im trying to figure out fsockopen to grab an rdf file.
Here is the code ->
-
http://slashcode.com/slashcode.rss';
$url = parse_url($str);

$path = ($url['path']) ? $url['path'] : '/';
$port = ($url['port']) ? $url['port'] : '80';

if ($fp = fsockopen($url['host'], $port, &$errno, &$errstr, 5))
{
fputs ($fp,"GET / HTTP/1.0\r\nHost:" . $url[host] . $url[path] . 
"\r\n\r\n");
while (!feof($fp))
{
echo fgets($fp, 1024);
}

fclose ($fp);
}
else
{
echo "Problem: $errno";
}

?>
-

Its coming back with a HTTP/1.1 400 Bad Request

Any help would be greatly appreciated.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




RE: [PHP] Start / Stop

2002-06-24 Thread Bruce Karstedt

Timestamp it at the beginning and the end.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-Original Message-
From: Chris Kay [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 24, 2002 6:57 PM
To: PHP General List
Subject: [PHP] Start / Stop
Importance: Low



Anyone have some tips on the best way to make a 

Script started @ 5:45pm

Script ended @ 5:50pm 

Script?

---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---

-- 
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] newbie on security

2002-06-24 Thread John Holmes

> Will PHP ever support code protection ? Something to encrypt the php
> file so when customers get copies they can't tamper with the code ;-)
I
> know Zend have a solution but its too bloody expensive and must be
> supported by the hosting isp.

If it's worth protecting, it's worth paying for. And if it's worth
protecting, it's worth cracking into so you don't have the protection...

What do you have that you think is so good? There are plenty of programs
that release open source code and do well...

---John Holmes...


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




[PHP] Start / Stop

2002-06-24 Thread Chris Kay


Anyone have some tips on the best way to make a 

Script started @ 5:45pm

Script ended @ 5:50pm 

Script?

---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---

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




RE: [PHP] Lost, need help debuggin....

2002-06-24 Thread John Holmes

U...what was the question again?

John "you're not paying us" Holmes

> -Original Message-
> From: Chuck "PUP" Payne [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 7:46 PM
> To: PHP General
> Subject: Re: [PHP] Lost, need help debuggin
> 
> Look, I am glad that we are clear on php.ini, but I post my message in
> hopes
> that someone could look at it and say there your problem and go away,
I've
> turn on error part no help. Same things. So somewhere there is a sytax
> error
> that is stopping it. PLEASE HELP!
> 
> Chuck Payne
> 
> On 6/24/02 3:54 PM, "Erik Price" <[EMAIL PROTECTED]> wrote:
> 
> >
> > On Monday, June 24, 2002, at 03:51  PM, Erik Price wrote:
> >
> >> sudo find / -name 'php.ini' -print
> >
> > Clarification: substitute the search string with 'php-ini.dist' if
you
> > haven't yet configured it.  Note that Macs, although they ship with
PHP
> > pre-installed, are missing this file and you should probably
download it
> > from the PHP source tree, if you're using the pre-installed PHP.
(If
> > you've compiled your own, then you have it in the 'lib' directory of
> > wherever you installed PHP, such as /usr/local/lib/php-ini.dist).
> >
> >
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Limiting text inputs by character count?

2002-06-24 Thread Chris Shiflett

George Whiffen wrote:

>>The best way to do this is server side with strlen(). You can use
>>javascript or maxlength, but if a user wants to get around it, they can.
>>
>>---John Holmes...
>>
>>
>>
>
>John,
>
>The best way to do this is with both.  maxlength/Javascript as a courtesy,
> strlen for security.
>
>As you say, you can NEVER rely on any kind of client-side check, all checks
>must be done on the server side.  So, it's tempting to skip client-side checks,
>but making the user wait for server side execution before any checks are done
>is actually very rude.  Every time I see server-only checks for required fields etc.,
>I switch off and lose confidence in the site.
>
>George
>

George,

You are absolutely correct in your assertions. However, because it has 
become far too common for developers to rely completely on client-side 
checks (please only send me good data, mmmkay?), many people focus on 
educating others about the security implications involved. Personally, I 
stay away from javascript anyway, just because it usually looks cheap. :)

Chris


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




Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \"PUP\" Payne

Look, I am glad that we are clear on php.ini, but I post my message in hopes
that someone could look at it and say there your problem and go away, I've
turn on error part no help. Same things. So somewhere there is a sytax error
that is stopping it. PLEASE HELP!

Chuck Payne

On 6/24/02 3:54 PM, "Erik Price" <[EMAIL PROTECTED]> wrote:

> 
> On Monday, June 24, 2002, at 03:51  PM, Erik Price wrote:
> 
>> sudo find / -name 'php.ini' -print
> 
> Clarification: substitute the search string with 'php-ini.dist' if you
> haven't yet configured it.  Note that Macs, although they ship with PHP
> pre-installed, are missing this file and you should probably download it
> from the PHP source tree, if you're using the pre-installed PHP.  (If
> you've compiled your own, then you have it in the 'lib' directory of
> wherever you installed PHP, such as /usr/local/lib/php-ini.dist).
> 
> 
> 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] Compile error.

2002-06-24 Thread Duncan Hill

On Mon, 24 Jun 2002, John Holmes wrote:

> > Using the 4.2.1 source available from the main downloads page, I'm
> > getting:
> > php_functions.c:93:27: missing binary operator before '!'
> 
> You get an error when you do what? Unzip the source, compile it, run it,
> load a .php page, crap your pants???

I would have though compile it would be obvious from the fact thats a gcc 
error.  I guess I thought wrong.  The compile is for apache 2 btw.


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




RE: [PHP] PHP server error...

2002-06-24 Thread John Holmes

Check your session.save_path in PHP.ini. If you don't have a PHP.ini,
make one from PHP-ini.dist or PHP-ini.recommended

---John Holmes...

> -Original Message-
> From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 5:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP server error...
> 
> Okay, I am a total pussy and gave up on Linux to run my PHP server.
I'm
> back to Win98, and everything is working fine except...
> 
> For some reason, anytime I have a script that tries to set/access a
> session variable, I get this error
> 
> Warning: open(/tmp\sess_slkfjsdkjfljfk, O_RDWR) failed: m (2) in
> c:\apache\htdocs\...\page.php on line xx
> 
> (the sljfsldljksf is a big session number) then it says...
> 
> Failed to write session data(files).  Please verify that the current
> setting of session.save_path is correct (/tmp) in
> c:\apache\htdocs\...\page.php on line 0.
> 
> I apologize if this is a apache or mysql problem.
> 
> Anyone know what I'm doing wrong?
> 
> Thanks!!!


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




RE: [PHP] Compile error.

2002-06-24 Thread John Holmes

> Using the 4.2.1 source available from the main downloads page, I'm
> getting:
> php_functions.c:93:27: missing binary operator before '!'

You get an error when you do what? Unzip the source, compile it, run it,
load a .php page, crap your pants???

---John Holmes...


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




[PHP] newbie on security

2002-06-24 Thread Craig Williams

Will PHP ever support code protection ? Something to encrypt the php
file so when customers get copies they can't tamper with the code ;-) I
know Zend have a solution but its too bloody expensive and must be
supported by the hosting isp.
 
Craig



Re: [PHP] Image aliasing

2002-06-24 Thread Morgan Grubb

Kevin,

Dang.

[I just sent this privately without realising. I'll copy it here]

If I had any control at all over the page that the images were getting
displayed on I would be using a rather funky little script I wrote some time
ago that handles smart image resampling.

Unfortunately, I don't have any access to it, which is why I was wondering
if there was a way to compress the JPEG in such a manner that IE doesn't
alias it so much.

What I've found through experimentation is that if the source image has any
aliasing on it, that gets amplified when IE shrinks it, but if the source
has no aliasing, then IE's shrunk image contains minimal aliasing.

Anyone know how IE handles image resizing?

[Done copying]

I guess IE doesn't actually resample the image so much as mess everything
up. Netscape handles resampling images a little better, but none of our
clients use Netscape, so that doesn't help me in any way.
--



Cheers,
Morgan Grubb.



"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
004001c21bcf$2354dea0$6401a8c0@kevin">news:004001c21bcf$2354dea0$6401a8c0@kevin...
> I seriously doubt it.  Windows is going to resize all images the same
crappy
> way.  The fact is that Microsoft's graphics routines are abysmal. Anyone
> who's ever scaled an image in Preview and then seen the same thing done on
a
> Mac knows what I'm talking about.  All you can do is resize the image at
an
> exact ratio or the actual pixel size of the image and hope it doesn't look
> terrible.  Sorry for the downer. :(
> -Kevin
>
> - Original Message -
> From: "Morgan Grubb" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 24, 2002 4:02 PM
> Subject: [PHP] Image aliasing
>
>
> > Morning,
> >
> > I'm wondering if anybody has ever figured out a way to get around the
> > absolutely abysmal way that Internet Explorer resizes images?
> >
> > The problem is that the person I'm supplying the images to refuses to
use
> > two copies (a small one, and a large one) and instead uses one (just the
> > large one) and when he needs a small representation of it he slaps the
> large
> > image in and sets the width and height tags.
> >
> > The problem comes in when I'm trying to supply him with good looking
> images.
> > Sure, the large image looks fine, but that smaller image gets aliased to
> > hell and back. Can the large image be recompressed in such a way that it
> > doesn't noticeably damage the large version, but improves how it looks
> when
> > arbitrarily shrunk in IE?
> >
> > --
> >
> >
> >
> > Cheers,
> > Morgan Grubb.
> >
> >
> >
> > --
> > 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] PHP to create static images

2002-06-24 Thread hugh danaher

imagepng() should work.  you can save the file on your server then call it
up wherever you need it.

The manual has more info on using image functions just type in image.

hugh
- Original Message -
From: "Campano, Troy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 12:39 PM
Subject: [PHP] PHP to create static images


I am doing some work with creating graphs using the GD library.

Does anyone know how I can create the graphs statically so I can save the
output as a GIF or PNG?


I want to run a script that will take in say 10 datasets and then create 10
PNG images on the file server.



Any ideas?


thank you!


Troy Campano



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




Re: [PHP] Image aliasing

2002-06-24 Thread Jerome Houston

morgan-
is there any way you can have those img tags (the ones with the height and 
width) changed to reference a php script?  you could write a script that 
reads in the image they're requesting, and takes a height and width as 
inputs, then uses php commands like imagecopyresampled() or 
imagecopyresized() to dynamically output a resized image?  maybe this would 
be too much load on your server, but it sure would cut down on the download 
time, and would almost *positively* give you better image quality.

might look something like this
http://yourserver.com/scriptpath/thumbnail.php?height=100&width=100"; >

with a script something to the effect of thumbnail.php: (assuming the file 
is a jpeg)


jerome


>From: "Morgan Grubb" <[EMAIL PROTECTED]>
>Reply-To: "Morgan Grubb" <[EMAIL PROTECTED]>
>
>Morning,
>
>I'm wondering if anybody has ever figured out a way to get around the
>absolutely abysmal way that Internet Explorer resizes images?
>
>The problem is that the person I'm supplying the images to refuses to use
>two copies (a small one, and a large one) and instead uses one (just the
>large one) and when he needs a small representation of it he slaps the 
>large
>image in and sets the width and height tags.
>
>The problem comes in when I'm trying to supply him with good looking 
>images.
>Sure, the large image looks fine, but that smaller image gets aliased to
>hell and back. Can the large image be recompressed in such a way that it
>doesn't noticeably damage the large version, but improves how it looks when
>arbitrarily shrunk in IE?
>

_
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] Image aliasing

2002-06-24 Thread Andrew Chase

Hi Morgan,

None that I'm aware of.  I guess this is somewhat OT, but does the person
you're giving the images to realize that resizing the images by means of the
HTML width/height attributes doesn't do anything to size of the file the
person viewing the page has to download?  I don't know the particulars of
your situation, but say you give him a dozen high quality JPEGS at 800x600
pixels and about 120K each... if he puts those on a page and resizes them to
96 x 72 in the HTML to make 'thumbnails', the user is still going to be
stuck downloading 1440K!  That's a pretty hefty page to download even if you
have a broadband connection. (From an end-user standpoint, I find it
*really* annoying when people do this!)

Maybe you can point this out to the person you're supplying images to?  It's
not a PHP-based solution, but maybe it will help :)

Good Luck,

-Andy

P.S.  You could put together a PHP script that would use the GD
'imagecopyresampled' function to automatically generate the thumbnails for
him, but that assumes 1) You have access to his server and 2) He has PHP ;)


> -Original Message-
> I'm wondering if anybody has ever figured out a way to get around the
> absolutely abysmal way that Internet Explorer resizes images?
>
> The problem is that the person I'm supplying the images to refuses to use
> two copies (a small one, and a large one) and instead uses one (just the
> large one) and when he needs a small representation of it he
> slaps the large
> image in and sets the width and height tags.
>
> The problem comes in when I'm trying to supply him with good
> looking images.
> Sure, the large image looks fine, but that smaller image gets aliased to
> hell and back. Can the large image be recompressed in such a way that it
> doesn't noticeably damage the large version, but improves how it
> looks when
> arbitrarily shrunk in IE?


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




Re: [PHP] Word Count function?

2002-06-24 Thread Andre Dubuc

Thanks Dan,

Does the job neatly! 

Regards,
Andre

On Monday 24 June 2002 06:01 pm, you wrote:
> Andre:
>
> On Mon, Jun 24, 2002 at 05:29:16PM -0400, Andre Dubuc wrote:
> > Is there a function that counts the number of words in a string?
>
> I don't recall there being one.  But, you could do this:
>
> $array = preg_split('/\s+/', $string);
> echo count($array);
>
> Enjoy,
>
> --Dan

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

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




Fw: [PHP] Image aliasing

2002-06-24 Thread Kevin Stone

I seriously doubt it.  Windows is going to resize all images the same crappy
way.  The fact is that Microsoft's graphics routines are abysmal. Anyone
who's ever scaled an image in Preview and then seen the same thing done on a
Mac knows what I'm talking about.  All you can do is resize the image at an
exact ratio or the actual pixel size of the image and hope it doesn't look
terrible.  Sorry for the downer. :(
-Kevin

- Original Message -
From: "Morgan Grubb" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 4:02 PM
Subject: [PHP] Image aliasing


> Morning,
>
> I'm wondering if anybody has ever figured out a way to get around the
> absolutely abysmal way that Internet Explorer resizes images?
>
> The problem is that the person I'm supplying the images to refuses to use
> two copies (a small one, and a large one) and instead uses one (just the
> large one) and when he needs a small representation of it he slaps the
large
> image in and sets the width and height tags.
>
> The problem comes in when I'm trying to supply him with good looking
images.
> Sure, the large image looks fine, but that smaller image gets aliased to
> hell and back. Can the large image be recompressed in such a way that it
> doesn't noticeably damage the large version, but improves how it looks
when
> arbitrarily shrunk in IE?
>
> --
>
>
>
> Cheers,
> Morgan Grubb.
>
>
>
> --
> 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] EXIF Help needed

2002-06-24 Thread Terry Warner

Hi,

I have a php script that I use to do photos online and such.

I upgraded my php distro from debian a few days ago, and now alot of the
things that I had for EXIF info are not working in the script itself.

Such As ApertureFNumber
FocalLength
Width and Height 

Now I noticed they come out with COMPUTED.exifvale in a script I saw on
php.net, but how do I make them come out normally. Did the tags change?
I'm really kind of lost here.

Any help would be much appricated. Thank you

Terry

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




[PHP] Image aliasing

2002-06-24 Thread Morgan Grubb

Morning,

I'm wondering if anybody has ever figured out a way to get around the
absolutely abysmal way that Internet Explorer resizes images?

The problem is that the person I'm supplying the images to refuses to use
two copies (a small one, and a large one) and instead uses one (just the
large one) and when he needs a small representation of it he slaps the large
image in and sets the width and height tags.

The problem comes in when I'm trying to supply him with good looking images.
Sure, the large image looks fine, but that smaller image gets aliased to
hell and back. Can the large image be recompressed in such a way that it
doesn't noticeably damage the large version, but improves how it looks when
arbitrarily shrunk in IE?

--



Cheers,
Morgan Grubb.



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




Re: [PHP] Insert with one button

2002-06-24 Thread Analysis & Solutions

On Mon, Jun 24, 2002 at 11:23:11PM +0200, Martin Kampherbeek wrote:

> Now I've got a form with the matches for that weekend and some
selectboxes with 1 to 9 for the goals. At the bottum of the form is a
Submit button. What I want is to insert all the scores in my table
predictions with just that one button.
> 
> Table predictions:
> id
> date
> homeclub
> awayclub
> endhome
> endways
> halftimehome
> halftimeaway
> 
> So why knows how to insert all the scores for all the selected matches
in my table predictions with just that one button?


Dude, turn line wrapping on in your email client.

Anyway, Make the form elements:


 
 


"33" there is the game id.

Your receiving script should then use a while loop to go through each info
to get the game number and then use the second dimension info[gameid] to
get the data out.  Here's some off of the top of the head, untested 
code you can use as PART of your system...

while ( list($ID,) = each($_POST['info']) ) {
   $querystring  = 'INSERT INTO table (endaway, endhome) VALUES (';
   $querystring .= $_POST['info'][$ID]['endaway'] . ', ';
   $querystring .= $_POST['info'][$ID]['endhome'] . ')';

   # execute query now via appropriate function.

}

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Insert with one button

2002-06-24 Thread Kevin Stone

In your HTML each one of those select fields needs a unique name.. they
can't all be called D1.  No wonder you're having trouble.  After that you
can print_r($_POST) to see what you're getting back from the form and adjust
your script to match.  Good luck.
-Kevin

- Original Message -
From: "Martin Kampherbeek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 3:23 PM
Subject: [PHP] Insert with one button


Hello,

I'm making a predictions competitie for soccer.
Now I've got a form with the matches for that weekend and some selectboxes
with 1 to 9 for the goals. At the bottum of the form is a Submit button.
What I want is to insert all the scores in my table predictions with just
that one button.

Table predictions:
id
date
homeclub
awayclub
endhome
endways
halftimehome
halftimeaway

So why knows how to insert all the scores for all the selected matches in my
table predictions with just that one button?
Example what I mean (don't look at the error):
http://www.martinkampherbeek.com/voorspelling/voorspelling.php






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




[PHP] Re: [PHP-DEV] singleton feature

2002-06-24 Thread Purushotham Komaravolu

Singleton means only one instance.. i.e. instance of a class per
webserver... all application scripts should talk only to that same instance
irrespective of the request.
p

- Original Message -
From: "Alexander Skwar" <[EMAIL PROTECTED]>
To: "Purushotham Komaravolu" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 2:53 PM
Subject: Re: [PHP-DEV] singleton feature


So sprach Purushotham Komaravolu am 2002-06-24 um 11:39:36 -0700 :
>
> Hi ,
>   I have a small suggestion. I guess it is a good feature to
> have a provision to have a Singleton class per webserver instance. This is
> especially useful for maintain user defined connection pools, loggers etc.

Uhm, what's a "Singleton class"?

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  |Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 11 hours 5 minutes

--
PHP Development Mailing List 
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] Word Count function?

2002-06-24 Thread Analysis & Solutions

Andre:

On Mon, Jun 24, 2002 at 05:29:16PM -0400, Andre Dubuc wrote:
> Is there a function that counts the number of words in a string? 

I don't recall there being one.  But, you could do this:

$array = preg_split('/\s+/', $string);
echo count($array);

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Re: [PHP-DEV] singleton feature

2002-06-24 Thread Alexander Skwar

So sprach Purushotham Komaravolu am 2002-06-24 um 11:39:36 -0700 :
> 
> Hi ,
>   I have a small suggestion. I guess it is a good feature to
> have a provision to have a Singleton class per webserver instance. This is
> especially useful for maintain user defined connection pools, loggers etc.

Uhm, what's a "Singleton class"?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  |Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 11 hours 5 minutes

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




Re: [PHP] Standard Input?

2002-06-24 Thread Analysis & Solutions

On Mon, Jun 24, 2002 at 02:07:28PM -0700, Michael wrote:
> Are there functions in PHP that will allow me to read in a variable via
> standard input?  I just wanted to do something like this:

http://www.php.net/manual/en/function.fopen.php

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 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
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] PHP server error...

2002-06-24 Thread Phil Schwarzmann

Okay, I am a total pussy and gave up on Linux to run my PHP server.  I'm
back to Win98, and everything is working fine except...
 
For some reason, anytime I have a script that tries to set/access a
session variable, I get this error
 
Warning: open(/tmp\sess_slkfjsdkjfljfk, O_RDWR) failed: m (2) in
c:\apache\htdocs\...\page.php on line xx
 
(the sljfsldljksf is a big session number) then it says...
 
Failed to write session data(files).  Please verify that the current
setting of session.save_path is correct (/tmp) in
c:\apache\htdocs\...\page.php on line 0.
 
I apologize if this is a apache or mysql problem.
 
Anyone know what I'm doing wrong?
 
Thanks!!!



[PHP] wordwrap doesn't work for customer's Outlook

2002-06-24 Thread m u i n a r

This is really frustrating:

We found two versions of Outlook on different machines, that
have been installed with the default settings, that 'eat' the
line breaks which were made with PHP's wordwrap() function.
There are no line breaks at all!

On one of the machines there's also a version of Outlook Express,
and this one shows the line breaks. Also in Eudora and in Bat,
the line breaks are ok.

Important detail, the footer of the newsletter is hardcoded in
the PHP script with physical line breaks like

 "\n" .
 "\n" .
 "Copyright?\n" .
 "--\n" .

These work!

So can anyone tell me what is the difference between wordwrap and
these hard-coded lines? Is wordwrap not safe for use in newsletter
sending scripts? Why is $newtext = wordwrap( $text,76,"\r\n" );
not sufficient?

Thanks a lot



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




RE: [PHP] Testing PHP on a local machine

2002-06-24 Thread David Freeman

 > I want to set up a site at home to play with php
 > 
 > I have windows xp pro, dreamweaver MX and mysql
 > 
 > Do I need anything to view live application data locally in 
 > my browser

You'll need to install a web server that supports php and php itself.  I
did this recently on my XP Pro laptop using Apache and MySQL and PHP
with no problems.  I installed Apache from a download from
www.apache.org and used it's installer - worked fine.  Then installed
php as downloaded from www.php.net and followed the install instructions
that are included with it - also worked fine.  Then installed MySQL the
same way and it worked too.  Apache and MySQL will install as services
and run in the background all the time.  They take up under 3MB of RAM
when doing this.

CYA, Dave



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




RE: [PHP] php & JavaScript

2002-06-24 Thread David Freeman

 > I've tried to include a simple javascript in a .php file, 
 > but couldn't get it to work.
 > 
 > Actually not even the php code worked at all...
 > 
 > Is there any specific configuration flag that needs to be
 > set up in the Apache server so that the javascripts work
 > correctly? 

Not particularly, but if you could show some sample code of what you're
doing...

FWIW, I include javascript stuff in my php all the time.

CYA, Dave




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




[PHP] Insert with one button

2002-06-24 Thread Martin Kampherbeek

Hello,

I'm making a predictions competitie for soccer.
Now I've got a form with the matches for that weekend and some selectboxes with 1 to 9 
for the goals. At the bottum of the form is a Submit button. What I want is to insert 
all the scores in my table predictions with just that one button.

Table predictions:
id
date
homeclub
awayclub
endhome
endways
halftimehome
halftimeaway

So why knows how to insert all the scores for all the selected matches in my table 
predictions with just that one button?
Example what I mean (don't look at the error): 
http://www.martinkampherbeek.com/voorspelling/voorspelling.php





[PHP] Word Count function?

2002-06-24 Thread Andre Dubuc

Is there a function that counts the number of words in a string? 

I checked through the manual and archives using 'word count', and found 
nothing. I suppose it is possible to generate code that will accomplish this, 
using 'space' as the delimiting separator. But before I re-invent the wheel . 
. . 

Any ideas, suggestions where to look would be appreciated.
Tia,
Andre
-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

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




[PHP] Compile error.

2002-06-24 Thread Duncan Hill

Using the 4.2.1 source available from the main downloads page, I'm getting:
php_functions.c:93:27: missing binary operator before '!'

Peculiar to me, or known problem?


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




[PHP] Re: PHP with IIS

2002-06-24 Thread Dave Leather

Ok .. making more headway.. but STILL unable to solve the problem.

I can use FOPEN and FREAD on a text file that lives in the SAME directory as
my DBF file, and I can open it and display the text file NO PROBLEM.. looks
great.. but every time I attempt to open the DBF file I ALWAYS get the same
error...

Warning: unable to open database
http://flcintranet/pi2000/ordentry/1/orders.dbf in
C:\InetPub\wwwroot\pappreport.php on line 80

I am going INSANE! I have no logical explanation for this...
ANY ideas... 
Dave


"Dave Leather" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> I am attempting to open and/or create a DBASE file on a NOVELL network.
>
> When I attemp a command such as
>   if (!dbase_open("C:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says "DB WAS OPENED - no problem...
>
> On my IIS server, I have Novell drive map to P: - I can browse this using
> explorer or in CMD I can go to P: and do DIR etc etc.
>
> When I try :
>   if (!dbase_open("P:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says :
> Warning: unable to open database P:\orders.dbf in
> C:\InetPub\wwwroot\pappreport.php on line 81
> COULD NOT OPEN DB
>
> Yes, the database exists, as I copied it FROM here to C:\ to do my test.
>
> Any ideas??? I have checked the PHP.INI file, and all the regular settings
> in IIS - and could not find anything misconfigured.. but I am by no means
an
> IIS expert, so I am not sure.
>
> Thanks in advance
> Dave
>
>
>



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




Re: [PHP] Stumped.

2002-06-24 Thread 1LT John W. Holmes

> Are there any other reasons why header() would fail while output
> buffering is off.

What's the error message? It tells you exactly what file and line number
started the output, so that's where you should look...

---John Holmes...



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




[PHP] Standard Input?

2002-06-24 Thread Michael

Are there functions in PHP that will allow me to read in a variable via
standard input?  I just wanted to do something like this:

echo "What is your name? ";
$name = ;
print "Your name is $name.";

I looked but didn't see anything that quite matched up on the PHP website.


Michael


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




RE: [PHP] PHP to create static images

2002-06-24 Thread Andrew Chase

To save an image to disk with the imagepng/imagejpg/imagewbmp functions all
you have to do is give the file name as the second parameter to the
function; so if you wanted to call the first graph 'graph1.png', it would go
something like



imagepng will attempt to save graph1.png in the same directory as the
script.  Where ever you tell it to save the image, make sure your web server
(if Apache - I don't know about IIS) has permission to write files to that
directory.

-Andy



> -Original Message-
> From: Campano, Troy [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 12:40 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP to create static images
>
>
> I am doing some work with creating graphs using the GD library.
>
> Does anyone know how I can create the graphs statically so I can
> save the output as a GIF or PNG?
>
>
> I want to run a script that will take in say 10 datasets and then
> create 10 PNG images on the file server.
>
>
>
> Any ideas?
>
>
> thank you!
>
>
> Troy Campano
>


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




RE: [PHP] URGENT!!! File Uplaod

2002-06-24 Thread César Aracena

Thanx for the responses... Thanx a ¡lot!

> -Original Message-
> From: BB [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 7:50 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] URGENT!!! File Uplaod
> 
> It does depend on the usage, but general files are better
> 
> "John Holmes" <[EMAIL PROTECTED]> wrote in message
> 000a01c21b69$74acc170$b402a8c0@mango">news:000a01c21b69$74acc170$b402a8c0@mango...
> > > You're completely right - as usual - now for the file handling...
> > what's
> > > better? Storing it to the DB or as file??
> >
> > File
> >
> 
> 
> 
> --
> 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] PHP with IIS

2002-06-24 Thread Dave Leather

I would KILL to get Linux/Apache in here for our intranet.. but...
noo... gotta be microshft, gotta be NT, gotta be Uncle Bill's friend
(I'm not bitter.. much)...

Anyway. the wierd thing is the system DOES have access, I can go to
http://flcintranet/pi2000/ and press enter.. no problem, directory appears,
and I can click directory after directory down to the file I want.. click
the file, and its says "open " or "save as"... so I can get there using the
browser..

However, my code REFUSES to see it... And I am 99.99% sure this is an
IIS / Microshaft problem.  I run Apache on my windoze box at home and have
NONE of these issues...

Anyway... Thanks for the feed back.. and and all is appreciated right now..
I have spent all day inside of this IIS box and am REALLY looking forward to
a beer when I get out of here... :)

Any other ideas out there? Please, let there be an IIS guru on this forum.
Dave

"James E. Hicks III" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It looks like apache doesn't have permission to write the file
> //flcintranet/pi2000/ordentry/5788/pappexpt.dbf . If you were using a
linux/unix
> machine I'd tell you to check the permisions on this directory to make
sure that
> apache can write to it. I wish I could help you out further, but I don't
do
> windows.
>
> James
>
> -Original Message-
> From: Dave Leather [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP with IIS
>
>
> OK made some headway...
>
> Made my network drive that I wanted to access a virtual directory on my
> IIS - this is fine, I can now see all my files and folders when I surf
that
> virtual directory in a web browser.
>
> However, when trying to create a DB using dbase_create - I receive the
> following message
>
>  start output -
> attempting to create //flcintranet/pi2000/ordentry/5788/pappexpt.dbf
>
> Warning: Unable to create database (13): Permission denied in
> C:\InetPub\wwwroot\pappreport.php on line 93
> Error creating table!
> - end output -
>
> Here is my code for this:
>
>   // "database" name
>   $dbname = "//flc/pi2000/ord/pappexpt.dbf";
>   // database "definition"
>   $TableDef =
>   array(
>array("BATCH_NUM",  "C", 10),
>array("DONORNO","C",  8),
>array("FIRST_NAME", "C", 15),
>array("MIDDLENAME", "C", 15),
>array("LAST_NAME",  "C", 20),
>array("ADDRESS_1",  "C", 35),
>array("ADDRESS_2",  "C", 35),
>array("ADDRESS_3",  "C", 35),
>array("CITY",   "C", 25),
>array("STATE",  "C",  2),
>array("ZIP","C", 10),
>array("TOTAL",  "N", 10, 2)
>   );
>
>   // creation
>   Print "attempting to create $dbname";
>   if (!dbase_create($dbname, $TableDef)){
>print "Error creating table!";
>   }else{
>print "Table successfully created!";
>   }
>
> Any ideas
> Dave
>
>
>
> "Dave Leather" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Yes, and Yes...
> >
> > Access is granted throughout.. Read, Write, Create, Erase, Modify and
File
> > Scan access is granted for this login ID.
> >
> > Any other suggestions?
> >
> > Thanks again
> > Dave
> >
> > "Andrew Brampton" <[EMAIL PROTECTED]> wrote in message
> > 00ca01c21ba6$b2b36ea0$7432260a@student5830">news:00ca01c21ba6$b2b36ea0$7432260a@student5830...
> > > Does the user to which ISS runs under have network permissions to
access
> > p:\
> > > ?
> > > IIRC you need to set up ISUR_machine_name to have permission to the
> remote
> > > share.
> > >
> > > Andrew
> > > - Original Message -
> > > From: "Dave Leather" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, June 24, 2002 6:29 PM
> > > Subject: [PHP] PHP with IIS
> > >
> > >
> > > > Hello all,
> > > >
> > > > I am attempting to open and/or create a DBASE file on a NOVELL
> network.
> > > >
> > > > When I attemp a command such as
> > > >   if (!dbase_open("C:\\orders.dbf",2)){
> > > >print "COULD NOT OPEN DB";
> > > >   }else{
> > > >print "DB WAS OPENED";
> > > >   }
> > > >
> > > > I receive a message that says "DB WAS OPENED - no problem...
> > > >
> > > > On my IIS server, I have Novell drive map to P: - I can browse this
> > using
> > > > explorer or in CMD I can go to P: and do DIR etc etc.
> > > >
> > > > When I try :
> > > >   if (!dbase_open("P:\\orders.dbf",2)){
> > > >print "COULD NOT OPEN DB";
> > > >   }else{
> > > >print "DB WAS OPENED";
> > > >   }
> > > >
> > > > I receive a message that says :
> > > > Warning: unable to open database P:\orders.dbf in
> > > > C:\InetPub\wwwroot\pappreport.php on line 81
> > > > COULD NOT OPEN DB
> > > >
> > > > Yes, the database exists, as I copied it FROM here to C:\ to do my
> test.
> > > >
> > > > Any ideas??? I have checked the PHP.INI file, and all the regular
> > settings
> > > > in IIS - and could not find anything misconfigured.. but I am by no
> > means
> > > an
> >

Re: [PHP] Stumped.

2002-06-24 Thread Gerard Samuel

Within the function before the header(), no there are no echo or print 
statements.
I do have a few error checking that uses trigger_error() which displays 
a page, but no errors are being triggered.
And just in case, I did check the error_handler file.  There aren't any 
'white space' before or after 
Maybe Im missing something.  I think Ill put it aside and look at it 
when the brain is fresh...

Thanks

Erik Price wrote:

>
> On Monday, June 24, 2002, at 04:15  PM, Gerard Samuel wrote:
>
>> Are there any other reasons why header() would fail while output 
>> buffering is off.
>
>
> Hm... could it be that your user-agent isn't using HTTP 1.1?  Doubtful 
> if you're testing on a browser that was developed in the last couple 
> of years
>
> And there's no other output statements like "print", "printf", or 
> "echo" in your script before the header() line?
>
>
> Erik
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
>

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




[PHP] Re: PHP 4.2

2002-06-24 Thread Peter

If you want an all in one solution without having to have two versions,
can't you read the status of register_globals from the config file and base
the rest of the script on this?
eg
if (register_globals == 'on') {
$name = _POST['name'];
$address = _GET['address'];
}

then you can access the variables as if register_globals = on even if it
isn't
"Simon Troup" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've written a small freeware script that gets installed on a variety of
> different platforms running various PHP versions.
>
> I've read through the manual about the super global arrays and how post
and
> get vars are no longer registered by default, but am confused about when
it
> would be a good idea to "upgrade" the script.
>
> If I change everything in the script and use $_GET and $_POST etc. then
> those people who are still using earlier versions won't be able to
upgrade.
>
> Does anyone know what the uptake of the latest version is? What is
everyone
> else doing about this? If I were developing for one client it wouldn't be
a
> problem as obviously you'd know what you were developing for.
>
> I'd just like some feedback on when would be a good time to upgrade the
> scripts while causing the minimum disruption and maintaining maximum happy
> users.
>
> Thanks
>
> Zim
>



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




RE: [PHP] PHP with IIS

2002-06-24 Thread James E. Hicks III

It looks like apache doesn't have permission to write the file
//flcintranet/pi2000/ordentry/5788/pappexpt.dbf . If you were using a linux/unix
machine I'd tell you to check the permisions on this directory to make sure that
apache can write to it. I wish I could help you out further, but I don't do
windows.

James

-Original Message-
From: Dave Leather [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 24, 2002 3:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP with IIS


OK made some headway...

Made my network drive that I wanted to access a virtual directory on my
IIS - this is fine, I can now see all my files and folders when I surf that
virtual directory in a web browser.

However, when trying to create a DB using dbase_create - I receive the
following message

 start output -
attempting to create //flcintranet/pi2000/ordentry/5788/pappexpt.dbf

Warning: Unable to create database (13): Permission denied in
C:\InetPub\wwwroot\pappreport.php on line 93
Error creating table!
- end output -

Here is my code for this:

  // "database" name
  $dbname = "//flc/pi2000/ord/pappexpt.dbf";
  // database "definition"
  $TableDef =
  array(
   array("BATCH_NUM",  "C", 10),
   array("DONORNO","C",  8),
   array("FIRST_NAME", "C", 15),
   array("MIDDLENAME", "C", 15),
   array("LAST_NAME",  "C", 20),
   array("ADDRESS_1",  "C", 35),
   array("ADDRESS_2",  "C", 35),
   array("ADDRESS_3",  "C", 35),
   array("CITY",   "C", 25),
   array("STATE",  "C",  2),
   array("ZIP","C", 10),
   array("TOTAL",  "N", 10, 2)
  );

  // creation
  Print "attempting to create $dbname";
  if (!dbase_create($dbname, $TableDef)){
   print "Error creating table!";
  }else{
   print "Table successfully created!";
  }

Any ideas
Dave



"Dave Leather" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yes, and Yes...
>
> Access is granted throughout.. Read, Write, Create, Erase, Modify and File
> Scan access is granted for this login ID.
>
> Any other suggestions?
>
> Thanks again
> Dave
>
> "Andrew Brampton" <[EMAIL PROTECTED]> wrote in message
> 00ca01c21ba6$b2b36ea0$7432260a@student5830">news:00ca01c21ba6$b2b36ea0$7432260a@student5830...
> > Does the user to which ISS runs under have network permissions to access
> p:\
> > ?
> > IIRC you need to set up ISUR_machine_name to have permission to the
remote
> > share.
> >
> > Andrew
> > - Original Message -
> > From: "Dave Leather" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 24, 2002 6:29 PM
> > Subject: [PHP] PHP with IIS
> >
> >
> > > Hello all,
> > >
> > > I am attempting to open and/or create a DBASE file on a NOVELL
network.
> > >
> > > When I attemp a command such as
> > >   if (!dbase_open("C:\\orders.dbf",2)){
> > >print "COULD NOT OPEN DB";
> > >   }else{
> > >print "DB WAS OPENED";
> > >   }
> > >
> > > I receive a message that says "DB WAS OPENED - no problem...
> > >
> > > On my IIS server, I have Novell drive map to P: - I can browse this
> using
> > > explorer or in CMD I can go to P: and do DIR etc etc.
> > >
> > > When I try :
> > >   if (!dbase_open("P:\\orders.dbf",2)){
> > >print "COULD NOT OPEN DB";
> > >   }else{
> > >print "DB WAS OPENED";
> > >   }
> > >
> > > I receive a message that says :
> > > Warning: unable to open database P:\orders.dbf in
> > > C:\InetPub\wwwroot\pappreport.php on line 81
> > > COULD NOT OPEN DB
> > >
> > > Yes, the database exists, as I copied it FROM here to C:\ to do my
test.
> > >
> > > Any ideas??? I have checked the PHP.INI file, and all the regular
> settings
> > > in IIS - and could not find anything misconfigured.. but I am by no
> means
> > an
> > > IIS expert, so I am not sure.
> > >
> > > Thanks in advance
> > > Dave
> > >
> > >
> > >
> > >
> > > --
> > > 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] Stumped.

2002-06-24 Thread Gerard Samuel

In a file with functions only, one of the functions is structured like ->
function foo()
{
if (isset($_POST['submit']))
{
 /* DO SOME SQL */
 header('location: x');
}
else
{
/* SHOW A FORM HERE */
}
}


I noticed today that when I turned off output buffering, that the header 
redirect doesn't work anymore...
I turned on E_ALL error reporting, and I didn't get any errors.
I checked the file that called on this particular file, and there is no 
'white space' before or after 
I checked all included files that this function calls on and there is no 
'white space' before or after 

Are there any other reasons why header() would fail while output 
buffering is off.

Im running php 4.2.1 on FreeBSD 4.5-R p6
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




Re: [PHP] real time php

2002-06-24 Thread Kevin Stone

Look into javascript location method or meta tags to performed timed
refreshes of the browser window.  Do a search on Google.  You will find
dozens of references to both techniques.
-Kevin

- Original Message -
From: "adi" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 8:04 AM
Subject: [PHP] real time php


I have a program in php, with access at mysql database.
The problem is, my users have to access Refresh button anytime when they
want to see
real time values in database.
How to make a function for refreshing values in php pages, without pressing
Refresh button. What must i read?

Any help will be deeply apreciated
adi



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




Re: [PHP] PHP with IIS

2002-06-24 Thread Dave Leather

OK made some headway...

Made my network drive that I wanted to access a virtual directory on my
IIS - this is fine, I can now see all my files and folders when I surf that
virtual directory in a web browser.

However, when trying to create a DB using dbase_create - I receive the
following message

 start output -
attempting to create //flcintranet/pi2000/ordentry/5788/pappexpt.dbf

Warning: Unable to create database (13): Permission denied in
C:\InetPub\wwwroot\pappreport.php on line 93
Error creating table!
- end output -

Here is my code for this:

  // "database" name
  $dbname = "//flc/pi2000/ord/pappexpt.dbf";
  // database "definition"
  $TableDef =
  array(
   array("BATCH_NUM",  "C", 10),
   array("DONORNO","C",  8),
   array("FIRST_NAME", "C", 15),
   array("MIDDLENAME", "C", 15),
   array("LAST_NAME",  "C", 20),
   array("ADDRESS_1",  "C", 35),
   array("ADDRESS_2",  "C", 35),
   array("ADDRESS_3",  "C", 35),
   array("CITY",   "C", 25),
   array("STATE",  "C",  2),
   array("ZIP","C", 10),
   array("TOTAL",  "N", 10, 2)
  );

  // creation
  Print "attempting to create $dbname";
  if (!dbase_create($dbname, $TableDef)){
   print "Error creating table!";
  }else{
   print "Table successfully created!";
  }

Any ideas
Dave



"Dave Leather" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yes, and Yes...
>
> Access is granted throughout.. Read, Write, Create, Erase, Modify and File
> Scan access is granted for this login ID.
>
> Any other suggestions?
>
> Thanks again
> Dave
>
> "Andrew Brampton" <[EMAIL PROTECTED]> wrote in message
> 00ca01c21ba6$b2b36ea0$7432260a@student5830">news:00ca01c21ba6$b2b36ea0$7432260a@student5830...
> > Does the user to which ISS runs under have network permissions to access
> p:\
> > ?
> > IIRC you need to set up ISUR_machine_name to have permission to the
remote
> > share.
> >
> > Andrew
> > - Original Message -
> > From: "Dave Leather" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 24, 2002 6:29 PM
> > Subject: [PHP] PHP with IIS
> >
> >
> > > Hello all,
> > >
> > > I am attempting to open and/or create a DBASE file on a NOVELL
network.
> > >
> > > When I attemp a command such as
> > >   if (!dbase_open("C:\\orders.dbf",2)){
> > >print "COULD NOT OPEN DB";
> > >   }else{
> > >print "DB WAS OPENED";
> > >   }
> > >
> > > I receive a message that says "DB WAS OPENED - no problem...
> > >
> > > On my IIS server, I have Novell drive map to P: - I can browse this
> using
> > > explorer or in CMD I can go to P: and do DIR etc etc.
> > >
> > > When I try :
> > >   if (!dbase_open("P:\\orders.dbf",2)){
> > >print "COULD NOT OPEN DB";
> > >   }else{
> > >print "DB WAS OPENED";
> > >   }
> > >
> > > I receive a message that says :
> > > Warning: unable to open database P:\orders.dbf in
> > > C:\InetPub\wwwroot\pappreport.php on line 81
> > > COULD NOT OPEN DB
> > >
> > > Yes, the database exists, as I copied it FROM here to C:\ to do my
test.
> > >
> > > Any ideas??? I have checked the PHP.INI file, and all the regular
> settings
> > > in IIS - and could not find anything misconfigured.. but I am by no
> means
> > an
> > > IIS expert, so I am not sure.
> > >
> > > Thanks in advance
> > > Dave
> > >
> > >
> > >
> > >
> > > --
> > > 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] Lost, need help debuggin....

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 03:51  PM, Erik Price wrote:

> sudo find / -name 'php.ini' -print

Clarification: substitute the search string with 'php-ini.dist' if you 
haven't yet configured it.  Note that Macs, although they ship with PHP 
pre-installed, are missing this file and you should probably download it 
from the PHP source tree, if you're using the pre-installed PHP.  (If 
you've compiled your own, then you have it in the 'lib' directory of 
wherever you installed PHP, such as /usr/local/lib/php-ini.dist).


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] Lost, need help debuggin....

2002-06-24 Thread Erik Price



> If you don't find it, look for a php-ini.dist or php-ini.recommended in 
> the
> php folder.
>
> Modify one of those to your needs and save it as php.ini. I don't know 
> where
> it would go in a Mac, though... ??

Open Terminal.app and type

sudo find / -name 'php.ini' -print

and enter your password when it asks for your password.  Be patient as 
it searches, you'll get no visual confirmation that the search is 
running until it's done or until it finds something.


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

2002-06-24 Thread Burak Delice

I gave up php, cgi, java,delphi,max,web,flash!!!what is
matter...http://www.micro.magnet.fsu.edu/primer/java/scienceopticsu/powersof
10/index.html




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




Re: [PHP] Can't start Apache

2002-06-24 Thread General

Quoting Jason Wong <[EMAIL PROTECTED]>:

> On Tuesday 25 June 2002 02:44, General wrote:
> 
> > All of my libraries are in /usr/lib/*
> > and I'm pointing the directory to --with-kerberos=/usr/lib/
> 
> You should be pointing it to:
> 
> --with-kerberos=/usr/
> 
> > for now on I will post messages at the bottom.
> 
> Thanks. OK the next step is to quote only the necessary bits and always
> trim 
> the sigs :)
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
> *
> 
> /*
> O'Brian's Law:
>   Everything is always done for the wrong reasons.
> */
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Hi, this is still not working ...I'm ready to give up.
Thanks for all your help I just don't think this is a viable solution any more.

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




Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread 1LT John W. Holmes

Search??

If you don't find it, look for a php-ini.dist or php-ini.recommended in the
php folder.

Modify one of those to your needs and save it as php.ini. I don't know where
it would go in a Mac, though... ??

---John Holmes...

- Original Message -
From: "Chuck "PUP" Payne" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>; "Chuck "PUP" Payne"
<[EMAIL PROTECTED]>; "PHP General" <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 3:31 PM
Subject: Re: [PHP] Lost, need help debuggin


> Not sure I am on my laptop, an iBook running php/apache. So I am not sure
> where php.ini is.
>
> Chuck
>
> On 6/24/02 3:29 PM, "1LT John W. Holmes" <[EMAIL PROTECTED]> wrote:
>
> > Do you have display_errors ON in your php.ini ??
> >
> > ---John Holmes...
> >
> > - Original Message -
> > From: "Chuck "PUP" Payne" <[EMAIL PROTECTED]>
> > To: "PHP General" <[EMAIL PROTECTED]>
> > Sent: Monday, June 24, 2002 3:24 PM
> > Subject: [PHP] Lost, need help debuggin
> >
> >
> >> Hi,
> >>
> >> I am trying to debugging this script. But, I can see what the issue is,
it
> >> not listing errors on any of the mysql stuff but this what I see when I
> > view
> >> source
> >>
>
>> -
-
> > --
> >>
> >>
> >>
> >>
>
>> -
-
> > --
> >>
> >> Here is the code.
> >>
>
>> -
-
> > --
> >>
> >> 
> >> 
> >> Browse A Movie in My Movie Database
> >> 
> >> 
> >> 
> >>
> >>  >>
> >> //How many should be displayed on per page
> >>
> >> $display_number = 25;
> >>
> >> //Connect to the database
> >>
> >> $db_connection = mysql_connect ('localhost', 'user', 'gateway') or die
> >> ('Could not connect');
> >> $db_select = mysql_select_db ('media') or die ("Couldn't not access
> >> database");
> >>
> >> //If we don't know how many pages there are, make that calculation.
> >>
> >> print "before the first if";
> >>
> >> if (!isset($num_pages)) {
> >>
> >>
> >> // Determine the query.
> >>
> >> if(isset($letter)) { // Browsing a particular letter or the whole
> >> shebang?
> >>
> >> $query1 = "SELECT library.title FROM media.library WHERE
library.title
> >> LIKE '$letter%' ORDER BY library.title ASC";
> >>
> >> } else {
> >>
> >> $query1 = "SELECT library.title FROM media.library ORDER BY
> >> library.title ASC";
> >>
> >> }
> >>
> >> //Query the database
> >>
> >> $query_result1 = @mysql_query ($query1) or die ("Could not run
> > query");
> >>
> >>
> >> //Calculate the number of pages required.
> >>
> >> $num_results = @mysql_num_row ($query_result);
> >> if ($num_results > $display_number) {
> >> $num_pages = ceil ($num_results/$display_number);
> >>
> >> } elseif ($num_results > 0) {
> >>
> >> $num_pages = 1;
> >>
> >> } else {
> >>
> >> echo 'There are no movies in this selection';
> >>
> >> }
> >>
> >> $start = 0; // Current at item 0
> >>
> >>
> >> }
> >>
> >> if(isset($letter)) { // Browsing a particular letter or the whole
shebang?
> >>
> >> $query = "SELECT library.title FROM media.library WHERE
library.title
> >> LIKE '$letter%' ORDER BY library.title ASC LIMIT $start,
$display_number";
> >>
> >> } else {
> >>
> >> $query = "SELECT library.title FROM media.library ORDER BY
> > library.title
> >> ASC LIMIT $start, $display_number";
> >>
> >> }
> >>
> >>
> >> // Table that shows movies...
> >>
> >> echo "";
> >> echo "";
> >> echo "Title";
> >> echo "";
> >>
> >> // Print My list
> >>
> >> $query_result = @mysql_query ($query);
> >>
> >> while ($row = @mysql_fetch_array ($query_result)) {
> >>
> >> print "";
> >> print " >> href='testlist.php?row[title]'>$row[title]";
> >> print "";
> >>
> >> }
> >>
> >> // Make the links to others pages, if nessessary.
> >>
> >> if ($num_pages > 1) {
> >>
> >> print "";
> >> print "";
> >>
> >> // Determine what page the script is on.
> >>
> >> if ($start == 0) {
> >> $current_page = 1;
> >>
> >> } else {
> >>
> >> $current_page = ($start/$display_number) + 1;
> >>
> >> }
> >>
> >> // If it's not the make a back button...
> >>
> >> If($start !=0) {
> >> echo 'Back ';
> >> }
> >>
> >> // Make all the numbered pages.
> >>
> >> for ($i = 1; $i <= $num_pages; $i++) {
> >> $next_start = $start + $display_number;
> >> if ($i != $current_page) {
> >>
> >> // Don't link the current page
> >>
> >> print '' .$i .
> > '
> >> ';
> >>
> >> } else {
> >>
> >> echo $i . ' ';
> >>
> >> }
> >>
> >> }
> >>
> >> // If it's not the last page, make a next buttton.
> >>
> >> if($current_page !=$num_pages) {
> >> print 'Next ';
> >>
> >>
> >> }
> >>
> >> print "";
> >> print "";
> >>
> >>
> >> }
> >>
> >>
> >> ?>
> >>
> 

[PHP] PHP to create static images

2002-06-24 Thread Campano, Troy

I am doing some work with creating graphs using the GD library.

Does anyone know how I can create the graphs statically so I can save the output as a 
GIF or PNG?


I want to run a script that will take in say 10 datasets and then create 10 PNG images 
on the file server.



Any ideas?


thank you!


Troy Campano



Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread Jason Wong

On Tuesday 25 June 2002 03:31, Chuck \"PUP\" Payne wrote:
> Not sure I am on my laptop, an iBook running php/apache. So I am not sure
> where php.ini is.

Did you ask Sherlock ?

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

/*
This is your fortune.
*/


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




Re: [PHP] Ensim with PHP and MySQL

2002-06-24 Thread Mark McCulligh

Thanks for your input,

For if I am read your email right, Ensim has some custom setting in
httpd_vwh.conf  that upgrading PHP/Mysql will not update for you.  PHP/Mysql
updates your httpd.conf file.

Also can you do everything that Redhat can, does Ensim limit your redhat OS
at all.  In short does your Ensim work just like a RedHat machine.

Mark.

--
"Steve Buehler" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been running several servers using the ensim software and have had
> no problem with PHP and/or MySQL.  Well, none that was the fault of PHP or
> MySQL.  Neither one should give you a problem upgrading, except that you
> will have to edit the httpd_vwh.conf file by hand since both PHP and MySQL
> (if they upgrade the httpd.conf file) don't know it is now httpd_vwh.conf.
>
> Steve
>
> At 12:56 PM 6/24/2002 -0400, you wrote:
> >Has anyone ever used Ensim on their server with PHP and MySQL.
> >
> >I am looking at purchase Ensim to management my web sites.  It looks like
a
> >great product, but because it is embedded into RedHat, I am worried about
> >its flexible.
> >
> >If I want to upgrade my PHP, MySQL or Apache on it. It doesn't look like
it
> >is that easy.
> >
> >In short I just want to know if anyone out there is using Ensim and if
so,
> >do you like it.
> >
> >Thanks, Mark.
> >
> >--
> >_
> >Mark McCulligh, Application Developer / Analyst
> >Sykes Canada Corporation www.SykesCanada.com
> >(888)225-6824 ex. 3262
> >[EMAIL PROTECTED]
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >--
> >This message has been scanned for viruses and
> >dangerous content by MailScanner, and is
> >believed to be clean.
> >ow3
>
>



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




Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \"PUP\" Payne

Not sure I am on my laptop, an iBook running php/apache. So I am not sure
where php.ini is.

Chuck

On 6/24/02 3:29 PM, "1LT John W. Holmes" <[EMAIL PROTECTED]> wrote:

> Do you have display_errors ON in your php.ini ??
> 
> ---John Holmes...
> 
> - Original Message -
> From: "Chuck "PUP" Payne" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Monday, June 24, 2002 3:24 PM
> Subject: [PHP] Lost, need help debuggin
> 
> 
>> Hi,
>> 
>> I am trying to debugging this script. But, I can see what the issue is, it
>> not listing errors on any of the mysql stuff but this what I see when I
> view
>> source
>> 
>> --
> --
>> 
>> 
>> 
>> 
>> --
> --
>> 
>> Here is the code.
>> 
>> --
> --
>> 
>> 
>> 
>> Browse A Movie in My Movie Database
>> 
>> 
>> 
>> 
>> > 
>> //How many should be displayed on per page
>> 
>> $display_number = 25;
>> 
>> //Connect to the database
>> 
>> $db_connection = mysql_connect ('localhost', 'user', 'gateway') or die
>> ('Could not connect');
>> $db_select = mysql_select_db ('media') or die ("Couldn't not access
>> database");
>> 
>> //If we don't know how many pages there are, make that calculation.
>> 
>> print "before the first if";
>> 
>> if (!isset($num_pages)) {
>> 
>> 
>> // Determine the query.
>> 
>> if(isset($letter)) { // Browsing a particular letter or the whole
>> shebang?
>> 
>> $query1 = "SELECT library.title FROM media.library WHERE library.title
>> LIKE '$letter%' ORDER BY library.title ASC";
>> 
>> } else {
>> 
>> $query1 = "SELECT library.title FROM media.library ORDER BY
>> library.title ASC";
>> 
>> }
>> 
>> //Query the database
>> 
>> $query_result1 = @mysql_query ($query1) or die ("Could not run
> query");
>> 
>> 
>> //Calculate the number of pages required.
>> 
>> $num_results = @mysql_num_row ($query_result);
>> if ($num_results > $display_number) {
>> $num_pages = ceil ($num_results/$display_number);
>> 
>> } elseif ($num_results > 0) {
>> 
>> $num_pages = 1;
>> 
>> } else {
>> 
>> echo 'There are no movies in this selection';
>> 
>> }
>> 
>> $start = 0; // Current at item 0
>> 
>> 
>> }
>> 
>> if(isset($letter)) { // Browsing a particular letter or the whole shebang?
>> 
>> $query = "SELECT library.title FROM media.library WHERE library.title
>> LIKE '$letter%' ORDER BY library.title ASC LIMIT $start, $display_number";
>> 
>> } else {
>> 
>> $query = "SELECT library.title FROM media.library ORDER BY
> library.title
>> ASC LIMIT $start, $display_number";
>> 
>> }
>> 
>> 
>> // Table that shows movies...
>> 
>> echo "";
>> echo "";
>> echo "Title";
>> echo "";
>> 
>> // Print My list
>> 
>> $query_result = @mysql_query ($query);
>> 
>> while ($row = @mysql_fetch_array ($query_result)) {
>> 
>> print "";
>> print "> href='testlist.php?row[title]'>$row[title]";
>> print "";
>> 
>> }
>> 
>> // Make the links to others pages, if nessessary.
>> 
>> if ($num_pages > 1) {
>> 
>> print "";
>> print "";
>> 
>> // Determine what page the script is on.
>> 
>> if ($start == 0) {
>> $current_page = 1;
>> 
>> } else {
>> 
>> $current_page = ($start/$display_number) + 1;
>> 
>> }
>> 
>> // If it's not the make a back button...
>> 
>> If($start !=0) {
>> echo 'Back ';
>> }
>> 
>> // Make all the numbered pages.
>> 
>> for ($i = 1; $i <= $num_pages; $i++) {
>> $next_start = $start + $display_number;
>> if ($i != $current_page) {
>> 
>> // Don't link the current page
>> 
>> print '' .$i .
> '
>> ';
>> 
>> } else {
>> 
>> echo $i . ' ';
>> 
>> }
>> 
>> }
>> 
>> // If it's not the last page, make a next buttton.
>> 
>> if($current_page !=$num_pages) {
>> print 'Next ';
>> 
>> 
>> }
>> 
>> print "";
>> print "";
>> 
>> 
>> }
>> 
>> 
>> ?>
>> 
>> 
>> 
>> 
>> 
>> 
>> --
> --
>> 
>> Thanks a head of time if you can show the error(s) in my code.
>> 
>> Chuck Payne
>> Magi Design and Support
>> 
>> 
>> --
>> 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] Lost, need help debuggin....

2002-06-24 Thread 1LT John W. Holmes

Do you have display_errors ON in your php.ini ??

---John Holmes...

- Original Message -
From: "Chuck "PUP" Payne" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 3:24 PM
Subject: [PHP] Lost, need help debuggin


> Hi,
>
> I am trying to debugging this script. But, I can see what the issue is, it
> not listing errors on any of the mysql stuff but this what I see when I
view
> source
>
> --
--
>
>
>
>
> --
--
>
> Here is the code.
>
> --
--
>
> 
> 
> Browse A Movie in My Movie Database
> 
> 
> 
>
> 
> //How many should be displayed on per page
>
> $display_number = 25;
>
> //Connect to the database
>
> $db_connection = mysql_connect ('localhost', 'user', 'gateway') or die
> ('Could not connect');
> $db_select = mysql_select_db ('media') or die ("Couldn't not access
> database");
>
> //If we don't know how many pages there are, make that calculation.
>
> print "before the first if";
>
> if (!isset($num_pages)) {
>
>
> // Determine the query.
>
> if(isset($letter)) { // Browsing a particular letter or the whole
> shebang?
>
> $query1 = "SELECT library.title FROM media.library WHERE library.title
> LIKE '$letter%' ORDER BY library.title ASC";
>
> } else {
>
> $query1 = "SELECT library.title FROM media.library ORDER BY
> library.title ASC";
>
> }
>
> //Query the database
>
> $query_result1 = @mysql_query ($query1) or die ("Could not run
query");
>
>
> //Calculate the number of pages required.
>
> $num_results = @mysql_num_row ($query_result);
> if ($num_results > $display_number) {
> $num_pages = ceil ($num_results/$display_number);
>
> } elseif ($num_results > 0) {
>
> $num_pages = 1;
>
> } else {
>
> echo 'There are no movies in this selection';
>
> }
>
> $start = 0; // Current at item 0
>
>
> }
>
> if(isset($letter)) { // Browsing a particular letter or the whole shebang?
>
> $query = "SELECT library.title FROM media.library WHERE library.title
> LIKE '$letter%' ORDER BY library.title ASC LIMIT $start, $display_number";
>
> } else {
>
> $query = "SELECT library.title FROM media.library ORDER BY
library.title
> ASC LIMIT $start, $display_number";
>
> }
>
>
> // Table that shows movies...
>
> echo "";
> echo "";
> echo "Title";
> echo "";
>
> // Print My list
>
> $query_result = @mysql_query ($query);
>
> while ($row = @mysql_fetch_array ($query_result)) {
>
> print "";
> print " href='testlist.php?row[title]'>$row[title]";
> print "";
>
> }
>
> // Make the links to others pages, if nessessary.
>
> if ($num_pages > 1) {
>
> print "";
> print "";
>
> // Determine what page the script is on.
>
> if ($start == 0) {
> $current_page = 1;
>
> } else {
>
> $current_page = ($start/$display_number) + 1;
>
> }
>
> // If it's not the make a back button...
>
> If($start !=0) {
> echo 'Back ';
> }
>
> // Make all the numbered pages.
>
> for ($i = 1; $i <= $num_pages; $i++) {
> $next_start = $start + $display_number;
> if ($i != $current_page) {
>
> // Don't link the current page
>
> print '' .$i .
'
> ';
>
> } else {
>
> echo $i . ' ';
>
> }
>
> }
>
> // If it's not the last page, make a next buttton.
>
> if($current_page !=$num_pages) {
> print 'Next ';
>
>
> }
>
> print "";
> print "";
>
>
> }
>
>
> ?>
>
> 
> 
> 
>
>
> --
--
>
> Thanks a head of time if you can show the error(s) in my code.
>
> Chuck Payne
> Magi Design and Support
>
>
> --
> 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] Can't start Apache

2002-06-24 Thread Jason Wong

On Tuesday 25 June 2002 02:44, General wrote:

> All of my libraries are in /usr/lib/*
> and I'm pointing the directory to --with-kerberos=/usr/lib/

You should be pointing it to:

--with-kerberos=/usr/

> for now on I will post messages at the bottom.

Thanks. OK the next step is to quote only the necessary bits and always trim 
the sigs :)

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

/*
O'Brian's Law:
Everything is always done for the wrong reasons.
*/


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




Re: [PHP] Sybase Fetch Array Question

2002-06-24 Thread 1LT John W. Holmes

> Can someone let me know when you call sybase_fetch_array that the internal
> row pointer of the sybase result is increased.  So that subsequent calls
> using sybase_fetch_array will return a result 1 more than the previous
> result return?

Hey, I just wanted to let you know that when you call sybase_fetch_array
that the internal row pointer of the sybase result is increased. I had a
feeling you wanted to know that. Also, you should know that subsequent calls
using sybase_fetch_array will return a result 1 more than the previous
result return.

Documentation is at www.php.net/sybase_fetch_row

---John Holmes...


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




[PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \"PUP\" Payne

Hi,

I am trying to debugging this script. But, I can see what the issue is, it
not listing errors on any of the mysql stuff but this what I see when I view
source








Here is the code.





Browse A Movie in My Movie Database




 $display_number) {
$num_pages = ceil ($num_results/$display_number);

} elseif ($num_results > 0) {

$num_pages = 1;

} else {

echo 'There are no movies in this selection';

}

$start = 0; // Current at item 0


}

if(isset($letter)) { // Browsing a particular letter or the whole shebang?

$query = "SELECT library.title FROM media.library WHERE library.title
LIKE '$letter%' ORDER BY library.title ASC LIMIT $start, $display_number";

} else {

$query = "SELECT library.title FROM media.library ORDER BY library.title
ASC LIMIT $start, $display_number";

}


// Table that shows movies...

echo "";
echo "";
echo "Title";
echo "";

// Print My list

$query_result = @mysql_query ($query);

while ($row = @mysql_fetch_array ($query_result)) {

print "";
print "$row[title]";
print "";

}

// Make the links to others pages, if nessessary.

if ($num_pages > 1) {

print "";
print "";

// Determine what page the script is on.

if ($start == 0) {
$current_page = 1;

} else {

$current_page = ($start/$display_number) + 1;

}

// If it's not the make a back button...

If($start !=0) {
echo 'Back ';
}

// Make all the numbered pages.

for ($i = 1; $i <= $num_pages; $i++) {
$next_start = $start + $display_number;
if ($i != $current_page) {

// Don't link the current page

print '' .$i . '
';

} else {

echo $i . ' ';

}

}

// If it's not the last page, make a next buttton.

if($current_page !=$num_pages) {
print 'Next ';


}

print "";
print "";


}


?>








Thanks a head of time if you can show the error(s) in my code.

Chuck Payne
Magi Design and Support


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




Re: [PHP] imagecopyresized() problems

2002-06-24 Thread hugh danaher

Don't know if this helps, but the following works on my system.

Hugh

$width)
 {
 $nheight=$max;
 $nwidth=$width/($height/$max);
 }
else
 {
 $nwidth=$max;
 $nheight=$height/($width/$max);
 }

//header("content-type: image/jpeg");
$image=imagecreatefromjpeg($picture);
$image1=imagecreate($nwidth,$nheight);
imagecopyresized( $image1, $image,0,0, 0,0, $nwidth,
$nheight,$width,$height);


imagejpeg($image1,"../photos/sm_".$userfile_name."",100);

ImageDestroy($image);
ImageDestroy($image1);
?>
- Original Message -
From: "Phil Ewington" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 3:57 AM
Subject: [PHP] imagecopyresized() problems


> Hi,
>
> I am trying to copy and resize an image using imagecopyresized() and
> cannot seem to crack it. Below is the code I am using, can anyone tell
> me why I keep getting and invalid image resource warning and is this
> the src or dest parameter that the error is referring to?
>
> $srcImageName = "../properties/$line[propid].jpg";
> $destImageName = $rm_branchref . "_" . $line[propid] . ".jpg";
> $destImage = imagecreate(275, 183);
> imagecopyresized($destImage, $srcImageName, 0, 0, 0, 0, 275, 183,
> imagesx($srcImageName), imagesy($srcImageName));
> imageJpeg($destImage, $destImageName, 75);
> imagedestroy($destImage);
>
> All that happens is that I get an identical copy of the image, and not
> a resized one.
>
> TIA
>
> Phil Ewington.
>
> --
> 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] Ensim with PHP and MySQL

2002-06-24 Thread Steve Buehler

I have been running several servers using the ensim software and have had 
no problem with PHP and/or MySQL.  Well, none that was the fault of PHP or 
MySQL.  Neither one should give you a problem upgrading, except that you 
will have to edit the httpd_vwh.conf file by hand since both PHP and MySQL 
(if they upgrade the httpd.conf file) don't know it is now httpd_vwh.conf.

Steve

At 12:56 PM 6/24/2002 -0400, you wrote:
>Has anyone ever used Ensim on their server with PHP and MySQL.
>
>I am looking at purchase Ensim to management my web sites.  It looks like a
>great product, but because it is embedded into RedHat, I am worried about
>its flexible.
>
>If I want to upgrade my PHP, MySQL or Apache on it. It doesn't look like it
>is that easy.
>
>In short I just want to know if anyone out there is using Ensim and if so,
>do you like it.
>
>Thanks, Mark.
>
>--
>_
>Mark McCulligh, Application Developer / Analyst
>Sykes Canada Corporation www.SykesCanada.com
>(888)225-6824 ex. 3262
>[EMAIL PROTECTED]
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>ow3



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




[PHP] Sybase Fetch Array Question

2002-06-24 Thread B i g D o g

Can someone let me know when you call sybase_fetch_array that the internal
row pointer of the sybase result is increased.  So that subsequent calls
using sybase_fetch_array will return a result 1 more than the previous
result return?


Okay that was weird


B i g D o g



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




Re: [PHP] Can't start Apache

2002-06-24 Thread General

 look at the bottom :)

Quoting Jason Wong <[EMAIL PROTECTED]>:

> On Tuesday 25 June 2002 01:21, General wrote:
> 
>  I hate it when people top post. Makes quoting necessarily
> difficult and 
> confusing.
> 
> > I know because it was causing the problem I was talking about down a
> couple
> > of lines.
> > > > with recursive error 1 cannot find libgss_krb5.so ...and I am
> pointing
> 
> Where is "libgss_krb5.so" located on your system?
> 
> > > to
> > >
> > > > the correct directory for kerberos. any help?
> 
> And where are you pointing the directory to?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
> *
> 
> /*
> Eternal nothingness is fine if you happen to be dressed for it.
>   -- Woody Allen
> */
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

All of my libraries are in /usr/lib/*
and I'm pointing the directory to --with-kerberos=/usr/lib/

for now on I will post messages at the bottom.
Thank You,
-Eric

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




[PHP] singleton feature

2002-06-24 Thread Purushotham Komaravolu


Hi ,
  I have a small suggestion. I guess it is a good feature to
have a provision to have a Singleton class per webserver instance. This is
especially useful for maintain user defined connection pools, loggers etc.
Thanks
Regards,
Puru




Re: [PHP] rounding a number

2002-06-24 Thread Jason Wong

On Tuesday 25 June 2002 02:16, Jim lucas wrote:
> seems to work fine for me.
> what are your results when you do this?  mine are 0.4  and this is what is
> should be. if it were .349 it would round down. isn't this how it should
> work?   What were your results?

> > try round(0.35,1)

I get 0.3 on php 4.0.6.

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

/*
Elegance and truth are inversely related.
-- Becker's Razor
*/


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




Re: [PHP] Can't start Apache

2002-06-24 Thread Jason Wong

On Tuesday 25 June 2002 01:21, General wrote:

 I hate it when people top post. Makes quoting necessarily difficult and 
confusing.

> I know because it was causing the problem I was talking about down a couple
> of lines.
> > > with recursive error 1 cannot find libgss_krb5.so ...and I am pointing

Where is "libgss_krb5.so" located on your system?

> > to
> >
> > > the correct directory for kerberos. any help?

And where are you pointing the directory to?

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

/*
Eternal nothingness is fine if you happen to be dressed for it.
-- Woody Allen
*/


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




Re: [PHP] rounding a number

2002-06-24 Thread Jim lucas

seems to work fine for me.
what are your results when you do this?  mine are 0.4  and this is what is
should be. if it were .349 it would round down. isn't this how it should
work?   What were your results?

Jim Lucas
- Original Message -
From: "George Whiffen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 2:36 AM
Subject: Re: [PHP] rounding a number


> Jason Wong wrote:
>
> > On Monday 24 June 2002 11:34, Phil Schwarzmann wrote:
> > > I want to round a number to the nearest decimal place...
> > >
> > > if the number is 4.623, I want it to display 4.6
> > > if the number is 2.36, I want it to display 2.7
> >
> > You don't really mean 2.36 --> 2.7 ??
> >
> > > Is there a function that does this?  round(), ceil(), floor() don't do
> > > this and I've checked through all the math functions in my handy-dandy
> > > "PHP Functions" reference book.
> >
> > round() seems to work. What's the problem you're having?
> >
>
> It's worth noting that round doesn't always work e.g.
>
> try round(0.35,1)
>
>
>
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > That's no moon...
> > -- Obi-wan Kenobi
> > */
>
>
> --
> 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] PHP with IIS

2002-06-24 Thread Dave Leather

Yes, and Yes...

Access is granted throughout.. Read, Write, Create, Erase, Modify and File
Scan access is granted for this login ID.

Any other suggestions?

Thanks again
Dave

"Andrew Brampton" <[EMAIL PROTECTED]> wrote in message
00ca01c21ba6$b2b36ea0$7432260a@student5830">news:00ca01c21ba6$b2b36ea0$7432260a@student5830...
> Does the user to which ISS runs under have network permissions to access
p:\
> ?
> IIRC you need to set up ISUR_machine_name to have permission to the remote
> share.
>
> Andrew
> - Original Message -
> From: "Dave Leather" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 24, 2002 6:29 PM
> Subject: [PHP] PHP with IIS
>
>
> > Hello all,
> >
> > I am attempting to open and/or create a DBASE file on a NOVELL network.
> >
> > When I attemp a command such as
> >   if (!dbase_open("C:\\orders.dbf",2)){
> >print "COULD NOT OPEN DB";
> >   }else{
> >print "DB WAS OPENED";
> >   }
> >
> > I receive a message that says "DB WAS OPENED - no problem...
> >
> > On my IIS server, I have Novell drive map to P: - I can browse this
using
> > explorer or in CMD I can go to P: and do DIR etc etc.
> >
> > When I try :
> >   if (!dbase_open("P:\\orders.dbf",2)){
> >print "COULD NOT OPEN DB";
> >   }else{
> >print "DB WAS OPENED";
> >   }
> >
> > I receive a message that says :
> > Warning: unable to open database P:\orders.dbf in
> > C:\InetPub\wwwroot\pappreport.php on line 81
> > COULD NOT OPEN DB
> >
> > Yes, the database exists, as I copied it FROM here to C:\ to do my test.
> >
> > Any ideas??? I have checked the PHP.INI file, and all the regular
settings
> > in IIS - and could not find anything misconfigured.. but I am by no
means
> an
> > IIS expert, so I am not sure.
> >
> > Thanks in advance
> > Dave
> >
> >
> >
> >
> > --
> > 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] php & JavaScript

2002-06-24 Thread Jim lucas

nope, theres nothing in apache that needs to be setup for js to be used.
does your js file have any php in it?
when you say that you couldn't get it to work, do you mean that the include
doesn't work or that the js doesn't work on the page that you are including
it to?

Jim Lucas
- Original Message -
From: "Luis Miguel N. Tavora" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 4:28 AM
Subject: [PHP] php & JavaScript


> Hi there.
>
> I've tried to include a simple javascript in a .php file,
> but couldn't get it to work.
>
> Actually not even the php code worked at all...
>
> Is there any specific configuration flag that needs to be
> set up in the Apache server so that the javascripts work
> correctly?
>
> Thanks in advance
>
> Luis
>
> PS- Btw, I use an Apache server on a RH72 machine
>
>
>
> --
>Luis Miguel N. Távora
>[EMAIL PROTECTED]
>
>   Message sent via Sylpheed
> sylpheed-claws.sourceforge.net
> --
>
> --
> 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] Run two separate version of Apache and Php

2002-06-24 Thread rdkurth

Hello php-general,

I need to run a separate version of Apache on the same server I also
what to use a different copy of the php.ini file with that version of
apache. I am aware that I can override most of the php.ini settings in
the httpd.conf file. But this is not what I want to do.
Php will be running as a DSO with apache. So is the only way I can do
this is to install a different copy of php to run with this version of
Apache. Or is there a way I can get the httpd.conf file to read a
different copy of php.ini




  

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


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




Re: [PHP] PHP with IIS

2002-06-24 Thread Andrew Brampton

Does the user to which ISS runs under have network permissions to access p:\
?
IIRC you need to set up ISUR_machine_name to have permission to the remote
share.

Andrew
- Original Message -
From: "Dave Leather" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 6:29 PM
Subject: [PHP] PHP with IIS


> Hello all,
>
> I am attempting to open and/or create a DBASE file on a NOVELL network.
>
> When I attemp a command such as
>   if (!dbase_open("C:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says "DB WAS OPENED - no problem...
>
> On my IIS server, I have Novell drive map to P: - I can browse this using
> explorer or in CMD I can go to P: and do DIR etc etc.
>
> When I try :
>   if (!dbase_open("P:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says :
> Warning: unable to open database P:\orders.dbf in
> C:\InetPub\wwwroot\pappreport.php on line 81
> COULD NOT OPEN DB
>
> Yes, the database exists, as I copied it FROM here to C:\ to do my test.
>
> Any ideas??? I have checked the PHP.INI file, and all the regular settings
> in IIS - and could not find anything misconfigured.. but I am by no means
an
> IIS expert, so I am not sure.
>
> Thanks in advance
> Dave
>
>
>
>
> --
> 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] session_is_registered = secure?

2002-06-24 Thread Kevin Stone

I don't know of any exploit that can start a session remotely.  Only thing I
can recommend is that you modify the default session id to prevent local
hackers from hijacking your sessions (assuming you're on an ISP and not
running your own server).  Also you should consider testing those variables
more strictly.  If you're expecting a specific value or range of values then
you should test for that instead.  For example if $login is true or false
then you should test it directly with if($login=true) since any value other
than 0 will automatically evaluate to true.

"Would you recommend adding a sepparate "check for right user&pass" within
the SCRIPT_PART again?"

When you've cleared the user once why would you need to do it again on the
same page?  :)

-Kevin

- Original Message -
From: "Duncan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 9:53 AM
Subject: [PHP] session_is_registered = secure?


Hi there,

i created a session based login and in order to enter the selected part of
the script, i check for the passed variable and if the session is
registered, which only happens, if the user password is right.

So, currently i am checking for:

else if (($login)&&(session_is_registered('login_user')))
{
...SCRIPT_PART...
}

However, can this be exploited?
I mean, would it be possible for a user to forge the
"session_is_registered('login_user')" and so gain access to that part of the
script?

Would you recommend adding a sepparate "check for right user&pass" within
the SCRIPT_PART again?

Regards,

Duncan




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




Re: [PHP] function definition causing problems?

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 01:30  PM, Ford, Mike [LSS] wrote:

> You can use:
>
>echo "This script is called {$_SERVER['PHP_SELF']}";
>echo "This script is called ${_SERVER['PHP_SELF']}";
>echo "This script is called $_SERVER[PHP_SELF]";
>
> or even
>
>echo "This script is called " . $_SERVER['PHP_SELF'];

Oh.  Well, thanks for clarifying -- I always use the concat (last) 
method myself, but this settles an incorrect assumption I'd been 
carrying around for months.  You're batting two for two today. ;)


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] function definition causing problems?

2002-06-24 Thread Rasmus Lerdorf

Not inside a quoted string.

On Mon, 24 Jun 2002, Johnson, Kirk wrote:

> I thought this syntax, an unquoted key name, was deprecated ;)
>
> >From the manual at http://www.php.net/manual/en/language.types.array.php:
>
> "You should always use quotes around an associative array index."
>
> Kirk
>
> > Nope, use:
> >
> > echo "This script is called $_SERVER[PHP_SELF]";
>
> --
> 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] function definition causing problems?

2002-06-24 Thread Johnson, Kirk

I thought this syntax, an unquoted key name, was deprecated ;)

>From the manual at http://www.php.net/manual/en/language.types.array.php:

"You should always use quotes around an associative array index."

Kirk

> Nope, use:
> 
> echo "This script is called $_SERVER[PHP_SELF]";

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




[PHP] PHP with IIS

2002-06-24 Thread Dave Leather

Hello all,

I am attempting to open and/or create a DBASE file on a NOVELL network.

When I attemp a command such as
  if (!dbase_open("C:\\orders.dbf",2)){
   print "COULD NOT OPEN DB";
  }else{
   print "DB WAS OPENED";
  }

I receive a message that says "DB WAS OPENED - no problem...

On my IIS server, I have Novell drive map to P: - I can browse this using
explorer or in CMD I can go to P: and do DIR etc etc.

When I try :
  if (!dbase_open("P:\\orders.dbf",2)){
   print "COULD NOT OPEN DB";
  }else{
   print "DB WAS OPENED";
  }

I receive a message that says :
Warning: unable to open database P:\orders.dbf in
C:\InetPub\wwwroot\pappreport.php on line 81
COULD NOT OPEN DB

Yes, the database exists, as I copied it FROM here to C:\ to do my test.

Any ideas??? I have checked the PHP.INI file, and all the regular settings
in IIS - and could not find anything misconfigured.. but I am by no means an
IIS expert, so I am not sure.

Thanks in advance
Dave




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




RE: [PHP] function definition causing problems?

2002-06-24 Thread Ford, Mike [LSS]

> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: 24 June 2002 18:12
> 
> On Monday, June 24, 2002, at 12:15  PM, Johnson, Kirk wrote:
> 
> > When you echo out an array element, the name needs to be enclosed in
> > curlies, e.g.,
> >
> > echo {$_SERVER['PHP_SELF']}
> 
> I think that this is only important when using an associative array 
> element reference within certain kinds of quotes.  Like this:
> 
> // this won't work b/c of quoting issues
> echo "This script is called $_SERVER["PHP_SELF"]";
> 
> // this should work fine IIRC
> echo "This script is called $_SERVER['PHP_SELF']";

Nope.  Quoted array indexes don't work inside strings.

> // this should also work if for some reason you needed
> // to use double quotes within the array element reference
> // (to interpolate a variable, for instance)
> echo "This script is called {$_SERVER["PHP_SELF"]}";

Nope.  The {} don't change the quoting issues you mentioned in your first 
(non-working) example.

> // and this is the same thing really
> echo "This script is called ${_SERVER["PHP_SELF"]}";

... and fails for the same reason!

You can use:

   echo "This script is called {$_SERVER['PHP_SELF']}";
   echo "This script is called ${_SERVER['PHP_SELF']}";
   echo "This script is called $_SERVER[PHP_SELF]";

or even 

   echo "This script is called " . $_SERVER['PHP_SELF'];

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




  1   2   >