Re: [PHP] if inside an echo.

2007-07-31 Thread Neil Freeman
Or another way...

for ($value = 0; $value <= 2000; $value += 100)
{
echo sprintf("%s", $value, 
(($min_rent==$value) ? " selected=\"selected\"" : NULL), $value);
}

Hulf wrote:
> **
> This Email Has Been Virus Swept
> **
> I am outputting a selectbox and want to do the follwoing. How can I add the 
> IF statement inside the the echo?
> 
> 
> for ($value = 0; $value <= 2000; $value += 100) {
> 
>  echo " selected="selected" }> $value";
> 
>   }
> 

***
ATTENTION: E-mail addressed to the
[EMAIL PROTECTED] will only be delivered for a limited
period. Please update your address book using the
"From" address on this e-mail.

This communication is confidential to the intended
recipient(s). If you are not that person you are not
permitted to make use of the information and you are
requested to notify the sender immediately of its receipt
and then destroy the copy in your possession.  Any views
or opinions expressed are those of the originator and may
not represent those of L-3 Communications ASA Ltd.

Sent from L-3 Communications ASA Ltd.
Registered in England and Wales Company No. 1730717
Registered Office: 5th Floor, Chiswell Street, London EC1Y 4UP
***
This Email has been Virus Checked
***

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



Re: [PHP] Underscores within echo statements

2004-09-07 Thread Neil Freeman
Marek Kilimajer wrote:
***
This Email Has Been Virus Swept
***
Neil Freeman wrote:
Just a quick question. What is the purpose of the underscore character 
within the following echo statement? I had a quick look in the manual 
and archives but couldn't find any reference to it.



see gettext extension
Thanks,
Neil

Could you turn this of?
This communication is confidential to the intended recipient(s). If 
you are not that person you are not permitted to make use of the 
information and you are requested to notify the sender immediately of 
its receipt then destroy the copy in your possession. Any views or 
opinions expressed are those of the originator and may not represent 
those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

OK - great. Thanks for the quick reply John and Marek.
Marek - sorry about the rather lengthy signature. It's appended to all 
e-mails sent out by our company and is therefore out of my hands :(

This communication is confidential to the intended recipient(s). If you are not 
that person you are not permitted to make use of the information and you are requested 
to notify the sender immediately of its receipt then destroy the copy in your 
possession. Any views or opinions expressed are those of the originator and may not 
represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Underscores within echo statements

2004-09-07 Thread Neil Freeman
Just a quick question. What is the purpose of the underscore character 
within the following echo statement? I had a quick look in the manual 
and archives but couldn't find any reference to it.


Thanks,
Neil
This communication is confidential to the intended recipient(s). If you are not 
that person you are not permitted to make use of the information and you are requested 
to notify the sender immediately of its receipt then destroy the copy in your 
possession. Any views or opinions expressed are those of the originator and may not 
represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using php_value in .htaccess files

2004-08-24 Thread Neil Freeman
[EMAIL PROTECTED] wrote:
***
This Email Has Been Virus Swept
***
Is there anything special one has to do in order to enable the use of the "php_value" 
directive in the context of an apache .htaccess file?
I notice that on some hosts I can drop in something like:
php_value auto_prepend_file groove.php
with impunity. Other hosts, it causes Apache to generate an internal
server error. 

-Weston
Although this may not be your problem it's always a good idea to test 
for the existence of the module before attempting to change any of it's 
values:


php_value auto_prepend_file "groove.php"

Neil
This communication is confidential to the intended recipient(s). If you are not 
that person you are not permitted to make use of the information and you are requested 
to notify the sender immediately of its receipt then destroy the copy in your 
possession. Any views or opinions expressed are those of the originator and may not 
represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help Loading MySQL Extension with PHP5/Apache1.3

2004-08-12 Thread Neil Freeman
John Holmes wrote:
***
This Email Has Been Virus Swept
***
Okay... I've done this before but can't get it working now. I've got 
PHP5 working correctly, but I'm trying to load the MySQL php_mysql.dll 
file. I'm using Apache 1.3 on Windows XP.

No matter what I use for extension_dir in php.ini, it can't seem to find 
the file. An error dialog will pop up saying "Unable to load dynamic 
library 'c:\php\ext\php_mysql.dll' - The specified module could not be 
found." even though that's where the [EMAIL PROTECTED]@ file is!

I've tried putting the .dll in c:\php and c:\windows\system32, also, but 
I always get the same error even though the path it shows in the error 
is the correct path. I've tried c:/php, c:/php/ext/, c:\php\ext, c:\php, 
blank, etc with and without trailing slashes...

The "everyone" user has full control over the entire c:\php directory 
and subdirectories.

Any ideas? Going back to PHP4 until I can get this sorted out...
Examples from Apache error log of paths to file apache couldn't find:
'\php\ext\php_mysql.dll'
'c:/php/ext\php_mysql.dll'
'c:/php/ext\php_mysql.dll'
'c:\php\ext\php_mysql.dll'
'c:/php/ext/php_mysql.dll'
'c:\php\ext\php_mysql.dll'
'./php_mysql.dll'
'c:/php/ext/php_mysql.dll'
'c:\php\ext\php_mysql.dll'
'c:/php/ext\php_mysql.dll'
'c:/php/ext\php_mysql.dll'
'\php\ext\php_mysql.dll'
'c:/php/ext/php_mysql.dll'
'c:\windows\system32\php_mysql.dll'
I had a similar problem which I eventually resolved. Here are my settings:
  extension_dir = "C:/PHP/ext/"
  extension=php_mysql.dll
Remember to copy 'libmysql.dll' to your Windows System directory (e.g. 
C:\Windows\System32\). If I remember correctly I also had to remove PHP 
4's 'php4ts.dll' from the System directory - maybe this was just getting 
PHP5 running though?

Restart Apache and hope for the best.
Neil
This communication is confidential to the intended recipient(s). If you are not 
that person you are not permitted to make use of the information and you are requested 
to notify the sender immediately of its receipt then destroy the copy in your 
possession. Any views or opinions expressed are those of the originator and may not 
represent those of Advanced System Architectures Ltd.
*** This Email Has Been Virus Checked ***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Control structure - easier way than repeating conditions in IF?

2004-04-30 Thread Neil Freeman
Why not just use a switch?...

switch ($x) {
case $a:
case $b:
case $c:
case $d:
//do whatever you need
break;
default:
//catch any other values here
break;
}
Neil

BOOT wrote:
***
This Email Has Been Virus Swept
***
Hello!

Can anyone tell me if there is an easier/shorthand for:

if  (($x == $a) || ($x == $b) || ($x == $c) || ($x == $d) ... ) {;}

I understand the logic of why the following does not work:

if   ($x == ($a || $b || $c || $d)) {;}



Thanks!

--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Neil Freeman
Take a look at explode()

www.php.net/explode

Neil

Jeff Oien wrote:
***
This Email Has Been Virus Swept
***
If I have a list like this:
Firstname1 LastName1
Firstname2 Lastname2
etc.
I can split the names by \n to put them into
an array which will then be output into an 
list for a form. But how do I reverse the names
so that the last name is first? Also, how do I
handle people with three names? Thanks.
Jeff Oien
--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] $_GET, expressions and conditional statements

2004-03-11 Thread Neil Freeman
How about this - untested by the way:

$order = "ASC";

if (isset($_GET["ORDER"]))
{
$value = $_GET["ORDER"];
if (($value == "ASC") || ($value == "DESC"))
{
$order = $value;
}
else if ($value == "RAND")
{
$order = "RAND()";
}
}
$SPORDER = $order;



I.A. Gray wrote:

***
This Email Has Been Virus Swept
***
Hi everyone,

I know this is probably really simple, but I am not very good at expressions
and conditional statements.  I am wanting to show a list from a MYSQL
database.  I am using the URL to store the variables that control the
output.  The variable $ORDER can be set to ASC (Ascending), DESC (Descending
and RAND (Random).  What I want the script to do is set $SPORDER to this
value.  If $_GET['ORDER'] is not set then it gets the default value (ASC),
if this is any other than ASC, DESC or RAND (ie. someone has messed with the
variables in the URL) then it also gets the default (ASC). Finally if
$_GET['ORDER'] is set to RAND then I want $SPORDER to equal RAND() so that I
can use the value in the SQL query.
Here is part of the script:



if (!isset($_GET['ORDER'])) { // Checks if the 'ORDER' 
variable from the
URL is set.  If it is NOT set the following happens...
$SPORDER = "ASC"; // The variable $SPORDER is given 
the value ASC, since
ASC (Ascending Order) is the default value.
}
else { // The following happens if the 'ORDER' 
variable IS set...
$SPORDER = $_GET['ORDER']; // The variable 
$SPORDER is given the value
of the variable 'ORDER' taken from the URL.
if  ( (($SPORDER !== "ASC") && ($SPORDER !== "DESC")) 
&& ($SPORDER !==
"RAND")) { // If the variable $SPORDER does NOT have the value of either
"ASC" (Ascending), "DESC" (Descending) or "RAND" (Random) then the following
happens...
$SPORDER == "ASC";  // The variable 
$SPORDER is given the default
value "ASC"
}
else { // If the variable $SPORDER DOES have the value 
of either "ASC",
"DESC" or "RAND" then the following happens...
if ($SPORDER == "RAND") { // If $SPORDER has the 
following of "RAND"
(Random Order) then...
$SPORDER == "RAND()"; // $SPORDER is 
given the value "RAND()" which
is the correct value for submission to the MYSQL query.
}
}
	} // End of the Conditional Statements regarding the ORDER variable.

?>

I think the problem part could be: if  ( (($SPORDER !== "ASC") && ($SPORDER
!== "DESC")) && ($SPORDER !== "RAND"))
I am trying to say if $SPORDER does not equal "ASC", "DESC" or "RAND" then
do the following.  There maybe other problems in my code as well that are
not making this work.  I would be grateful if you could shed some light on
it!
Best wishes,
Ian Gray
--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] Re: Parse error ???

2004-03-04 Thread Neil Freeman
If I remember correctly the second parameter of move_uploaded_file() 
needs to be the full filename, ie path plus required filename.

so...

if(!move_uploaded_file($_FILES['myfile']['tmp_name'],
("/var/www/html/upload/" . $_FILES['myfile']['name'])))
Neil

Mike Mapsnac wrote:

***
This Email Has Been Virus Swept
***
brackets solve the probleb. But why I have the warning messages? The 
permission on the directory is correct. Any ideas what can cause such 
messages?

Warning: move_uploaded_file(/var/www/html/upload/): failed to open 
stream: Is a directory in /var/www/html/uploadproc.php on line 11

Warning: move_uploaded_file(): Unable to move '/tmp/phpiMrdlQ' to 
'/var/www/html/upload/' in /var/www/html/uploadproc.php on line 11
Error Moving the uploaded file failed.


From: Michael Nolan <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Parse error ???
Date: Thu, 04 Mar 2004 13:40:46 +
Mike Mapsnac wrote:

The script should upload files (images).

Error message is give below, any ideas why I get this errror message?
Parse error: parse error in /var/www/html/uploadproc.php on line 3
die() needs brackets around its arguments, eg:

die("Error! The expected file wasn't a part of the submitted form");

Mike

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
One-click access to Hotmail from any Web page – download MSN Toolbar 
now! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/

--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] Unexpected ";"

2004-02-19 Thread Neil Freeman
You're missing a right bracket within the if statement.

Paul Furman wrote:
***
This Email Has Been Virus Swept
***
I don't see what's wrong with this if statement:

while ... and ... {
  if (($pic_num + 1) <= $thumb_num {
 $tab = ((($pics * $page) - 1) + $pic_num); }
Error unexpected ";" on the last line there.

I added some extra () to make sure I had everything together & not two 
statements or something odd like that. The while loop above works with 
the if statement removed.

--
--
 www.curvedvision.com
--
This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] how to open a webpage

2004-01-12 Thread Neil Freeman
Or with PHP you could do:

Header("Location:$launch");
die;
Make sure that nothing is outputted before this is called though. The 
variable $launch should also be an absolute URL.

Neil

Richard Davey wrote:

***
This Email Has Been Virus Swept
***
Hello bernard,

Monday, January 12, 2004, 1:47:39 PM, you wrote:

b> I have a field with an URL
b> The value of this in a variable $launch.
b> How can I open this URL automatically ??

PHP itself cannot open a web page, it's a server-side language and
doesn't have any control over the client like that.
What it can do however is echo out the HTML required to make it
happen. Either some JavaScript, or a link with the TARGET attribute
set to be $launch.
--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] PHP function for length of the array???

2004-01-06 Thread Neil Freeman
Or you can use sizeof() which is an alias for count()

Scott Fletcher wrote:
***
This Email Has Been Virus Swept
***
Ah!  Thanks!!!

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
At 15:44 6-1-04, you wrote:

Hi!

  Anyone know what is the php function for finding the length of the
array?

I haven't found the answer at http://us3.php.net/manual/en/ref.array.php
.

looking for the number of elements? ->count($arrayname)


--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] Php Windows server

2003-12-19 Thread Neil Freeman
You will need to ensure that the session save path is set to a valid 
directory:

e.g.

session.save_path = "C:/Temp"

Neil

E. Ricardo Santos wrote:

***
This Email Has Been Virus Swept
***
Somebody could say to me if something special exists to form for the
treatment of the sessions in a Php Windows server?


I have   a code  that works perfectly in Apache, nevertheless, when
executing it  in a Windows server the sessions do not activate.




 I am using php 4.3.3 like ISAPI. There is something I must define in
php.ini?
Thanks

--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] CHMOD...

2003-12-04 Thread Neil Freeman
How about:

exec("chmod -R 755 /somedir/");

[EMAIL PROTECTED] wrote:
***
This Email Has Been Virus Swept
***
Is there anyway to use CHMOD:

chmod ("/somedir/somefile", 0755);

but have it set all files, folders etc to the CHMOD setting I want?

I have a folder, and within that, I wanna quickly, jsut set it all to 
CHMOD 777.
all sub DIR's and files etc...

can it be done simply?

E.G. :
chmod ("/somedir/%", 0755);
*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***


--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] Re: Calculating difference between two timestamps

2003-11-27 Thread Neil Freeman
Perfect - thanks Bogdan

Bogdan Stancescu wrote:

***
This Email Has Been Virus Swept
***
Neil Freeman wrote:

Hi there,

Does anyone have any suggestions as to how I can calculate whether one 
timestamp is within one second of another timestamp.

e.g.

Timestamp 110:59:59
Timestamp 211:00:00
Essentially I need to create a function which'll take two parameters 
and return whether the two parameters are within one second of each 
other.

Any suggestions would be great.

Neil


Have you looked at http://www.php.net/manual/en/function.mktime.php?

Bogdan

--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


[PHP] Calculating difference between two timestamps

2003-11-27 Thread Neil Freeman
Hi there,

Does anyone have any suggestions as to how I can calculate whether one 
timestamp is within one second of another timestamp.

e.g.

Timestamp 110:59:59
Timestamp 211:00:00
Essentially I need to create a function which'll take two parameters and 
return whether the two parameters are within one second of each other.

Any suggestions would be great.

Neil
--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] getallheaders() in PHP 4.2.3

2003-07-16 Thread Neil Freeman
I believe getallheaders() has been supported since v4.0.0

Ananth Kesari wrote:

***
This Email Has Been Virus Swept
***
Hi,

For some reason, getallheaders() is not working with the NetWare port
of PHP 4.2.3 even while we have not modified the related code for
NetWare as such. So, I am just wondering if getallheaders() is
implemented for PHP 4.2.3? The document doesn't mention from which PHP
version this supported. But it does mention that in PHP 4.3.0 and above,
getallheaders() is aliased to apache_request_headers().
Thanks,
Ananth.

--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


Re: [PHP] How do I replace browser history using Header()?

2003-06-14 Thread Neil Freeman
Hmmm. As I thought. Thanks anyway Mark.

Neil

Mark Charette wrote:
***
This Message Was Virus Checked With : SAVI 3.70 June 2003
Last Updated/Checked 12th June 2003 
***




-Original Message-
From: Neil Freeman [mailto:[EMAIL PROTECTED]
Is there any way that I can do a PHP Header() statement that does the 
equivalent of JavaScript's 
window.self.location.replace("http://www.mysite.com/mypage.php";)?


No. JavaScript (if turned on) is your only choice.

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


[PHP] How do I replace browser history using Header()?

2003-06-14 Thread Neil Freeman
Hi,

I am using Header("Location:http://www.mysite.com/mypage.php";); to do a 
browser redirect. This works fine. The problem though is that doing this 
adds a page to the browser's window.self.history() collection.

Is there any way that I can do a PHP Header() statement that does the 
equivalent of JavaScript's 
window.self.location.replace("http://www.mysite.com/mypage.php";)?

In other words I would like to use PHP's Header statement to replace the 
current page in the brower's history, not just add another location onto 
the collection.

Any help much appreciated.

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


Re: [PHP] header() and mozilla - HELP!

2003-06-14 Thread Neil Freeman
Ensure that you have a die; after the Header() line.

Neil

deno vichas wrote:
*** 

This Message Was Virus Checked With : SAVI 3.70 June 2003
Last Updated/Checked 12th June 2003 
*** 

i'm runnig into a random problem of having all the headers being 
displayed instead on the actual web page in mozilla, Ie doesn't seem to 
suffer from this, when using header("location: www.url.com");  this is 
happening randomly.  has anybody seen this or have a fix?

-deno

i'm running:

php 4.3.2
apache 1.3.27
redhat 8.0
php is configed with:
'./configure' '--prefix=/usr/local' 
'--with-apache=/home/deno/Apachetoolbox-1.5.66/apache_1.3.27' 
'--enable-exif' '--enable-track-vars' '--with-calendar=shared' 
'--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' 
'--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit' 
'--with-mcrypt=/usr/local' '--with-pdflib=/usr/local' 
'--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-zlib-dir=/usr' 
'--with-openssl=/usr/local/ssl' '--with-curl=/usr' '--with-dom=/usr' 
'--with-zlib-dir=/usr' '--with-pgsql' '--with-ldap'


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


Re: [PHP] setlocale() changes?

2003-06-04 Thread Neil Freeman
Try removing the double quotes around LC_TIME

Neil

Mike At Spy wrote:
***
This Message Was Virus Checked With : SAVI 3.69 May 2003
Last Updated/Checked 2nd June 2003 
***

I've been getting a warning on one of my scripts since I upgraded from 4.1.2
to the most recent version of PHP.  The warning is:
Warning: setlocale(): Passing locale category name as string is deprecated.
Use the LC_* -constants instead
The script at the line that is failing sez:

setlocale ("LC_TIME", "$locale");

This script isn't mine off hand - what do I look for?  I'm not sure I
understand the error message.  :\
Thanks!

-Mike



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


Re: [PHP] RE: [newbie] embed php in html file

2003-04-04 Thread Neil Freeman
Take a look at auto_prepend_file within php.ini

Bobby Rahman wrote:
*** 

This Message Was Virus Checked With : SAVI 3.66 February 2003
Last Updated 2nd April 2003
*** 



Hiya

I need advice for an optimum solution to display the username that is 
logged in on every html form page of my application.

I have a header.php :

session_start();
echo "Logged in 
as: ".$_SESSION['curr_user']."";
?>

Now I have many html forms which user's see
What I want to know is how to include the header.php into every html 
form page.

One way is to rename the html file with extension .php
then

This seems a bit wasteful for one line of php to change all the forms to 
.php. Is there any other ways of embedding the header.php file in html 
forms.The reason I am so keen on keeping html and php files seperate is 
thus to make debugging easier and maintain a kinda three tier design.

Any suggestions will be much appreciated

Bob

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger


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


Re: [PHP] Newbie Questions

2003-01-21 Thread Neil Freeman
Have a look on devshed.com

Bryan Cassidy wrote:

Could someone point me to a VERY good doc for learning PHP for a
NEWBIE!!! Something I can understand from the beginning to the end. YES
I am willing to put my time into learning and reading docs as long as
they are clear and made for what they say they are made for. I wont
waste my time with something for a second if it isn't clear to me and
easy to understand. Thanks in advance.


--
--
 www.curvedvision.com
--


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




Re: [PHP] $header = "Location:........" being ignored!

2003-01-21 Thread Neil Freeman
Looks like you're missing a closing bracket on the IF statement as well.

Neil

Shams wrote:

**
This Message Was Virus Checked With : SAVI 3.61 September 2002 
Last Updated 17th January 2003
**

Hi Group,

I basically have some simple code such as:

==

if ( $_POST['passwd'] != $db['password']
{header("Location: loginfailed.html");
}

//else

$header = "Location: success.html";

==

however, when I run this code, using a  to submit password, username,
etc.. if the passwords do not match, the page is forwarded to
success.html !

Is there anything obvious that I am doing wrong?

Thanks,
Shams

p.s. I don't want to use else{} because I have lots of if() checks!




--
--
 www.curvedvision.com
--


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




Re: [PHP] PHP Editors

2003-01-07 Thread Neil Freeman
Take a look at Maguma Studio Light (www.maguma.com)

Neil

Nilza Lafayette wrote:

**
This Message Was Virus Checked With : SAVI 3.61 September 2002 
Last Updated 2nd January 2003
**

I'm running Apache 2.0 as a service and PHP (like a
 module) onto a Windows Advanced Server. I´m looking
 for a good and free Editor to use with PHP (With
debugging features). Can anyone with experience guide
me?

Thanks.
Janine.


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


--
--
 www.curvedvision.com
--


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




Re: [PHP] Display character 'x' times

2002-11-19 Thread Neil Freeman
str_repeat ()

Tjoumaidis Tasos wrote:


** 

This Message Was Virus Checked With : SAVI 3.61 September 2002 Last 
Updated 15th November 2002
** 


Hello to everybody,

I just want to display a character like D x times like DDD where x is 
a $variable i get from the database i cannot make it work like it is 
on perl (i don't even know if it is working the same way) and i can't 
find a reference in the manual on php.net, maybe it's a silly question 
but i am stuck at this moment.

Thx in advance.



--
--
www.curvedvision.com
--



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




Re: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread Neil Freeman

www.aletia.com

db or not db wrote:
> **
> This Message Was Virus Checked With : SAVI 3.60 May 2002 
> Last Updated 16th August 2002
> **
> 
> They (futurequest) really are impressive, but 39.95/month is a little pricey
> for me...if they offered MySQL with the basic plans (with 1-2 db's instead
> of 6) I'd go for it.  The site I'm handling is for a small mortgage company
> so the 39.95/mo plan is overkill for their needs.
> 
> Anyone else with a suggestion for a good (<$20) basic php+mysql provider?
> 
> -Kirk
> 
> 
> "Met" <[EMAIL PROTECTED]> wrote in message
> 001f01c2485a$8e265ad0$6901a8c0@SURVIVAL">news:001f01c2485a$8e265ad0$6901a8c0@SURVIVAL...
> 
>>http://www.futurequest.com
>>
>>Fantastic!!
>>
>>~ Matthew
>>
>>-Original Message-
>>From: db, or not db [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, August 20, 2002 11:01 AM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] suggestions for a good php+mysql isp?
>>
>>
>>I have searched the archives and the last time this was seriously
>>discussed was september of last year...unless I have a giant gaping hole
>>in my archive!  :)  I was considering northwesthost.com and would like
>>some opinions on them or anybody you are happy with  The list of isp's
>>on php.net doesn't mean much to me without some current comments about
>>their performance. I need php and mysql support for my site - I'm moving
>>the domain name and site from myhosting.com (they're ASP and perl2exe'd
>>scripts only).  TIA!
>>
>>-Kirk
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 
> 


-- 
--
  www.curvedvision.com
--


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




Re: [PHP] Extensions?

2002-08-13 Thread Neil Freeman

Try this instead...

extension_dir = "C:/PHP/extensions/"

and ensure that the GD section is present in phpinfo() output.

Neil

Php wrote:
> **
> This Message Was Virus Checked With : SAVI 3.60 May 2002 
> Last Updated 8th August 2002
> **
> 
> I'm trying to configure my php.ini file on my local Windows 2000 system so I
> can use the extensions such as GD, etc. I have changed the line:
> 
> extension_dir = C:\php\extensions  ; (which is where php_gd.dll resides)
> 
> and uncommented:
> 
> extension=php_gd.dll
> 
> and when I restart the web service and hit a page, I get the error:
> 
> Unable to load dynamic library .  the specified procedure could not be
> found.
> 
> Any ideas?
> 
> Thanks!
> 
> 
> 


-- 
--
  www.curvedvision.com
--


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




Re: [PHP] .htaccess file

2002-08-01 Thread Neil Freeman

php_value register_globals "0"

B i g D o g wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> Is it possible to set register_globals to off in the .htaccess file.  If so
> how do I do that?
> 
> 
> .: B i g D o g :.
> 
> 
> 
> 


-- 
--
  www.curvedvision.com
--


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




[PHP] Coding PHP with register_globals off

2002-07-30 Thread Neil Freeman

Seeing as a question concerning register_globals seems to be posted 
every day - I thought this link might be useful to some:

http://www.zend.com/zend/art/art-sweat4.php

Neil
-- 
--
  www.curvedvision.com
--


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




Re: [PHP] Newbie needs help

2002-07-24 Thread Neil Freeman

mysql_db_query has been depreciated since PHP 4.0.6

ctan wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> Whats the difference between 'mysql_db_query' and 'mysql_query'?
> 


-- 
--
  www.curvedvision.com
--


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




Re: [PHP] Newbie's question about \n

2002-07-22 Thread Neil Freeman

nl2br()

KK Lee wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> Dear ALL,
> 
> It seems that i have a very silly problem.
> I can't get the new line escape character to work.
> the following is my SIMPLE script and corresponding output.
> 
> 
> PHP script:
> "-//W3C//DTD HTML 4.0 Transitional//EN"
>"http://www.w3.org/TR/html4/loose.dtd"; >
> 
> 
>   TEST
> 
> 
>echo "this should be printed out:\n";
> echo "this is a second line";
>   ?>
> 
> 
> 
> 
> Output in IE6:
> this should be printed out: this is a second line
> 
> 
> regards,
> 
> KK
> 
> 
> 
> 


-- 
--
 www.curvedvision.com
--


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




Re: [PHP] Development Tools

2002-07-10 Thread Neil Freeman

Maguma Studio Light is pretty good - www.maguma.com

Mark McCulligh wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> I am looking for a good Development tool to write my PHP in and was
> wondering what people are using out there.
> 
> I have been looking at Dreamweaver MX, Zend Studio 2.5 and phpEdit.
> I know UltraDev 4 well with ASP, but the new MX now supports PHP.  This
> MX/PHP any good?  Zend looks good with the integrated documentation and
> debugging tools.
> 
> Thanks, Mark.
> _
> Mark McCulligh, Application Developer / Analyst
> Sykes Canada Corporation www.SykesCanada.com
> (888)225-6824 ex. 3262
> [EMAIL PROTECTED]
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Dos Paths

2002-07-10 Thread Neil Freeman

FYI - Works in Windows NT 4 SP 6a as well.

[EMAIL PROTECTED] wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> Hi all,
> 
> It's actually rather easy.
> 
>  $str_test = passthru("dir /x c:\\myfolder\\");
> 
>>?
> 
> 
> After this it's just a matter of parsing the dirlist and extracting the
> right string...
> 
> Regards
> Joakim Andersson
> 
> PS. dir /x works in Windows 2000, not sure about the others... DS.
> 
> 
> 
>>-Original Message-
>>From: BB [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, July 10, 2002 2:15 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Dos Paths
>>
>>
>>I've got an application that requires dos folder names (8.3 
>>standard) as
>>input.
>>
>>I also have PHP, which quite happily can cope with both.
>>
>>Can someone help me write a function to translate full paths 
>>to dos paths
>>
>>Thanks
>>
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Now a Question for all you ARRAY Junkies

2002-07-10 Thread Neil Freeman

Have a look at sort()

vins wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **
> 
> I have an array
> $Lang = array('English','German','French','Zulu');
> I want it in alphabetical order
> 
> do i reset the arrray first or usort it first 
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] function for size of array

2002-07-05 Thread Neil Freeman

LOL - nice one Jason :)

Jason Wong wrote:
> **
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 3rd July 2002
> **
> 
> On Friday 05 July 2002 22:20, Scott Fletcher wrote:
> 
>>Ah!  Thanks!  By the way, it's "count()" with a "n".  :-)
> 
> 
> That was to trick you into RTFM! Hey you were lucky that the 'o' wasn't left 
> out instead :)
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Deleting a read-only file (Windows)

2002-06-26 Thread Neil Freeman

According to the manual "This function is not implemented on Windows 
platforms". Gave it a go though and it works!

Cheers Dan,

Neil

Analysis & Solutions wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 14th June 2002
> **
> 
> On Wed, Jun 26, 2002 at 11:34:10AM +0100, Neil Freeman wrote:
> 
>>I'm trying to delete a file using PHP's unlink() function (on Windows). 
>>This works fine on writable files but fails when trying to delete 
>>read-only files. How can I delete read-only files? Is there a function 
>>available to change the permissions?
> 
> 
> Untested, but try setting permissions on the file via chmod('name', 0777).
> 
> --Dan
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] file_exists()

2002-06-26 Thread Neil Freeman

You're right - the example is wrong.

Neil

Anthony Ritter wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 14th June 2002
> **
> 
> 
> I have a question about the PHP function file_exists():
> 
> This is taken from a textbook entitled "PHP Professional Projects" by
> Wilfred, Gupta, Bhatnagar (Premier Press 2002 - ISBN1-931841-53-5) on page
> 261 under the chapter titled "Handling Files".
> 
> The authors write...
> 
> "Consider the following code to understand the file_exists() function.
> 
>  if (!(file_exists("data.dat")))
>  {
>   echo "The file exists";
>  }
> else
>  {
>   echo "The file does not exist.";
>  }
> 
> "In the above code, the existence of the file data.dat is being verified
> with the help of the statement if (file_exists("data.dat")).
> 
> [End of quote]
> .
> 
> What I don't understand is why the author(s) have put the negation symbol of
> 
> !
> 
> in the preceding code.
> 
> It would seem to follow that in plain English that the above code statement
> would read as...
> 
> If the file data.dat does *not* exist  - then execute the following
> condition which will print to the browser:
> "The File exists."
> 
> Huh?
> 
> Please advise.
> Thank you.
> 
> Tony Ritter
> 
> 
> 
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Deleting a read-only file (Windows)

2002-06-26 Thread Neil Freeman

unlink() works fine apart from when trying to delete read-only files. 
Thanks for the suggestion anyway.

Neil

Lowell Allen wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 14th June 2002
> **
> 
> 
>>From: Neil Freeman <[EMAIL PROTECTED]>
>>
>>I'm trying to delete a file using PHP's unlink() function (on Windows).
>>This works fine on writable files but fails when trying to delete
>>read-only files. How can I delete read-only files? Is there a function
>>available to change the permissions?
>>
> 
> I thought unlink() did not work on Windows. Notes in the manual suggest this
> for Windows:
> 
> system("del name.ext");
> 
> --
> Lowell Allen
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




[PHP] Deleting a read-only file (Windows)

2002-06-26 Thread Neil Freeman

Hi there,

I'm trying to delete a file using PHP's unlink() function (on Windows). 
This works fine on writable files but fails when trying to delete 
read-only files. How can I delete read-only files? Is there a function 
available to change the permissions?

Any help greatly appreciated.

Neil

-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Is there a replicate function in PHP

2002-06-21 Thread Neil Freeman

echo str_repeat("*", 50);

Don wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 14th June 2002
> **
> 
> Hi,
> 
> I'd like to print one or more specific characters many times. For example, let's say 
>I'd like to display the '*' 50 times on one line.  Is there a function that will do 
>this?  Something like:
> 
> ? replicate('*',50);
> 
> Thanks,
> Don


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Nested IF's (Is there a LIMIT ?)

2002-06-14 Thread Neil Freeman

Maguma Studio for PHP Light will do the job.

Neil

Daniel Negron/KBE wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 11th June 2002
> **
> 
> 
> I am too lazy to count your braces for you, but no, there's not really a
> limit to how many ifs you can nest.
> 
> It helps to use an editor that flashes the bracket's companion when you
> type or edit one. That way you can easily see whether they're balanced in
> the right place.
> 
> »»»  Do you happen to have the name of  an editor that does that ?  I am
> using dreamweaverMX and UltraEdit, also have EditPlus and TextPad.just
> is case it was one of them.
> 
> 
> Thank You
> 
> <><><><><><><><><><><><><><><><>
> 
> Daniel Negrón
> Lotus Notes Administrator / Developer
> KB Electronics, Inc.
> 954.346.4900x122
> http://www.kbelectronics.com
> 
> <><><><><><><><><><><><><><><><>
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




php-general@lists.php.net

2002-06-11 Thread Neil Freeman

That's perfect Michael. Thanks a lot for your help :)

Neil

Michael Weinberger wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 11th June 2002
> **
> 
> 
> $x = preg_replace( "/([^\s&])&([^\s&])/", "$1&&$2", $x );
> should do the job.
> Michael
> 
> Neil Freeman <[EMAIL PROTECTED]> schrieb:
> 
> 
>>Hi,
>>
>>For all you Unix gurus this should be run of the mill stuff but us
>>Windows boys tend to get confused easily :)
>>
>>How can I easily match occurrences of text along the lines of R&B and
>>replace it with R&&B ?
>>
>>The regular expression s/&/&&/g obviously replaces any occurrence of an
>>ampersand with a double ampersand but I need to do a match so that it
>>only replaces instances which have non whitespace on either side of it,
>>ie \S&\S
>>
>>I think I'm along the right lines but haven't had enough experience with
>>regular expressions yet to 'finish the job'.
>>
>>Hope you can help.
>>
>>Neil
>>
>>--
>>
>>Work: [EMAIL PROTECTED]
>>Home: [EMAIL PROTECTED]
>>
>>Web:  www.curvedvision.com
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




php-general@lists.php.net

2002-06-11 Thread Neil Freeman

Hi,

For all you Unix gurus this should be run of the mill stuff but us 
Windows boys tend to get confused easily :)

How can I easily match occurrences of text along the lines of R&B and 
replace it with R&&B ?

The regular expression s/&/&&/g obviously replaces any occurrence of an 
ampersand with a double ampersand but I need to do a match so that it 
only replaces instances which have non whitespace on either side of it, 
ie \S&\S

I think I'm along the right lines but haven't had enough experience with 
regular expressions yet to 'finish the job'.

Hope you can help.

Neil

-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




Re: [PHP] Using Sessions under Win98/Apache

2002-05-16 Thread Neil Freeman

FYI...

I'm using sessions successfully using PHP v4.1.0 on Windows NT.

Neil

Edward Marczak wrote:
> 
> 
>*
> This Message Was Virus Checked With : SAVI 3.57 May 2002 Last Updated 13th May 2002
> 
>*
> 
> On 5/15/02 4:30 PM, "SHEETS,JASON (Non-HP-Boise,ex1)"
> [EMAIL PROTECTED] pressed the keys forming the message:
> 
> > Sessions under windows were broken for 4.1.x
> >
> > They were fixed in 4.2.x so you should upgrade.
> 
> Great - a definitive answer.  Thank you.  I'll just have to make note of the
> differences between 4.2.x and older versions.
> 
> Thanks everyone who sent over tips and suggestions.
> --
> Ed Marczak
> [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Neil Freeman   Design Engineer  |
| Phone: +44 (0)1420 526600  Fax  : +44 (0)1420 23741 |
| Email: [EMAIL PROTECTED]   |
|[EMAIL PROTECTED]|
| Web  : www.curvedvision.com |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

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




Re: [PHP] Retrieving name of error_log file

2002-05-02 Thread Neil Freeman

OK thanks Miguel.

Miguel Cruz wrote:
> 
> *
> This Message Was Virus Checked With : SAVI 3.54 Feb 2002
> Last Updated 24th April 2002
> *
> 
> On Wed, 1 May 2002, Neil Freeman wrote:
> > How do you obtain the value of 'error_log' (set within a .htaccess
> > file). Is there a $HTTP_x_VARS array available which contains this
> > information?
> 
> Nope. You can use phpinfo() to see what most of the predefined server
> variables are. In your case you'll have to parse the httpd.conf file
> yourself.
> 
> miguel
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]


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




[PHP] Retrieving name of error_log file

2002-05-01 Thread Neil Freeman

Hi,

How do you obtain the value of 'error_log' (set within a .htaccess
file). Is there a $HTTP_x_VARS array available which contains this
information?

Any help greatly appreciated.

Cheers,

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]


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




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Neil Freeman

if (($foo % 2) == 0)
{
echo "text";
}

Neil

Craig wrote:
> 
> *
> This Message Was Virus Checked With : SAVI 3.54 Feb 2002
> Last Updated 24th April 2002
> *
> 
> I am trying to write an if statement that says if the value $foo is
> divisible by 2 then echo "text"
> 
> i have tried mod but it isnt recognised
> 
> any ideas?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]


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




Re: [PHP] Counting number of value instances within an array

2002-04-26 Thread Neil Freeman

Sorry - don't worry. Found the function I require.

FYI : array_count_values()

Neil Freeman wrote:

> *
> This Message Was Virus Checked With : SAVI 3.54 Feb 2002
> Last Updated 24th April 2002
> *
>
> Hi guys,
>
> Is there a function I can use to count the number of instances of a
> value within an array. For example:
> $a[0] = "bob";
> $a[1] = "bob";
> $a[2] = "fred";
> $a[3] = "james";
> $a[4] = "bob";
> $a[5] = "carl";
>
> Searching for 'bob' would return 3.
>
> I've had a quick look through the array functions but didn't spot
> anything obvious.
>
> Neil
> 
>  Email:  [EMAIL PROTECTED]
>  [EMAIL PROTECTED]
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] Counting number of value instances within an array

2002-04-26 Thread Neil Freeman

Hi guys,

Is there a function I can use to count the number of instances of a
value within an array. For example:
$a[0] = "bob";
$a[1] = "bob";
$a[2] = "fred";
$a[3] = "james";
$a[4] = "bob";
$a[5] = "carl";

Searching for 'bob' would return 3.

I've had a quick look through the array functions but didn't spot
anything obvious.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] include_once()

2002-03-19 Thread Neil Freeman

Have you remembered to set up PHP's include_path to point to the area where
your scripts are located?

Neil

Mauricio Cuenca wrote:

> Hello,
>
> I have a very long script with several functions in it. I wanted to split
> the script into several files, so I created two sub-scripts and one main
> script. This is the code from the main script:
>
> 
> include_once("sub_script_1.php");
> incude_once("sub_script_2.php");
>
> $temp = MyFunction();
>
> ?>
>
> MyFunction() is contained in the file "sub_script_1.php" which is properly
> enclosed with valid PHP start and end tags.
>
> But When I try to run the main script, I get this error:
> Fatal error: Call to undefined function: MyFunction()in /main_script.php on
> line 4.
>
> How can I properly "divide" my script into several ones ???
>
> TIA,
>
> __
> Mauricio Cuenca
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] Unicode TTF Font wingding's just don't cut it!

2002-02-19 Thread Neil Freeman

What symbols are you trying to use? Verdana is good enough for most unicode characters.

hugh danaher wrote:

> Help
> Does anyone know where I can get a simple symbol font which is .ttf and "unicode" 
>compatible.  Seems that my php graphic program is very sensitive to ttf problems.  
>It'll take one or two wingdings in imagettftext() before it up and dies.
> Your help will be greatly appreciated.
> Hugh
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Neil Freeman

Have a look at the function getenv()..

eg:
$ip = getenv ("REMOTE_ADDR"); // get the ip number of the user

HTH

Neil

"Narvaez, Teresa" wrote:

> Hello,
> I'm running PHP version 4.1.1.  When I invoke this function,  phpinfo()?>, all variables are set.  However, when I try to retrieve a value
> of a certain variable like this:
>
>   
>
> It returns NULL.  Is there a missing configuration on apache or php?
>
> Thanks,
> -Teresa
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] Web Hosts and PHP 4.10 +

2002-02-08 Thread Neil Freeman

I have a feeling that www.aletia.com use 4.1.1

Don't quote me on that though :)

Neil

Edward Marczak wrote:

> I know the subject of web hosts that support PHP comes up frequently - but
> here's a twist:
>
> After going through the archives, and checking out many, many hosts, I
> haven't found a web host that is up to PHP 4.10 or better.  Most seem stuck
> at 4.04 or, at best, 4.06.
>
> Since 4.10 made some important changes/improvments, (and most of my code
> already takes advantage of this), I'd like to find a host supporting 4.10
> and MySQL.
>
> I understand I could run a dedicated server, but I'm trying to save that as
> a last resort right now.
>
> Any recommendations?  Thanks.
> --
> Ed Marczak
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] Unable to get ImageTTFText output

2002-02-05 Thread Neil Freeman

Girish,

After a bit of searching around it appears that this is a bug of early
versions of PHP, re-introduced in PHP v4.0.6 (the version I was using). I have
upgraded to 4.10 and ImageTTFText now works fine.

Neil

Girish Nath wrote:

> Hi
>
> I had similar problems when just specifying the font file in the same
> directory eg ./arial.ttf but got it to work okay when i used the full path
> eg :
>
> $fontfile = "/apache/htdocs/arial.ttf";
>
> ImageTTFText($im, 20, 0, 3, 3, $text_colour, $fontfile, "My text");
>
> Regards
>
> Girish
> --
> www.girishnath.co.uk
>
> - Original Message -
> From: "Neil Freeman" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 2:59 PM
> Subject: [PHP] Unable to get ImageTTFText output
>
> Hi there,
>
> I am trying to use the ImageTTFText function to output some text onto an
> existing image. Problem being though that the text does not get
> outputted. I have placed the ttf file 'arial.ttf' within the same
> directory as my script. Here is a snippet of my code:
>
> Header("Content-Type: image/png");
> $im = ImageCreateFromPNG("original_image.png");
>
> $text_colour = ImageColorAllocate($im, 255, 255, 255);
>
> ImageTTFText($im, 20, 0, 3, 3, $text_colour, "/arial.ttf", "My
> text");
>
> ImagePNG($im);
>
> All this outputs is my original PNG image (with no text). I have used
> the following line instead of ImageTTFText and all works well.
>
> ImageString($im, 4, 3, 3, "My text", $text_colour);
>
> Using phpinfo() I have checked the GD section and the following is
> outputted:
>
> GD Support - enabled
> GD Version - 2.0 or higher
> FreeType Support - enabled
> FreeType Linkage - with freetype
> JPG Support - enabled
> PNG Support - enabled
> WBMP Support - enabled
>
> Does anyone have any suggestions as to why this does not work? Has
> anyone else used the ImageTTFText function successfully?
>
> Neil
> 
>  Email:  [EMAIL PROTECTED]
>  [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
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] Unable to get ImageTTFText output

2002-02-05 Thread Neil Freeman

Hi Girish. Thanks for the suggestion.

I have an Apache alias pointing to my site, along the lines of:
Alias /input "P:/Projects/data_input"

and have placed the ttf files within this directory (where the php script is
located as well). I've tried placing the ttf files in a sub-directory as well
- with no luck.

Any other ideas???

Neil


Girish Nath wrote:

> Hi
>
> I had similar problems when just specifying the font file in the same
> directory eg ./arial.ttf but got it to work okay when i used the full path
> eg :
>
> $fontfile = "/apache/htdocs/arial.ttf";
>
> ImageTTFText($im, 20, 0, 3, 3, $text_colour, $fontfile, "My text");
>
> Regards
>
> Girish
> --
> www.girishnath.co.uk
>
> - Original Message -
> From: "Neil Freeman" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 05, 2002 2:59 PM
> Subject: [PHP] Unable to get ImageTTFText output
>
> Hi there,
>
> I am trying to use the ImageTTFText function to output some text onto an
> existing image. Problem being though that the text does not get
> outputted. I have placed the ttf file 'arial.ttf' within the same
> directory as my script. Here is a snippet of my code:
>
> Header("Content-Type: image/png");
> $im = ImageCreateFromPNG("original_image.png");
>
> $text_colour = ImageColorAllocate($im, 255, 255, 255);
>
> ImageTTFText($im, 20, 0, 3, 3, $text_colour, "/arial.ttf", "My
> text");
>
> ImagePNG($im);
>
> All this outputs is my original PNG image (with no text). I have used
> the following line instead of ImageTTFText and all works well.
>
> ImageString($im, 4, 3, 3, "My text", $text_colour);
>
> Using phpinfo() I have checked the GD section and the following is
> outputted:
>
> GD Support - enabled
> GD Version - 2.0 or higher
> FreeType Support - enabled
> FreeType Linkage - with freetype
> JPG Support - enabled
> PNG Support - enabled
> WBMP Support - enabled
>
> Does anyone have any suggestions as to why this does not work? Has
> anyone else used the ImageTTFText function successfully?
>
> Neil
> 
>  Email:  [EMAIL PROTECTED]
>  [EMAIL PROTECTED]
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] Unable to get ImageTTFText output

2002-02-05 Thread Neil Freeman

Hi there,

I am trying to use the ImageTTFText function to output some text onto an
existing image. Problem being though that the text does not get
outputted. I have placed the ttf file 'arial.ttf' within the same
directory as my script. Here is a snippet of my code:

Header("Content-Type: image/png");
$im = ImageCreateFromPNG("original_image.png");

$text_colour = ImageColorAllocate($im, 255, 255, 255);

ImageTTFText($im, 20, 0, 3, 3, $text_colour, "/arial.ttf", "My
text");

ImagePNG($im);

All this outputs is my original PNG image (with no text). I have used
the following line instead of ImageTTFText and all works well.

ImageString($im, 4, 3, 3, "My text", $text_colour);

Using phpinfo() I have checked the GD section and the following is
outputted:

GD Support - enabled
GD Version - 2.0 or higher
FreeType Support - enabled
FreeType Linkage - with freetype
JPG Support - enabled
PNG Support - enabled
WBMP Support - enabled

Does anyone have any suggestions as to why this does not work? Has
anyone else used the ImageTTFText function successfully?

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

I've taken out the '=' sign and.we have success!!! Thanks a lot for
your time Mark.

Neil :)

Mark Roedel wrote:

> > -Original Message-
> > From: Neil Freeman [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 04, 2002 10:36 AM
> > To: Mark Roedel
> > Cc: PHP General
> > Subject: Re: [PHP] How do I get htaccess files to take effect?
> >
> >
> > Thanks for the reply Mark,
> >
> > I am fairly new to this :) Here is a snippet of what I have
> > set up so far
> >
> > [snip]
> >
> >  php_value include_path = ".;P:/Projects/Sandboxes/Stratos/asa_php"
> >
> > When I access the URL http://localhost/sandbox though I receive the
> > message "Internal Server Error"
>
> Yay!  That's progress.  *grin*  (At least now we can see that it's
> attempting to use the htaccess file, not ignoring it.)
>
> "Internal Server Error" almost always means "See your error logs for
> more information."
>
> In this case, I think the first thing I'd try, unless the errorlog info
> indicates otherwise, is losing the = sign.
>
> ---
> Mark Roedel   | "Blessed is he who has learned to laugh
> Systems Programmer|  at himself, for he shall never cease
> LeTourneau University |  to be entertained."
> Longview, Texas, USA  |  -- John Powell
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Thanks for the reply Mark,

I am fairly new to this :) Here is a snippet of what I have set up so far
(httpd.conf):

DocumentRoot "D:/Program Files/Apache Group/Apache/realdocs"


Options FollowSymLinks
AllowOverride None



Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all


AccessFileName apache.htaccess

Alias /sandbox "P:/Projects/Sandboxes/storyboard"

AllowOverride All


Within P:\Projects\Sandboxes\storyboard I have my apache.htaccess file:


php_value include_path = ".;P:/Projects/Sandboxes/Stratos/asa_php"



When I access the URL http://localhost/sandbox though I receive the
message "Internal Server Error"

I imagine it's something simple but as I have not done this before
'simple' equates to unknown :) Any ideas???

Neil



Mark Roedel wrote:

> > -Original Message-
> > From: Neil Freeman [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 04, 2002 4:45 AM
> > To: PHP General
> > Subject: [PHP] How do I get htaccess files to take effect?
> >
> >
> > This is my first time attempting to use htaccess files. I am
> > running Apache 1.3.20 with PHP v4.0.6 installed as a module.
> > Within Apache's httpd.conf file I have the following value set:
> >
> > [snip]
> >
> > What I am attempting to do is alter PHP's include path 'on
> > the fly' rather than specifying an overall value within php.ini.
> > The problem I have though is that the 'include_path' value does
> > not appear to be picked up. Am I using htaccess files correctly
> > or do I need to alter some other values within Apache's
> > httpd.conf file??
>
> What you've got so far looks fine.
>
> The other thing that you'll need, though, is an appropriate
> "AllowOverride" value in your httpd.conf for the server or directories
> in question.
>
> http://httpd.apache.org/docs/mod/core.html#allowoverride
>
> ---
> Mark Roedel   | "Blessed is he who has learned to laugh
> Systems Programmer|  at himself, for he shall never cease
> LeTourneau University |  to be entertained."
> Longview, Texas, USA  |  -- John Powell
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Hi,

This is my first time attempting to use htaccess files. I am running
Apache
1.3.20 with PHP v4.0.6 installed as a module. Within Apache's httpd.conf

file I have the following value set:

AccessFileName apache.htaccess

And within an 'Alias' directory I have a file entitled 'apache.htaccess'

which contains the following:


php_value include_path = ".;C:/My/PHP/Dir"


What I am attempting to do is alter PHP's include path 'on the fly'
rather
than specifying an overall value within php.ini. The problem I have
though
is that the 'include_path' value does not appear to be picked up. Am I
using htaccess files correctly or do I need to alter some other values
within Apache's httpd.conf file??

Any help much appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] PHP's include_path

2002-02-04 Thread Neil Freeman

Thanks for the syntax info Lars.

Neil

Lars Torben Wilson wrote:

> On Mon, 2002-02-04 at 01:43, Neil Freeman wrote:
> > Hi there,
> >
> > Am I correct in thinking that you can specify the PHP include_path line
> > within an Apache .htaccess file? If so does anyone know the correct
> > syntax of doing this?
>
> Something along the lines of:
>
> 
>AddType application/x-httpd-php .html .inc .php
>php_value include_path .:/path/to/include/files/
> 
>
> Alter to suit your configuration.
>
> Hope this helps,
>
> Torben
>
> > If you cannot specifiy PHP's include_path line from within this file -
> > how do you use different include paths for different web sites???
> >
> > Hope someone can help :)
> >
> > Neil
> > 
> >  Email:  [EMAIL PROTECTED]
> >  [EMAIL PROTECTED]
> > 
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> --
>  Torben Wilson <[EMAIL PROTECTED]>
>  http://www.thebuttlesschaps.com
>  http://www.hybrid17.com
>  http://www.inflatableeye.com
>  +1.604.709.0506
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] PHP's include_path

2002-02-04 Thread Neil Freeman

Thanks for the quick reply Jason. This looks like it'll achieve what I want but I
think that using a htaccess file is a better 'overall' method.

Cheers,

Neil

Jason Wong wrote:

> On Monday 04 February 2002 17:43, Neil Freeman wrote:
> > Hi there,
> >
> > Am I correct in thinking that you can specify the PHP include_path line
> > within an Apache .htaccess file? If so does anyone know the correct
> > syntax of doing this?
> >
> > If you cannot specifiy PHP's include_path line from within this file -
> > how do you use different include paths for different web sites???
>
> I believe you can also use init_set() to set the include path.
>
> hth
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Please remain calm, it's no use both of us being hysterical at the same time.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Hi,

This is my first time attempting to use htaccess files. I am running Apache
1.3.20 with PHP v4.0.6 installed as a module. Within Apache's httpd.conf
file I have the following value set:

AccessFileName apache.htaccess

And within an 'Alias' directory I have a file entitled 'apache.htaccess'
which contains the following:


php_value include_path = ".;C:/My/PHP/Dir"


What I am attempting to do is alter PHP's include path 'on the fly' rather
than specifying an overall value within php.ini. The problem I have though
is that the 'include_path' value does not appear to be picked up. Am I
using htaccess files correctly or do I need to alter some other values
within Apache's httpd.conf file??

Any help much appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] PHP's include_path

2002-02-04 Thread Neil Freeman

Hi there,

Am I correct in thinking that you can specify the PHP include_path line
within an Apache .htaccess file? If so does anyone know the correct
syntax of doing this?

If you cannot specifiy PHP's include_path line from within this file -
how do you use different include paths for different web sites???

Hope someone can help :)

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] PHP4.0 & Apache with WinXP

2002-01-31 Thread Neil Freeman

I've successfully installed the latest versions of both Apache and PHP on my XP
system with no problems.

Neil

Ben Clumeck wrote:

> I am trying to install Apache and PHP4.0 on WinXP.  Does anyone know of any
> conflicts?
>
> Thanks, Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 30th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] configuring php and apache

2002-01-29 Thread Neil Freeman

Oh yeah... extension_dir should also have a trailing '\' I believe.

Neil

liz lynch wrote:

> hi all,
> i have installed php and apache on my home computer..i am running xp home edition.
> the problem is that the php and apache are not working together. what i have done so 
>far:
>
> 1. configured the httpd.conf file by adding the following lines:
> ScriptAlias /php/ "c:/php/"
> AddType application/x-httpd-php .php .phtml
> Action application/x-httpd-php "/php/php.exe"
>
> 2.moved the php4ts.dll file to windows\system32note i do not have a directory 
>called winnt
>
> 3.configured the php.ini file(located in windows dir)so that:
>
> extension_dir = c:\windows\system32//points to where i located the 
>php4ts.dll file
>
> doc_root = c:\program files\apache group\apache\htdocs//points to the document 
>root file. i will be storing my files in the htdocs dirrectory.
>
> what am i doing wrong
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 28th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] configuring php and apache

2002-01-29 Thread Neil Freeman

What problems/errors are you getting?

Place the following code into a .php file under htdocs:



and then enter something like http://localhost/xxx.php into your browser.

Neil

liz lynch wrote:

> hi all,
> i have installed php and apache on my home computer..i am running xp home edition.
> the problem is that the php and apache are not working together. what i have done so 
>far:
>
> 1. configured the httpd.conf file by adding the following lines:
> ScriptAlias /php/ "c:/php/"
> AddType application/x-httpd-php .php .phtml
> Action application/x-httpd-php "/php/php.exe"
>
> 2.moved the php4ts.dll file to windows\system32note i do not have a directory 
>called winnt
>
> 3.configured the php.ini file(located in windows dir)so that:
>
> extension_dir = c:\windows\system32//points to where i located the 
>php4ts.dll file
>
> doc_root = c:\program files\apache group\apache\htdocs//points to the document 
>root file. i will be storing my files in the htdocs dirrectory.
>
> what am i doing wrong
>
> ***
>  This message was virus checked with: SAVI 3.53 Jan 2002
>  last updated 28th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mail Attachments

2002-01-24 Thread Neil Freeman

Take a look at the articles on:
 http://www.devshed.com/Server_Side/PHP

HTH

Neil

Gordon Stewart wrote:

> Dear List
>
> I have just compleated a PHP web frontend to the standard mail function in
> PHP.  I have got it to send and recieve email.
>
> Can I take this programming task further and allow it to send and recieve
> attachments. My script runs on a redhat 7 box.
>
> Can anyone help?  How can i achieve this?
>
> Gordon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

OK I'll have a look around. Thanks for your time Nick.

Nick Wilson wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> * On 22-01-02 at 11:46
> * Neil Freeman said
>
> > OK I agree with you there :) But as I haven't called the session_destroy()
> > function the session file still resides in the session.save_path directory.
> > Over time the number of these files will obviously increase so isn't it
> > better to implement a method which calls the session_destroy() function ???
>
> I see what you mean but I think you are either a: mistaken or b: under a
> misaprehension. The reason I say this is that I can't believe that
> *something* be it PHP or the system itself won't take that in to
> account.
>
> Have a look at the manual or whatever and if you find the answer please
> let me know as it's a good point. I just think I've seen something about
> it somewhere :)
>
> - --
>
> Nick Wilson
>
> Tel:+45 3325 0688
> Fax:+45 3325 0677
> Web:www.explodingnet.com
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8TUWAHpvrrTa6L5oRAoCKAJ9/YaNP4lYEnRqXc4YABWpj/kS8OwCcCW3g
> dx3GdbUs4s75a8PBl4zdC3Q=
> =7c8g
> -END PGP SIGNATURE-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

OK I agree with you there :) But as I haven't called the session_destroy()
function the session file still resides in the session.save_path directory.
Over time the number of these files will obviously increase so isn't it
better to implement a method which calls the session_destroy() function ???

Nick Wilson wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> * On 22-01-02 at 11:30
> * Neil Freeman said
>
> > Does anyone have any suggestions as to how I could achieve the
> > following:
> > a) Browser window closed by user clicking on [X]
>
> No but I'm sure someone will.
>
> > b) 'Logging out' page opened (which handles the PHP session deletion).
>
> When a user closes the browser (any browser) the session is ended. You
> don't need to manually terminate it.
>
> HTH
> - --
>
> Nick Wilson
>
> Tel:+45 3325 0688
> Fax:+45 3325 0677
> Web:www.explodingnet.com
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8TUBSHpvrrTa6L5oRAn45AJ4kltU6UKb+JCSamfgUfQ+e1CPIKACff0Xn
> NlVo2ttprA1xjdLz6lB3DWg=
> =BOV1
> -END PGP SIGNATURE-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session deletion on window close?

2002-01-22 Thread Neil Freeman

Hi there,

First off this may be more of a javascript question than PHP question
but I was wondering if anyone else has attempted something similar (and
it does involve the deletion of PHP sessions).

Here's the scenario: I have a 'stand alone' website on our intranet
which creates a PHP session upon startup. A new browser window is then
opened for the duration of the site - until the user has finished and
wishes to leave the system. This window cannot have a link to a standard
'logout' page, it needs to delete the PHP session when the browser
window is closed (possibly by launching a temporary page which calls the
necessary functions and then automatically closes via javascript).

The problem I have is that this site must work in both IE and Netscape
and this is what is causing me headaches :) Both browsers supposedly
support an 'onunload' event and I have managed to achieve what I want in
IE but Netscape refuses to lauch my 'logging out' page.

Does anyone have any suggestions as to how I could achieve the
following:
a) Browser window closed by user clicking on [X]
b) 'Logging out' page opened (which handles the PHP session deletion).

I hope this is clear enough.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Installing PHP4

2002-01-18 Thread Neil Freeman

Open up your server's config file, eg httpd.conf , and ensure that PHP's AddType line 
has the extension .php3

Should look something like this:

AddType application/x-httpd-php .php .phtml .php3

HTH

Neil

Manu Verhaegen wrote:

> Hi,
> We have installed Apache 1.3.6 and PHP4
> If we use phpscripts with the extention .php everiting will working fine, if we use 
>.php3 this will not working
>
> Can you help my
>
> Greetings,
> Manu
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] string to array??

2002-01-17 Thread Neil Freeman

You just have to remember that a string is simply a character array :)

Nick Wilson wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> * On 17-01-02 at 12:57
> * Steve Edberg said
>
> > Actually, you can treat a string as an array without any further
> > processing:
> >
> >   $Globbot = 'dribcot';
> >   echo $Globbot[0];   # echoes 'd'
> >   echo $Globbot[6];   # echoes 't'
> >
> > Check out 'String access by character' about halfway down the page at
> >
> >   http://www.php.net/manual/en/language.types.string.php
> >
> > (or, in Portuguese,
> >
> >   http://www.php.net/manual/pt_BR/language.types.string.php
> >
> >
>
> Hmmm. I didn't know that!
>
> > Actually, using the [] syntax is deprecated - using {} is the new way
> > - but I'm a creature of habit...
> >
>
> Or that!
>
> - --
>
> Nick Wilson
>
> Tel:+45 3325 0688
> Fax:+45 3325 0677
> Web:www.explodingnet.com
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8Rrz+HpvrrTa6L5oRAn4kAKCx41//DDBp/bPzPprs2Zls0xjGJgCgk5tz
> x16a8iDFuzEmsgSg5Iv/8Ms=
> =smoj
> -END PGP SIGNATURE-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is there Any way to call Non-Existent function in PHP

2002-01-16 Thread Neil Freeman

You can use function_exists() to check whether a function actually exists:

eg:
if (function_exists('imap_open')) {
echo "IMAP functions are available.\n";
} else {
echo "IMAP functions are not available.\n";
}

HTH

Neil

"S. Murali Krishna" wrote:

> Hai ALL
> Is there any way to capture function call in PHP
> and redirect to some other function if that function doesn't exists.
>
> Perl programmers remind   AUTOLOAD method in a package.
>
> S.Murali Krishna
> [EMAIL PROTECTED]
> =
> We grow slow trying to be great
>
>- E. Stanley Jones
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Sizeof variable variable arrays

2002-01-11 Thread Neil Freeman

That's done the trick. More coffee for me I think :) Cheers Jason.

Jason Wong wrote:

> On Friday 11 January 2002 20:02, Neil Freeman wrote:
> > Hi there guys,
> >
> > Who's awake today then? :)
>
> Someone isn't :)
>
> > Here's a snippet of the code. Any ideas guys???
> >
> > ...
> > //store children page_IDs into array for each parent
> > $str_array = "menu_array_" . $current_parent_page_ID;
> > $$str_array = array();
> >
> > for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
> > {
> > $db_help_structure->next_record();
> >
> > //get page_ID value
> > $page_ID = $db_help_structure->return_single_result('page_ID');
> >
> > //$page_ID is now set
> >
> > echo "storing in $str_array position $child_cnt:" . $page_ID .
> > "";
> > $$str_array[$child_cnt] = $page_ID;
> > echo "size:" . sizeof($$str_array) . "";
> > }
>
> You need to resolve the ambiguity in your code by placing braces around the
> variable part of the variable variable (!)
>
>  ie: ${$str_array}[$child_cnt] = $page_ID;
>
> See manual for details. See the annotated online manual for more examples.
>
> hth
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Go out and tell a lie that will make the whole family proud of you.
> -- Cadmus, to Pentheus, in "The Bacchae" by Euripides
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 17th December 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sizeof variable variable arrays

2002-01-11 Thread Neil Freeman

Hi there guys,

Who's awake today then? :) What I'm trying to do is create variable
variable arrays and then fill these arrays with values. The problem I
have though is that the values don't appear to be getting stored - as
following the assignment I have outputted a 'sizeof' command which
always outputs 0.

Here's a snippet of the code. Any ideas guys???

...
//store children page_IDs into array for each parent
$str_array = "menu_array_" . $current_parent_page_ID;
$$str_array = array();

for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
{
$db_help_structure->next_record();

//get page_ID value
$page_ID = $db_help_structure->return_single_result('page_ID');

//$page_ID is now set

echo "storing in $str_array position $child_cnt:" . $page_ID .
"";
$$str_array[$child_cnt] = $page_ID;
echo "size:" . sizeof($$str_array) . "";
}
...


 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Error handling

2001-12-18 Thread Neil Freeman

What warnings are you receiving? Many can be avoided by doing various
checks:
e.g.
if (!isset($some_variable))
...some error code
else
...all is well

others which may be useful:
function_exists()
file_exists()

HTH

Neil



Yoel Benitez Fonseca wrote:

> Hi!
>
>   There is in PHP some way to handle errors like in other languages,
>   I mean, something like this:
>
>   .
>   .
>   .
>   try to do
> ...
>   if error then do ...
>   .
>   .
>   .
>
>   I'm tired of reciving warnings :-(
>
> --
> Yoel Benitez Fonseca
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 17th December 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Version To Version

2001-12-07 Thread Neil Freeman

I'm using gd png in 4.0.6 with no problems (Windows). What problems are you
having?

Robert Covell wrote:

> A question about different release versions of PHP.
>
> Why do things like png from gd 1.8 work in 4.0.4p1 and stops working in
> 4.0.6?  We had to go back to 4.0.4p1.  I have seen similar things with mysql
> support.  We used the same config script for each version.  Any ideas?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.51
>  last updated 26th November 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is there a GUI for MySQL?

2001-12-07 Thread Neil Freeman

How about MySQL Front (www.mysqlfront.de). Couple of 'features' here and
there but overall pretty good.

Neil

Hai Nguyen wrote:

> Hi,
>
> I am a newbie at this.  I was just wondering if there is a Graphical
> User Interface for MySQL?
>
> Cheers,
>
> Hai Nguyen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.51
>  last updated 26th November 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] preventing multiple submissions

2001-11-26 Thread Neil Freeman

Have a look at:

http://www.faqts.com/knowledge_base/view.phtml/aid/863/fid/129

May be of some use.

Neil

Derek Mailer wrote:

> I have a problem with a form on my website.
>
> it's part of a shopping cart application, whereby the form consists of a list of 
>products and the user enters the quantity they require of each product in the field 
>provided.  Everything works okay except for the fact that if someone hits the submit 
>button more than once the products will be added to the 'cart' more than once.
>
> I've tried altering the script that handles the posted form info, but the problem 
>persists.  I've also simplified the page that loads after adding products to the 
>shopping cart so that it loads quicker (people are less likely to click the submit 
>button more than once).
>
> Can anyone suggest a solution?
>
> Thanks in advance for any help.
>
> Regards,
>
> Derek
>
> **
> This e-mail (and any attachment) is intended only for the attention
> of the addressee(s). Its unauthorised use, disclosure, storage
> or copying is not permitted. If you are not the intended recipient,
> please destroy all copies and inform the sender by return e-mail.
> This e-mail (whether you are the sender or the recipient) may be
> monitored, recorded and retained by Business Information
> Publications Limited (BiP). E-mail monitoring/ blocking software
> may be used, and e-mail content may be read at any time.You
> have a responsibility to ensure laws are not broken when composing
> or forwarding e-mails and their contents.
> **
>
> ***
>  This message was virus checked with: SAVI 3.51
>  last updated 20th November 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php test page not working with apache 1.3.22

2001-11-09 Thread Neil Freeman

Probably not your problem but shouldn't your php line be as follows:


ie without the space between  Hi all,
>
> I've just finish upgrading my apache server to apache 1.3.22,
> I have also compiled my php-4.0.6 with it.
>
> When I try to test it using
>
>  saved as php, the browser tries to download it instead.
>
> I have added the application type under httpd.conf and restarted the server
> ./apachectl restart.
>
> when I type
>
> ./apachectl status it does not show that the php-4.0.6 has be compiled with
> it.
>
> Am i missing some steps? please point me out,
>
> p.s. i have added the module of php4 /libphp4.a to apache
> and did the make command to make it executable.
>
> Thanks,
>
> Caleb Carvalho
> Application Engineer
> LoadRunner/APM
> 
>-
> Enterprise Testing and Performance Management Solutions
> 
>-
> Mercury Interactive
> 410 Frimley Business Park
> Frimley, Surrey.  GU16 7ST
> United Kingdom
> Telephone :  +44 (0)1276 808300
>
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.50
>  last updated 5th November 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem pattern matching a url with question mark

2001-10-24 Thread Neil Freeman

Why does your URL contain .asp?

[EMAIL PROTECTED] wrote:

> I found the following code currently used on our website to match a url
> expression. Unfortunately, when I added a question mark, the webpage that
> contained the url with the question mark just "hung" and would not load into
> my browser at all. Currently, the url links only up to the question mark.
>
> Here's the url I'm trying to get to work:
> http://www.thejakartapost.com/yesterdaydetail.asp?fileid=20011018.G07
>
> Can you look at the code below and tell me what I'm doing wrong?
>
> - Shawna
>
> ORIGINAL CODE
>
> // this will find web addresses and encapsulate each one in a standard
> anchor
>
> while(ereg("http://([\/~_\.0-9A-Za-z#&-]+)", $content, $match)){
> $http_old = $match[0];
> $http = "dubdubdub" . $match[1] . $match[2];
> $url = "$http";
> $content = ereg_replace($http_old, $url, $content);
> };
>
> $content = ereg_replace("dubdubdub", "http://";, $content);
>
> CODE WITH QUESTION MARK
>
> // this will find web addresses and encapsulate each one in a standard
> anchor
>
> while(ereg("http://([\/~_\.0-9A-Za-z#&-?]+)", $content, $match)){
> $http_old = $match[0];
> $http = "dubdubdub" . $match[1] . $match[2];
> $url = "$http";
> $content = ereg_replace($http_old, $url, $content);
> };
>
> $content = ereg_replace("dubdubdub", "http://";, $content);
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.50
>  last updated 23rd October 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Re: calling javascript function from a form image

2001-09-24 Thread Neil Freeman

Yeah thanks, I've done something along the lines of what you've provided and
it works great. Thanks for your help.

Chris Lee wrote:

> this isnt reallt a php question but I'll answer it anyhow because Ive been
> stuck with netscapes incompatabilities before. do this.
>
>  onsubmit="set_category()">
>
> if that doesnt work you'll have todo this.
>
> 
> function set_category()
> {
>   alert("category set");
>   document.formMoviesSearch.submit();
> }
> 
> ...
> 
> 
>
> or if you want the hand to show up over the image. change the  tag to
>
> 
>
> --
>
>   Chris Lee
>   [EMAIL PROTECTED]
>
> "Neil Freeman" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I have a form which contains an:
> >  >
> > When the user clicks this image I want a javascript function to be
> > called. I have added an onclick event to this input line (see code
> > below) which works great in IE and all is well. Netscape doesn't
> > recognise this onclick event though for the image so how do you call a
> > javascript function here? Normally I'd wrap an  tags
> > but I don't think a form will like this.
> >
> > Has anyone a solution?
> >
> > Here is my code
> >
> > #
> > 
> > imagesubmit.htm
> >
> > 
> > function set_category() {
> >  alert("category set");
> > }
> > 
> > 
> >
> > 
> >
> >  >
> > if ($submit_form)  //if this equals true then the form has been
> > submitted
> > {
> >  echo "alert(\"form submitted\");";
> > }
> > else
> > {
> >  echo "alert(\"not submitted\");";
> > }
> >
> > ?>
> >
> > 
> >
> >  > onclick="set_category()">
> > 
> >
> > 
> >
> > 
> > 
> > #
> >
> > Neil
> >
> > 
> >  Email:  [EMAIL PROTECTED]
> >  [EMAIL PROTECTED]
> > 
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.49
>  last updated 19th September 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] calling javascript function from a form image

2001-09-21 Thread Neil Freeman

Hi,

I have a form which contains an:
 tags
but I don't think a form will like this.

Has anyone a solution?

Here is my code

#

imagesubmit.htm


function set_category() {
 alert("category set");
}





alert(\"form submitted\");";
}
else
{
 echo "alert(\"not submitted\");";
}

?>










#

Neil


 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Detecting an image form submission via PHP

2001-09-21 Thread Neil Freeman

OK cheers, that method seems to work ok.

Thanks, Neil

Michael van Bracht wrote:

> - Original Message -
> From: "Neil Freeman" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Friday, September 21, 2001 3:30 PM
> Subject: [PHP] Detecting an image form submission via PHP
>
> you could use a  in the form
>
> regards
>
> Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.49
>  last updated 19th September 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Detecting an image form submission via PHP

2001-09-21 Thread Neil Freeman

Hi,

When a form is submitted using a standard SUBMIT button it is possible
to catch this via php using  if ($submit) but how do you catch this if
you are using an image for submitting instead of the button?

Any help would be greatly appreciated.

Here is a cut down version of my code:
#
alert(\"submitted\");";
}
else
{
echo "alert(\"not submitted\");";
}

?>








#

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





[PHP] Generating variable names 'on the fly'

2001-09-20 Thread Neil Freeman

Hi there,

How do I generate variable names 'on the fly'? I wish to have variable
names along the lines of $genre_category_1, $genre_category_2,
$genre_category_3 etc.

Ideally it would be along the lines of this...

###
$current_field_number = 1;
$genre_number_fields = 7;

while ($current_field_number < $genre_number_fields)
{
//this var will change on every loop
$genre_desc = $db_movies_genres->Record[$current_field_number];

//something along the lines of...(you get the idea)
$str_category = "genre_category_" . $current_field_number;
$$str_category = $genre_desc;

$current_field_number++;
}
###

Any help would be greatly appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] Problem installing GD on windows

2001-09-19 Thread Neil Freeman

Light bulb appears, maybe. I have been using the 755kb PHP program which
according to php.net doesn't include external extensions. Are you by any chance
using the 4Mb complete package of PHP as this could well be where my problem
lies. I will try and download this package in the meantime and let you know.

Neil

Girish Nath wrote:

> Hi
>
> I've never seen an install that has only those two directories :) Anyway,
> try doing a search on your machine for files that match php_*.dll .It might
> help you track down where all the extensions have been installed.
>
> Regards
>
> Girish
>
> - Original Message -
> From: "Neil Freeman" ?[EMAIL PROTECTED]?
> To: "Girish Nath" ?[EMAIL PROTECTED]?
> Cc: "PHP General" ?[EMAIL PROTECTED]?
> Sent: Wednesday, September 19, 2001 12:29 PM
> Subject: Re: [PHP] Problem installing GD on windows
>
> ? Hi Girish,
> ?
> ? I installed PHP within D:\PHP. This folder currently has two
> sub-directories
> ? 'sessiondata' and 'uploadtemp'. There does not appear to be an extensions
> ? sub-directory "with a load of other dlls in there too". Anyway I created
> an
> ? 'extensions' sub-directory and placed the php_gd.dll into it. I changed
> the
> ? php.ini extension_dir line to point to this directory:
> ?
> ? ie:
> ? extension_dir = D:\PHP\extensions\
> ?
> ? But the problem still occurs, only now the second alert box reads:
> ? "Unable to load dynamic library 'D:\PHP\extensions\php_gd.dll' - The
> specified
> ? procedure could not be found"
> ?
> ? Any ideas?
> ?
> ? Neil
> ?
> ? Girish Nath wrote:
> ?
> ? ? hi
> ? ?
> ? ? copy the php_gd.dll  into the extentions sub-directory where you
> installed
> ? ? php (you should already have a load of other .dlls in there too)
> ? ?
> ? ? change the extension_dir in php.ini to point to that sub-directory.
> ? ?
> ? ? for example :
> ? ? extension_dir = D:\Apache\php4\extensions\
> ? ?
> ? ? that should do it.
> ? ?
> ? ? regards
> ? ?
> ? ? girish
> ? ?
> ? ? - Original Message -
> ? ? From: "Neil Freeman" ?[EMAIL PROTECTED]?
> ? ? To: "PHP General" ?[EMAIL PROTECTED]?
> ? ? Sent: Wednesday, September 19, 2001 10:21 AM
> ? ? Subject: [PHP] Problem installing GD on windows
> ? ?
> ? ? ? Hi there,
> ? ? ?
> ? ? ? I have downloaded the windows version of GD (php_gd.dll) as I wish to
> ? ? ? use it's various image functions. I have edited my PHP.INI file in
> ? ? ? C:\WINNT and uncommented the line:
> ? ? ?
> ? ? ? extension=php_gd.dll
> ? ? ?
> ? ? ? Where is a suitable location for this .dll file? And what should I set
> ? ? ? this PHP.INI line to?
> ? ? ?
> ? ? ? extension_dir = ./
> ? ? ?
> ? ? ? Any help would be greatly appreciated.
> ? ? ?
> ? ? ? Neil
> ? ? ? 
> ? ? ?  Email:  [EMAIL PROTECTED]
> ? ? ?  [EMAIL PROTECTED]
> ? ? ? 
> ? ? ?
> ? ? ?
> ? ? ?
> ? ? ? --
> ? ? ? PHP General Mailing List (http://www.php.net/)
> ? ? ? To unsubscribe, e-mail: [EMAIL PROTECTED]
> ? ? ? For additional commands, e-mail: [EMAIL PROTECTED]
> ? ? ? To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> ? ? ?
> ? ?
> ? ? --
> ? ? PHP General Mailing List (http://www.php.net/)
> ? ? To unsubscribe, e-mail: [EMAIL PROTECTED]
> ? ? For additional commands, e-mail: [EMAIL PROTECTED]
> ? ? To contact the list administrators, e-mail: [EMAIL PROTECTED]
> ? ?
> ? ? ***
> ? ?  This message was virus checked with: SAVI 3.49
> ? ?  last updated 19th September 2001
> ? ? ***
> ?
> ? --
> ? 
> ?  Email:  [EMAIL PROTECTED]
> ?  [EMAIL PROTECTED]
> ? 
> ?
> ?
> ?
> ? --
> ? PHP General Mailing List (http://www.php.net/)
> ? To unsubscribe, e-mail: [EMAIL PROTECTED]
> ? For additional commands, e-mail: [EMAIL PROTECTED]
> ? To contact the list administrators, e-mail: [EMAIL PROTECTED]
> ?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem installing GD on windows

2001-09-19 Thread Neil Freeman

Hi Girish,

I installed PHP within D:\PHP. This folder currently has two sub-directories
'sessiondata' and 'uploadtemp'. There does not appear to be an extensions
sub-directory "with a load of other dlls in there too". Anyway I created an
'extensions' sub-directory and placed the php_gd.dll into it. I changed the
php.ini extension_dir line to point to this directory:

ie:
extension_dir = D:\PHP\extensions\

But the problem still occurs, only now the second alert box reads:
"Unable to load dynamic library 'D:\PHP\extensions\php_gd.dll' - The specified
procedure could not be found"

Any ideas?

Neil

Girish Nath wrote:

> hi
>
> copy the php_gd.dll  into the extentions sub-directory where you installed
> php (you should already have a load of other .dlls in there too)
>
> change the extension_dir in php.ini to point to that sub-directory.
>
> for example :
> extension_dir = D:\Apache\php4\extensions\
>
> that should do it.
>
> regards
>
> girish
>
> - Original Message -
> From: "Neil Freeman" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 19, 2001 10:21 AM
> Subject: [PHP] Problem installing GD on windows
>
> > Hi there,
> >
> > I have downloaded the windows version of GD (php_gd.dll) as I wish to
> > use it's various image functions. I have edited my PHP.INI file in
> > C:\WINNT and uncommented the line:
> >
> > extension=php_gd.dll
> >
> > Where is a suitable location for this .dll file? And what should I set
> > this PHP.INI line to?
> >
> > extension_dir = ./
> >
> > Any help would be greatly appreciated.
> >
> > Neil
> > 
> >  Email:  [EMAIL PROTECTED]
> >  [EMAIL PROTECTED]
> > 
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.49
>  last updated 19th September 2001
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem installing GD on windows

2001-09-19 Thread Neil Freeman

Hi there,

I have downloaded the windows version of GD (php_gd.dll) as I wish to
use it's various image functions. I have edited my PHP.INI file in
C:\WINNT and uncommented the line:

extension=php_gd.dll

Where is a suitable location for this .dll file? And what should I set
this PHP.INI line to?

extension_dir = ./

Any help would be greatly appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP/Apache configuration for Win NT

2001-08-21 Thread Neil Freeman

You appear to have a typo in your httpd.conf:

Action application/x-httpd-php /Php/php.exe

should be as follows: (note the ")

Action application/x-httpd-php "/Php/php.exe

Hope that helps,

Neil

[EMAIL PROTECTED] wrote:

> ***
>  This message was virus checked with: SAVI 3.48
>  last updated 14th August 2001
> ***
>
> Hi,
>
> Here's the scenario,
>
> I've installed and am running mySQL on my machine
> I've installed Apache and have ran it and seen the page in IE confirming correct
> setup.
>
> I've installed PHP4 from a CGI binary distribution at the following location
>
>  c:\Php\
>
> and have been following a tutorial on WebMonkey in order to configure it.
>
> As instructed I have inserted the following lines in my httpd.conf file
>
> ScriptAlias /php/ "C:/Php/"
>
> AddType application/x-httpd-php .php .phtml .html
> AddType application/x-httpd-php-source .phps
>
> Action application/x-httpd-php /Php/php.exe
>
>  DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
>
> The tutorial also instructed me to move the php4ts.dll to the following place
>
>  c:\Winnt\system
>
> which I have done
>
> After rebooting my machine I started IE and pointed it at the apache server
> again.
> This time it produced an error as follows (from the log)
>
>  [Tue Aug 21 14:54:47 2001] [error] [client 172.16.18.149] File does not
> exist:
>  c:/program files/apache group/apache/htdocs/php/php.exe/index.html
>
> As instructed I created the filephpinfo.php in the Document root and pointed the
>  browser at it.
>
> This yielded the following error message:
>
>  [Tue Aug 21 14:54:53 2001] [error] [client 172.16.18.149] File does not
> exist:
>  c:/program files/apache group/apache/htdocs/php/php.exe/phpinfo.php
>
> Can anyone tell me where I am going wrong here please?
>
> Any suggestions gratefully received.
>
> Thanks,
>
> Paul Eaton.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Apache alias to a specific .htm file

2001-08-17 Thread Neil Freeman

Hi there,

In an ideal world I would like to be able to type http://localhost into
my browser and for Apache server to throw up a specific .htm file on my
hard drive. At the moment I have an Apache Alias set up as follows:

Alias /ife "P:/My Projects/Storyboard"

and you need to enter:

http://localhost/ife/index.htm

to get to this .htm file. How can I setup Apache to automatically 'pick
up' a set .htm file (ie, http://localhost equals "P:/My
Projects/Storyboard/ife/index.htm").

Any help would be greatly appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Invoking PHP scripts from a redirect location

2001-08-17 Thread Neil Freeman

Hi,

I am having trouble getting a redirected file's php section activating.
Some info to help you understand:

1) Within Apache's httpd.conf file I have the following set:
DocumentRoot "D:/Program Files/Apache Group/Apache/realdocs"

RedirectMatch permanent ^/$ "P:/Main Projects/Test/index.php"
ScriptAlias /php/ "d:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "/php/php.exe

2)Within IE I enter:
http://localhost

which calls my index.php file:




PHP Test







document.write("And the line is...");








This only prints out the javascript section though and doesn't appear to
call the php section. If I copy this file to my DocumentRoot directory
and then call it via:

http://localhost/index.php

all is well and both the javascript and php sections are displayed. Do I
need to somehow configure Apache to run php scripts from other locations
or am I doing something stupid?

Hope you can help,

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Creating a javascript array from database data

2001-08-16 Thread Neil Freeman

Yeah thanks Tim. 5:30 in the afternoon does bad things to my logical thinking.
Not the best time to try and learn PHP :)

Neil

Tim Ward wrote:

> I'm not sure if this is the problem but it is an important point. print
> "\"$text\""; does not output anything to screen, as with all prints and
> echos it outputs it to html (in this case within a js function definition).
> Try viewing the source produced.
>
> Tim
>
> --
> From:  Neil Freeman [SMTP:[EMAIL PROTECTED]]
> Sent:  15 August 2001 18:10
> To:  Sheridan Saint-Michel
> Cc:  php-general
> Subject:  Re: [PHP] Creating a javascript array from database data
>
> Thanks a lot for your help Sheridan,
>
> This now appears to work ok :) but if I remove the:
>
> print "\"$text\"";
>
> line (as it is not required), I receive errors complaining about a
> syntax
> error (related to what?) and that 'text' is undefined. As this line
> simply
> outputs the value to screen why should this cause a problem if it is
> removed?
> Or could it be some other problem?
>
> Neil
>
> PS: Here is my updated code:
>
> --
> 
> 
> Menus test
>
> 
> 
>
>  $dbhost = 'localhost';
> $dbuser = 'guest';
> $dbpass = 'guest';
> $dbname = 'IFE';
> $dbtable = 'menus';
>
> //-- DATABASE CONNECTION //
> mysql_connect($dbhost,$dbuser,$dbpass)
>or die ("Unable to connect to database");
>
> mysql_select_db($dbname)
>or die ("Unable to select database");
>
> $sql= "SELECT * FROM $dbtable";
> $result = mysql_query($sql);
>
> $number = mysql_numrows($result);
>
> $i = 0;
>
> if ($number == 0)
>print "Error - No records found";
> elseif ($number > 0)
> {
>echo "\n";
>echo "text = new Array(";
>while ($i < $number)
>{
>   $text = mysql_result($result, $i, "name");
>
>$i++;
>
>if ($i < $number)
> print ",";
>   else
> print ")\n";
>   }
>   echo "\n";
> }
>
> mysql_free_result($result);
> mysql_close();
> ?>
>
> 
> 
> --
>
> Sheridan Saint-Michel wrote:
>
> > ***
> >  This message was virus checked with: SAVI 3.48
> >  last updated 14th August 2001
> > ***
> >
> > The thing to ALWAYS remember when working with both PHP and
> > JavaScript is that PHP is Server-Side and JavaScript is
> Client-Side.
> >
> > What this mean is practical terms is that when going from
> JavaScript
> > to PHP you have to submit or redirect back to the server... and
> when
> > going from PHP to JavaScript (Like you are trying to do here) you
> > have to make sure your PHP outputs JavaScript.
> >
> > So instead of printing $text you need to actually print the
> JavaScript...
> >
> > So in your case change the middle of your script to something
> like:
> >
> > $number = mysql_numrows($result);
> >
> >  $i = 0;
> >
> >  if ($number == 0)
> > print "Error - No records found";
> > else
> > {
> >   echo "\n";
> >   echo "text = new Array(";
> >   while ($i < $number)
> >   {
> >  $text = mysql_result($result, $i, "name");
> >  print "\"$text\"";
> > $i++;
> > if ($i < $number)
> >   print ",";
> > else
> >   print ")\n";
> >}
> >   echo "\n";
> > }
> >
> > }
> >
> > Note:  This is my quick *untested* fi

Re: [PHP] Creating a javascript array from database data (Off-List)

2001-08-16 Thread Neil Freeman

Thanks for the clarification Sheridan - I think it must have been end of day
madness on my part :) I see what's going on now with the 'print' line.

Cheers,

Neil

Sheridan Saint-Michel wrote:

> ***
>  This message was virus checked with: SAVI 3.48
>  last updated 14th August 2001
> ***
>
> Think in terms of output...  The JavaScript is literally going to
> try and run the output of the PHP (It doesn't even know PHP
> exists).  PHP is outputting the source code for the HTML and
> JavaScript.  So what you are trying to do is get PHP to take
> dog,cat,cow from MySQL and output:
>
> 
> text = new Array("dog","cat","cow")
> 
>
> This block of code does exactly that, with the print"\"$text\"";
> filling in dog cat and cow.  I've added comments so you can
> see how each line produces the above (I am using C-Style
> comments as the // gets mucked up in e-mail)
>
> The parts in [] are comments within comments to show flow
> control and are not output.
>
> else
> {
> /*  */
>   echo "<Script Language=\"JavaScript\">\n";
> /* text=new Array( */
>   echo "text = new Array(";
>   while ($i < $number)
>
> $text = mysql_result($result, $i, "name");
> /* "dog" [first time] */
> /* "cat" [second time] */
> /* "cow" [third time] */
> print "\"$text\"";
> $i++;
> if ($i < $number)
> /* , [first time] */
> /* , [second time] */
>print ",";
> else
> /* ) [third time] */
>   print ")\n";
> }
> /*  */
>   echo "\n";
> }
>
> So if you can follow that (just walk all the way through
> the loop for each of the three passes) you can see that
> no part of the code (including the print "\"$text\"";) is
> unnecessary
>
> Hope this helps
>
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
>
> - Original Message -
> From: Neil Freeman <[EMAIL PROTECTED]>
> To: Sheridan Saint-Michel <[EMAIL PROTECTED]>
> Cc: php-general <[EMAIL PROTECTED]>
> Sent: Wednesday, August 15, 2001 12:09 PM
> Subject: Re: [PHP] Creating a javascript array from database data
>
> > Thanks a lot for your help Sheridan,
> >
> > This now appears to work ok :) but if I remove the:
> >
> > print "\"$text\"";
> >
> > line (as it is not required), I receive errors complaining about a syntax
> > error (related to what?) and that 'text' is undefined. As this line simply
> > outputs the value to screen why should this cause a problem if it is
> removed?
> > Or could it be some other problem?
> >
> > Neil
> >
> > PS: Here is my updated code:
> 

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Creating a javascript array from database data

2001-08-15 Thread Neil Freeman

Thanks a lot for your help Sheridan,

This now appears to work ok :) but if I remove the:

print "\"$text\"";

line (as it is not required), I receive errors complaining about a syntax
error (related to what?) and that 'text' is undefined. As this line simply
outputs the value to screen why should this cause a problem if it is removed?
Or could it be some other problem?

Neil

PS: Here is my updated code:

--


Menus test




 0)
{
   echo "\n";
   echo "text = new Array(";
   while ($i < $number)
   {
  $text = mysql_result($result, $i, "name");

   $i++;

   if ($i < $number)
print ",";
  else
print ")\n";
  }
  echo "\n";
}

mysql_free_result($result);
mysql_close();
?>



--

Sheridan Saint-Michel wrote:

> ***
>  This message was virus checked with: SAVI 3.48
>  last updated 14th August 2001
> ***
>
> The thing to ALWAYS remember when working with both PHP and
> JavaScript is that PHP is Server-Side and JavaScript is Client-Side.
>
> What this mean is practical terms is that when going from JavaScript
> to PHP you have to submit or redirect back to the server... and when
> going from PHP to JavaScript (Like you are trying to do here) you
> have to make sure your PHP outputs JavaScript.
>
> So instead of printing $text you need to actually print the JavaScript...
>
> So in your case change the middle of your script to something like:
>
> $number = mysql_numrows($result);
>
>  $i = 0;
>
>  if ($number == 0)
> print "Error - No records found";
> else
> {
>   echo "\n";
>   echo "text = new Array(";
>   while ($i < $number)
>   {
>  $text = mysql_result($result, $i, "name");
>  print "\"$text\"";
> $i++;
> if ($i < $number)
>   print ",";
> else
>   print ")\n";
>}
>   echo "\n";
> }
>
> }
>
> Note:  This is my quick *untested* fix done by modifying
> your code as little as possible.  I would suggest you use
> mysql_fetch_row and use your loop to parse it rather than
> making several calls to mysql_result (especially if you are
> ever going to have more than a few entries in the DB).
>
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
>
> - Original Message -
> From: Neil Freeman <[EMAIL PROTECTED]>
> To: PHP General <[EMAIL PROTECTED]>
> Sent: Wednesday, August 15, 2001 11:16 AM
> Subject: [PHP] Creating a javascript array from database data
>
> > Hi there,
> >
> > Well after a few hours roaming around various websites I am at a loss.
> > Here is what I am trying to do:
> >
> > 1) Access a MySQL database which contains 1 table
> > 2) Read the records from this table
> > 3) Store the values returned from this table into javascript array
> > elements, ie, if I get the values "dog", "cat" and "cow" back I want
> > these stored in an array as such:
> > myArray[0] = valueReturned1
> > myArray[1] = valueReturned2
> > myArray[2] = valueReturned3
> >
> > You get the idea.
> >
> > Problem being that I cannot work out how to implement the javascript
> > section of this. At the moment my php script writes the values returned
> > from the database to screen but I require these to be stored in a
> > javascript array. Please can someone help me before I go mad :)
> >
> > Here is my current .php script:
> >
> > --
> > 
> > 
> > Menus test
> > 
> > 
> >
> >  > $dbhost = 'localhost';
> > $dbuser = 'guest';
> > $dbpass = 'guest';
> > $dbname = 'IFE';
> > $dbtable = 'menus';
> >
> > file://-- DATABASE CONNECTION //
> > mysql_connect($dbhost,$dbuser,$dbpass)
> >or die ("Unable to connect to database");
> >
> > mysql_select_db($dbname)
> >or die ("Unable to select database");
> >
> >
> > $sql= "SELECT * FROM $dbtable";
> > $result = mysql_query($sql);
> >
> > $number = mysql_numrows($result);
> >
> > $i = 0;
> >
> > if ($number == 0)
> >print "Error - No records found";
> > elseif ($number > 0)
> > {
> >while ($i < $number)
> >{
> >   $text = mysql_result($result, $i, "name");
> >   print "$text";
> >
> >$i++;
> >}
> > }
> >
> > mysql_free_result($result);
> > mysql_close();
> > ?>
> >
> > 
> > 
> > --
> >
> > Thanks, Neil

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Creating a javascript array from database data

2001-08-15 Thread Neil Freeman

Hi there,

Well after a few hours roaming around various websites I am at a loss.
Here is what I am trying to do:

1) Access a MySQL database which contains 1 table
2) Read the records from this table
3) Store the values returned from this table into javascript array
elements, ie, if I get the values "dog", "cat" and "cow" back I want
these stored in an array as such:
myArray[0] = valueReturned1
myArray[1] = valueReturned2
myArray[2] = valueReturned3

You get the idea.

Problem being that I cannot work out how to implement the javascript
section of this. At the moment my php script writes the values returned
from the database to screen but I require these to be stored in a
javascript array. Please can someone help me before I go mad :)

Here is my current .php script:

--


Menus test



 0)
{
   while ($i < $number)
   {
  $text = mysql_result($result, $i, "name");
  print "$text";

   $i++;
   }
}

mysql_free_result($result);
mysql_close();
?>



--

Thanks, Neil


 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]