[PHP] php install error --enable-sockets

2002-06-12 Thread Rahul Bhide

Hi ,
I am trying to install php with the --enable-sockets on
a solaris2.8 machine .

and getting the following error .
Any help is appreciated .

thanks
~Rahul

sockets.c: In function `php_if_recvmsg':
sockets.c:1728: structure has no member named `msg_control'
sockets.c:1729: structure has no member named
`msg_controllen'
sockets.c:1731: structure has no member named `msg_control'
sockets.c:1732: structure has no member named
`msg_controllen'
sockets.c:1735: structure has no member named `msg_flags'
sockets.c:1741: structure has no member named `msg_control'
sockets.c:1750: warning: passing arg 3 of `add_assoc_string'
makes pointer from integer without a cast
sockets.c:1754: structure has no member named
`msg_controllen'
sockets.c:1755: structure has no member named `msg_flags'
sockets.c:1787: structure has no member named `msg_control'
sockets.c:1788: structure has no member named
`msg_controllen'
sockets.c:1790: structure has no member named `msg_control'
sockets.c:1791: structure has no member named
`msg_controllen'
sockets.c:1794: structure has no member named `msg_flags'
sockets.c:1800: structure has no member named `msg_control'
sockets.c:1810: warning: passing arg 3 of `add_assoc_string'
makes pointer from integer without a cast
sockets.c:1812: structure has no member named
`msg_controllen'
sockets.c:1814: structure has no member named `msg_flags'
*** Error code 1
make: Fatal error: Command failed for target `sockets.lo'




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




[PHP] embedded media from DB

2002-06-12 Thread Brad Wright

Hi all.. 

well i got the wav files from the mysql database and can get them to play in
a web page using the following code:



IF ($row = mysql_fetch_array($result))  {


$data = $row["wavFile"];
  $name = $row["wav FileName"];
  $size = $row["wav FileSize"];
  $type = $row["wav FileType"];
 header("Content-type: $type");
  header("Content-length: $size");
  /header("Content-Disposition: attachment; filename=$name");
  header("Content-Description: PHP Generated Data");
echo  $data;

*


BUt the problem I am having is that this code gives me a blank age with a
Quicktime control bar in the middle of it. The wav file plays fine. Any
other htm underneath this php script is ignored.

How can i get the (html) code following this to be output to the webpage
All my tags seem correct (ie the  tags etc are done correctly).


Any help is greatly appreciated







Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strenght, in water there are
bacteria



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




RE: [PHP] Problem with postfield elements

2002-06-12 Thread Balaji Ankem

Hi Jason,
 Thanks for the reply.

 Just I posted to input fields from a html form and I tried to print.

 Here I am not registering any global variables.

 I have tried echo "emp_id: ".$_POST['emp_id']; and able to print
succesfully.

 Every time I have to refer like this $_POST['emp_id']. Can't I refer as
$emp_id ?

Thanks and Regards
Balaji


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 13, 2002 12:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with postfield elements


On Thursday 13 June 2002 14:18, Balaji Ankem wrote:
> Hi friend,
>  Just now I have installed php 4.2.1 on my windows NT machine.

Did you read the release notes or the documentation which comes with it,
or 
the manual even?

>  Here I found I am not able to get the postfield values.
>  What would be the reason?

register_globals is disabled. Read the manual or search the archives for
more 
info.

>   echo "emp_id: ".$emp_id;
>   echo "emp_pass:".$emp_pass;

Use :

  echo "emp_id: ".$_POST['emp_id'];

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

/*
The strong give up and move away, while the weak give up and stay. */


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



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


Re: [PHP] Problem with postfield elements

2002-06-12 Thread Jason Wong

On Thursday 13 June 2002 14:18, Balaji Ankem wrote:
> Hi friend,
>  Just now I have installed php 4.2.1 on my windows NT machine.

Did you read the release notes or the documentation which comes with it, or 
the manual even?

>  Here I found I am not able to get the postfield values.
>  What would be the reason?

register_globals is disabled. Read the manual or search the archives for more 
info.

>   echo "emp_id: ".$emp_id;
>   echo "emp_pass:".$emp_pass;

Use :

  echo "emp_id: ".$_POST['emp_id'];

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

/*
The strong give up and move away, while the weak give up and stay.
*/


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




[PHP] Problem with postfield elements

2002-06-12 Thread Balaji Ankem

Hi friend,
 Just now I have installed php 4.2.1 on my windows NT machine.
 Here I found I am not able to get the postfield values.
 What would be the reason?

 Thanks and Regards
 Balaji.

Login.html
=





function check()
{

  document.login.method = "POST";
document.login.action="./auth.php";
document.login.submit();
return true;

}



 

EmpName:  
Password: 





=

Auth.php
==


==

I got blank values..

Any help would be appreciable.

-Balaji



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


[PHP] Help with resize pix to thumbnail from mysql files in the directory

2002-06-12 Thread Bruce Youb


Hi Shane I seen your message about binary extraction and although I
understand the concept it is past my pay grade. (newbie)

I am working on customizing a cart and I am looking for an example of script
to work on that extracts a file name from the db and resizes into a table.

I tried a few things but keep getting a problem with headers etc from the
html template I use.

The only thing I have come up so far is put my template into a js file and
use the header I need for the php.

Any hints tips etc or examples would be great.

I am customizing mycart so the catalog and descriptions are graphical rather
just text.



[PHP] mail( ) and cox

2002-06-12 Thread manguerar

Hey,

Does anyone know why I can't use the mail() function for my email addresses 
[EMAIL PROTECTED]? It works fine on my Hotmail account, but I would rather use my cox 
account.

Damon  


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




Re: [PHP] embeding media from DB

2002-06-12 Thread Brad Wright

Sorry... that should be mySQL database



Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strenght, in water there are
bacteria

> From: Brad Wright <[EMAIL PROTECTED]>
> Date: Thu, 13 Jun 2002 14:59:37 +1000
> To: PHP General List <[EMAIL PROTECTED]>
> Subject: [PHP] embeding media from DB
> 
> Hi all,
> I have been able to upload a wav file to a mxSQl db using PHP script. Wanted
> to be able to get that wav file from the db and embed it into a web page
> using the default media player to play it.
> 
> Can anyone help???
> 
> 
> 
> 
> 
> Cheers,
> 
> Brad 
> 
> 
> Nel vino la verità, nella birra la forza, nell'acqua i bacilli
> --
> In wine there is truth, in beer there is strenght, in water there are
> bacteria
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Installation and/or configuration problems w 4.2.1 on NT

2002-06-12 Thread George Pitcher

Ed,

Thanks, the server is IIS4 and I've tried both the CGI and ISAPI approach,
even tried using the installer. All to no avail.

I have taken the error mesage to mean that some security contraint is
preventing the server from accessing eithet the PHP.exe or the .dll file.

Stumped.

George


- Original Message -
From: "Lazor, Ed" <[EMAIL PROTECTED]>
To: "'George Pitcher'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 12, 2002 12:33 AM
Subject: RE: [PHP] Installation and/or configuration problems w 4.2.1 on NT


> I don't know the answer, but... It sounds almost like a server
configuration
> issue.  Almost as if the web server (Apache?) doesn't have the php
extension
> configured correctly.
>
> -Original Message-
> From: George Pitcher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 11, 2002 3:48 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Installation and/or configuration problems w 4.2.1 on NT
>
>
> Hi all,
>
> I have PHP running happily on three of my servers (NT/2000/Linux) and need
> to set it up on NT on a server 400 miles away. I have remote access to the
> server.
>
> I have followed the instructions for both the ISAPI version and the CGI
> version with no success.
>
> This is the error message I get when I try to call phpinfo.php:
>
> HTTP Error 401
> 401.3 Unauthorized: Unauthorized due to ACL on resource
>
> I'm now just about to start pulling my hair out, so can someone help
before
> I'm totally bald.
>
>

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.


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




RE: [PHP] Re: converting C to PHP

2002-06-12 Thread Martin Towell

> -Original Message-
> From: David Robley [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 3:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: converting C to PHP
> 
> 
> In article <6416776FCC55D511BC4E0090274EFEF508A46F@EXCHANGE>, 
> [EMAIL PROTECTED] says...
> > I'm converting some C functions to PHP and have come across this:
> > 
> > int skipf(..., char *format)
> > {
> >   /* ... */
> >   cp = format;
> >   char *cp, *cp2;
> >   multiplier = strtol(cp, &cp2, 10);
> >   /* ... */
> > }
> > 
> > 
> > How can I implement this line in PHP ?
> >   multiplier = strtol(cp, &cp2, 10);
> > 
> > 
> > > Oh, and an example of format is "12L20W2P"
> 
> Non C programmer volunteers suggsetion. I looked at strtol in the C docs 
> and I don't quite understand exactly what it does. But I wonder if intval 
> would be a starting point to try and get the result I think you want?
> 
> -- 
> David Robley
> Temporary Kiwi!
> 
> Quod subigo farinam

Just to crarify - what I need to get back is the first number and the first
letter after that number (which can be "L", "P", or "W"). So in the example
I gave, I'll need to get back "12" and "L"

What I settled on is:
  ereg("([0-9]*)([LPW])", $format, $bits);
  list(, $cnt, $skip) = $bits;

But maybe there's a better way ??

Martin

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




Re: [PHP] apache/oracle/php

2002-06-12 Thread Michael P. Carel

Thanks to all who tried to helps. I've finally found out why. The oracle
home user directory should be set to drwxr-xr-x so once the required
environment was set the ora function can connect to the oracle database, and
all the required files and library can be access.

thanks



Regards,
Mike




> > Is there anyone who could give me some reasons why does my
> > php script with
> > oracle function does'nt work if i run apache as nobody/nobody?
> > My script only work if i run apache as oracle/dba.
>
> Could it be because nobody/nobody has no rights?
> At least I think nobody should have no rights for your db...
>
> Cheers,
>
> Kiko
>
> --
> It's not a bug, it's a feature.
> christoph starkmann
> mailto:[EMAIL PROTECTED]
> http://www.gruppe-69.com/
> ICQ: 100601600
> --


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




[PHP] Re: converting C to PHP

2002-06-12 Thread David Robley

In article <6416776FCC55D511BC4E0090274EFEF508A46F@EXCHANGE>, 
[EMAIL PROTECTED] says...
> I'm converting some C functions to PHP and have come across this:
> 
> int skipf(..., char *format)
> {
>   /* ... */
>   cp = format;
>   char *cp, *cp2;
>   multiplier = strtol(cp, &cp2, 10);
>   /* ... */
> }
> 
> 
> How can I implement this line in PHP ?
>   multiplier = strtol(cp, &cp2, 10);
> 
> 
> Oh, and an example of format is "12L20W2P"

Non C programmer volunteers suggsetion. I looked at strtol in the C docs 
and I don't quite understand exactly what it does. But I wonder if intval 
would be a starting point to try and get the result I think you want?

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Re: Email not getting

2002-06-12 Thread Manisha

If it is aurica.com then it is wrong as this is the name of Live server. 
But currently I am working on local linux server. (To access the server I 
use http://Linux-Server/index.php)

Any way, following is the out put of the command


***Can't find server address for 'aurica.com': Host name lookup failure.

Server: Linux-Server
Address: 0.0.0.0

***Linux-Server Can't give TYPE=MX : No response from server

---

Manisha

At 02:06 AM 6/13/02 -0300, Manuel Lemos wrote:
>Hello,
>
>On 06/13/2002 01:59 AM, Manisha wrote:
>>I gave the command at root, I got some details
>>--
> 
>>
>>
>>Q-ID Size - Q-Time- Sender/Recipient
>>67Thu Jun 13 11.22 nobody
>> (host map: look up (aurica.com): deferred)
>> [EMAIL PROTECTED]
>>
>>-
> 
>>
>>What's the problem exactly? As I do not know much about Linux (Totally on 
>>windows), I am unable to figure out too.
>
>It looks like the your machine DNS does not seem to be properly configured.
>
>Type in the shell this command and tell me what it shows:
>
>nslookup TYPE=MX aurica.com
>
>--
>
>Regards,
>Manuel Lemos
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Re: Email not getting

2002-06-12 Thread Manuel Lemos

Hello,

On 06/13/2002 01:59 AM, Manisha wrote:
> I gave the command at root, I got some details
> 
> 
>--
> 
> 
> 
> 
> Q-ID Size - Q-Time- Sender/Recipient
> 
> 67Thu Jun 13 11.22 nobody
> (host map: look up (aurica.com): deferred)
> [EMAIL PROTECTED]
> 
> 
> 
>-
> 
> 
> 
> What's the problem exactly? As I do not know much about Linux (Totally 
> on windows), I am unable to figure out too.

It looks like the your machine DNS does not seem to be properly configured.

Type in the shell this command and tell me what it shows:

nslookup TYPE=MX aurica.com

-- 

Regards,
Manuel Lemos


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




Re: [PHP] Re: Email not getting

2002-06-12 Thread Manisha

I gave the command at root, I got some details

--


Q-ID Size - Q-Time- Sender/Recipient

67Thu Jun 13 11.22 nobody
 (host map: look up (aurica.com): deferred)
 [EMAIL PROTECTED]


-

What's the problem exactly? As I do not know much about Linux (Totally on 
windows), I am unable to figure out too.

Manisha



At 01:51 AM 6/13/02 -0300, you wrote:
>Hello,
>
>On 06/13/2002 12:07 AM, Manisha wrote:
>>I am trying to send mail from Linux Redhat server through PHP. It is not 
>>giving me any error but I am not getting any mail too.
>>Following is the code
>>
>>>$mailBody = "This is one line \ n This is a second line \n\n this is a 
>>third line";
>>$boolMail = mail ("[EMAIL PROTECTED]", "Test mail subj from local linux 
>>server - PHP", $mailBody);
>>print ("Email has been send ");
>>?>
>>-
>>Even I checked the email files at /var/spool/mqueue - There are 2 files, 
>>one with message and one with lots of other info. But then why I am not 
>>getting the emails ? Why they are remaining in the queue ? Is there any 
>>setting required in php.ini ?
>
>Just use the mailq command in the shell to see why the messages are stuck.
>
>
>
>--
>
>Regards,
>Manuel Lemos
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] embeding media from DB

2002-06-12 Thread Brad Wright

Hi all,
I have been able to upload a wav file to a mxSQl db using PHP script. Wanted
to be able to get that wav file from the db and embed it into a web page
using the default media player to play it.

Can anyone help??? 





Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strenght, in water there are
bacteria


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




[PHP] Re: Email not getting

2002-06-12 Thread Manuel Lemos

Hello,

On 06/13/2002 12:07 AM, Manisha wrote:
> I am trying to send mail from Linux Redhat server through PHP. It is not 
> giving me any error but I am not getting any mail too.
> 
> Following is the code
> 
> 
> 
>  $mailBody = "This is one line \ n This is a second line \n\n this is a 
> third line";
> 
> $boolMail = mail ("[EMAIL PROTECTED]", "Test mail subj from local linux 
> server - PHP", $mailBody);
> print ("Email has been send ");
> ?>
> 
> -
> 
> Even I checked the email files at /var/spool/mqueue - There are 2 files, 
> one with message and one with lots of other info. But then why I am not 
> getting the emails ? Why they are remaining in the queue ? Is there any 
> setting required in php.ini ?

Just use the mailq command in the shell to see why the messages are stuck.



-- 

Regards,
Manuel Lemos


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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

I get the same thing...I have to click twice, or refresh the page to get rid
of the info.

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:21 AM
To: '[EMAIL PROTECTED]'; Php
Subject: RE: [PHP] beginner in PHP


try this for chout()

function chout(){
global $mycart, $cart_items;
session_destroy();

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:18 PM
To: Martin Towell; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Thanks Martin!! That really helped out a lot. And thanks to all who tried to
help me. I appreciate it!

I have one other question that is really not so much important as it is
annoying, but I can't figure it out myself.

I'm practicing with sessions. What I'm making..if you couldn't tell by the
array output from before...is a test shopping cart. Now the annoyance is
that when I click the checkout link it's just supposed to destroy the
session and reset everything to 0 including the shopping cart. And also if
an item is clicked, that item gets deleted. With both choices when I click
once the session does get destroyed, but everything stays on the page until
I refresh the page. I want the info to get reset when I click the link.
Here's the delete and checkout code...remember they both do actually work,
just not as I want. Any suggestions on how to make it refresh on a click
only?

/ DELETE SHOPPING CART ITEMS

function chout(){
session_destroy();
$mycart = array();
$cart_items = 0;
echo "Thank you for shopping!";
}

if ($action == delnow)
{
unset($mycart[$itemid]);
}

// END DELETE SHOPPING CART ITEMS

if ($action == checkout)
{
chout();
}

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:55 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j < $cat_cnt; $j++)
if ($value == $catalog[$j]["itemcd"])
{
  echo $catalog[$j]["unitprice"];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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

Re: [PHP] converting C to PHP

2002-06-12 Thread Daniel Tryba

On Thu, Jun 13, 2002 at 02:13:48PM +1000, Martin Towell wrote:
> But what about the pointer &cp2
> 
>   If endptr is not NULL, strtol() stores the address of the first
>   invalid character in *endptr.  

In you example endptr is always NULL!

>   If there were no digits at all,
>   strtol() stores the original value of nptr in *endptr.  (Thus,
>   if *nptr is not `\0' but **endptr is `\0' on return, the entire
>   string is valid.)

Check if the returncode is false, then use $format instead.

> Instead of a pointer - a position number would be okay
> 
> (Actually, to get the number, I could just do "$cp-0" or "$cp*1" - gotta
> love variants)

>From your example I got the impression you are only interested in
multiplier

-- 

  Daniel Tryba


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




RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell

try this for chout()

function chout(){
global $mycart, $cart_items;
session_destroy();

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:18 PM
To: Martin Towell; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Thanks Martin!! That really helped out a lot. And thanks to all who tried to
help me. I appreciate it!

I have one other question that is really not so much important as it is
annoying, but I can't figure it out myself.

I'm practicing with sessions. What I'm making..if you couldn't tell by the
array output from before...is a test shopping cart. Now the annoyance is
that when I click the checkout link it's just supposed to destroy the
session and reset everything to 0 including the shopping cart. And also if
an item is clicked, that item gets deleted. With both choices when I click
once the session does get destroyed, but everything stays on the page until
I refresh the page. I want the info to get reset when I click the link.
Here's the delete and checkout code...remember they both do actually work,
just not as I want. Any suggestions on how to make it refresh on a click
only?

/ DELETE SHOPPING CART ITEMS

function chout(){
session_destroy();
$mycart = array();
$cart_items = 0;
echo "Thank you for shopping!";
}

if ($action == delnow)
{
unset($mycart[$itemid]);
}

// END DELETE SHOPPING CART ITEMS

if ($action == checkout)
{
chout();
}

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:55 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j < $cat_cnt; $j++)
if ($value == $catalog[$j]["itemcd"])
{
  echo $catalog[$j]["unitprice"];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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

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


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

-- 
PHP General Mailing List (http://www.php.net/)
To unsu

RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Thanks Martin!! That really helped out a lot. And thanks to all who tried to
help me. I appreciate it!

I have one other question that is really not so much important as it is
annoying, but I can't figure it out myself.

I'm practicing with sessions. What I'm making..if you couldn't tell by the
array output from before...is a test shopping cart. Now the annoyance is
that when I click the checkout link it's just supposed to destroy the
session and reset everything to 0 including the shopping cart. And also if
an item is clicked, that item gets deleted. With both choices when I click
once the session does get destroyed, but everything stays on the page until
I refresh the page. I want the info to get reset when I click the link.
Here's the delete and checkout code...remember they both do actually work,
just not as I want. Any suggestions on how to make it refresh on a click
only?

/ DELETE SHOPPING CART ITEMS

function chout(){
session_destroy();
$mycart = array();
$cart_items = 0;
echo "Thank you for shopping!";
}

if ($action == delnow)
{
unset($mycart[$itemid]);
}

// END DELETE SHOPPING CART ITEMS

if ($action == checkout)
{
chout();
}

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:55 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j < $cat_cnt; $j++)
if ($value == $catalog[$j]["itemcd"])
{
  echo $catalog[$j]["unitprice"];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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

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


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




RE: [PHP] converting C to PHP

2002-06-12 Thread Martin Towell

But what about the pointer &cp2

  If endptr is not NULL, strtol() stores the address of the first
  invalid character in *endptr.  If there were no digits at all,
  strtol() stores the original value of nptr in *endptr.  (Thus,
  if *nptr is not `\0' but **endptr is `\0' on return, the entire
  string is valid.)

Instead of a pointer - a position number would be okay

(Actually, to get the number, I could just do "$cp-0" or "$cp*1" - gotta
love variants)

-Original Message-
From: Daniel Tryba [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:12 PM
To: Martin Towell
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] converting C to PHP


On Thu, Jun 13, 2002 at 01:12:18PM +1000, Martin Towell wrote:
> I'm converting some C functions to PHP and have come across this:
> 
> int skipf(..., char *format)
> {
>   /* ... */
>   cp = format;
>   char *cp, *cp2;
>   multiplier = strtol(cp, &cp2, 10);
>   /* ... */
> }
> 
> 
> How can I implement this line in PHP ?
>   multiplier = strtol(cp, &cp2, 10);
> 
> 
> Oh, and an example of format is "12L20W2P"

And the outcome in this case would be 12? 

>From man strtol:


   The string must begin with an arbitrary  amount  of  white
   space  (as  determined by isspace(3)) followed by a single
   optional `+' or `-' sign.  If base  is  zero  or  16,  the
   string may then include a `0x' prefix, and the number will
   be read in base 16; otherwise, a zero base is taken as  10
   (decimal)  unless the next character is `0', in which case
   it is taken as 8 (octal).

   The remainder of the string is converted  to  a  long  int
   value in the obvious manner, stopping at the first charac­
   ter which is not a valid digit in  the  given  base.   (In
   bases  above  10,  the letter `A' in either upper or lower
   case represents 10, `B' represents 11, and so forth,  with
   `Z' representing 35.)


Sounds like a regexp would work, with base 10 this would make:

function skipf($str)
{
if(preg_match("/^\s*(\+|-)?(\d+)/",$str,$match))
{
return intval($match[1].$match[2],10);
}
else
{
return false;
}
}

$format="012L20W2P";
$int=skipf($format);

$int is 12 in this example.

-- 

  Daniel Tryba

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




Re: [PHP] converting C to PHP

2002-06-12 Thread Daniel Tryba

On Thu, Jun 13, 2002 at 01:12:18PM +1000, Martin Towell wrote:
> I'm converting some C functions to PHP and have come across this:
> 
> int skipf(..., char *format)
> {
>   /* ... */
>   cp = format;
>   char *cp, *cp2;
>   multiplier = strtol(cp, &cp2, 10);
>   /* ... */
> }
> 
> 
> How can I implement this line in PHP ?
>   multiplier = strtol(cp, &cp2, 10);
> 
> 
> Oh, and an example of format is "12L20W2P"

And the outcome in this case would be 12? 

From man strtol:


   The string must begin with an arbitrary  amount  of  white
   space  (as  determined by isspace(3)) followed by a single
   optional `+' or `-' sign.  If base  is  zero  or  16,  the
   string may then include a `0x' prefix, and the number will
   be read in base 16; otherwise, a zero base is taken as  10
   (decimal)  unless the next character is `0', in which case
   it is taken as 8 (octal).

   The remainder of the string is converted  to  a  long  int
   value in the obvious manner, stopping at the first charac­
   ter which is not a valid digit in  the  given  base.   (In
   bases  above  10,  the letter `A' in either upper or lower
   case represents 10, `B' represents 11, and so forth,  with
   `Z' representing 35.)


Sounds like a regexp would work, with base 10 this would make:

function skipf($str)
{
if(preg_match("/^\s*(\+|-)?(\d+)/",$str,$match))
{
return intval($match[1].$match[2],10);
}
else
{
return false;
}
}

$format="012L20W2P";
$int=skipf($format);

$int is 12 in this example.

-- 

  Daniel Tryba


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




[PHP] Re: [PHP-DB] Querying for MAX

2002-06-12 Thread Srinivasan Ramakrishnan

Hi César,

As others have obviously pointed out using MAX() is the way to go. Need I
mention that you can also insert values of your own making into an
auto_increment column as long as they are not already used by some other
record.

In your case since you have old records with IDs of their own making, you
can probably insert them at the beginning before the newer records actually
use an auto - generated ID.

Also by using mysql_insert_id () in PHP you can get the last inserted
auto-increment ID.

-Srini
--
http://symonds.net/~sriniram

- Original Message -
From: "César Aracena" <[EMAIL PROTECTED]>
To: "'PHP DB List'" <[EMAIL PROTECTED]>; "PHP General List"
<[EMAIL PROTECTED]>
Sent: Thursday, June 13, 2002 12:06 AM
Subject: [PHP-DB] Querying for MAX


I'm sorry if this mensaje is posted twice. I sent it yesterdays, but
then my ISP had problems with e-mail and I lost dozens of them and don't
know if sent OK.


Hi all,

What I'm trying to do here is not inside PHP nor MySQL books I have. I
need to query the DB to look the max result in a column. That is, if I
have affiliate members with ID going from 1 to 10, get the query to know
that the last member added was 10 so I can add member 11 without using
auto_increment, because I need to insert old members too which already
have ID numbers. Is that possible?

Thanks in advance,


Cesar Aracena 
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621





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




Re: [PHP] A question

2002-06-12 Thread Justin French

There is a difference in the default way php installs between 4.1.x and
4.2... the newer version comes with register_globals Off in the php.ini
file.  Simple solution, change this value to On in your php.ini file, and
restart.

However, you scripts will be a lot more secure if you leave register_globals
Off, and adapt your PHP scripts to suit the new methods using $_GET, $_POST,
$_SESSION, $_COOKIES, etc etc.

If you passed $id around in a URL before, then the new system would require
you to refer to $id as $_GET['id'].

So if you put this at the top of your script, everything should work:

$id = $_GET['id'];


There's a whole page dedicated to migrating from php4.1.x to php 4.2, which
includes information on this new system.  FWIW, it's also been discussed on
the list MANY times... just do a search for "register_globals" in the
archives.

this should give you some more info:
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.serve
r







on 13/06/02 1:53 PM, Vegitas Pride ([EMAIL PROTECTED]) wrote:

> I've had many troubles with my php, now I'm a beginner
> when it comes to php. I had installed Apache 1.3.2,
> and was trying to run simple php4. You know with
> index.php?id=yourpage with the code on the page being
>  See what happened is my
> hard-drive crashed and I lost all my programs ect. I
> managed to save my code for Apache, but with no luck
> am able to use php like I want again. I installed php
> 4.2.0 I believe, and well I was looking and with my
> old httpd.conf, I used a php4 ScriptAlias, well it
> pointed to some wierd place that I don't recall
> installing. Is there a different php.exe for php4? Do
> you understand, I think I'm in the dark here, and I
> just need to know what I'm doing wrong. Thanks.
> 
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com


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




[PHP] Re: beginner in PHP

2002-06-12 Thread Mark Gallagher

Phillip Perry writes: 

> Can someone tell me why this doesn't work?
> The $mycart array is fine and the $catalog array is also fine but nothing
> inside the if statement prints. I've tried other echo statements but nothing
> prints at all. 
> 
> while (list($key,$value) = each($mycart))
>   {
>if ($value == $catalog[itemcd])
>   { 
> 
>   echo $catalog[unitprice];

Try: 

 echo "$catalog[unitprice];" 

If that doesn't work, then check your if statement - what is the value of 
$value and $catalog[itemcd]? 

-- 
Mark Gallagher
http://cyberfuddle.com/infinitebabble/ 


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




RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell

here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j < $cat_cnt; $j++)
if ($value == $catalog[$j]["itemcd"])
{
  echo $catalog[$j]["unitprice"];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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

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

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




[PHP] A question

2002-06-12 Thread Vegitas Pride

I've had many troubles with my php, now I'm a beginner
when it comes to php. I had installed Apache 1.3.2,
and was trying to run simple php4. You know with
index.php?id=yourpage with the code on the page being
 See what happened is my
hard-drive crashed and I lost all my programs ect. I
managed to save my code for Apache, but with no luck
am able to use php like I want again. I installed php
4.2.0 I believe, and well I was looking and with my
old httpd.conf, I used a php4 ScriptAlias, well it
pointed to some wierd place that I don't recall
installing. Is there a different php.exe for php4? Do
you understand, I think I'm in the dark here, and I
just need to know what I'm doing wrong. Thanks.

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell

Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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

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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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



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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses [5] => roses )

1
1

Your output is different from the last print_r that Tom had me do. I wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog["itemcd"]) will produce a match (and you do need the quotes really
:)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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




Re: [PHP] Dynamic Arrays

2002-06-12 Thread Analysis & Solutions

Hi Folks:

I was going to propose something similar.  Allow me to tweak:

> 
> *
> *
> 
> 
> 
> on you script page
># $mand = array("foo", "bar");
  $mand = array('foo', 'bar');

>   # $cnt = count($mand);
>   # for ($i = 0; $i < $cnt; $i++)
>   #  if (!in_array($mand[$i], $my_array))
>   #echo "Error: You missed a required field - ".$mand[$i]."\n";

$Prob = array();
while ( list(,$Key) = each($mand) ) {
   if ( empty($_POST[$Key]) ) {
  $Prob[] = "$Key is a required field";
   }
}

if ( !empty($Prob) ) {
   echo "\n";
   while ( list(,$Val) = each($Prob) ) {
  echo " $Val.\n";
   }
   echo "\n";
} else {
   #  Go ahead.  Fields are filled in.
}

> ?>

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4] =>
roses ) Array ( [0] => Array ( [itemcd] => daisys
[itemcat] => FL [itemdesc] => Daisys, seed package 200/250 cnt [unitprice]
=> 2.2 ) [1] => Array ( [itemcd] => gerainiums
[itemcat] => FL [itemdesc] => Gerainiums, purple, seed package 25/30 cnt
[unitprice] => 0.85 ) [2] => Array ( [itemcd] =>
roses [itemcat] => FL [itemdesc] => Rose, white, root clump bush - spring
delivery [unitprice] => 35 ) [3] => Array (
[itemcd] => tomatoe [itemcat] => VG [itemdesc] => Tomatoe, Super-Burbee,
seedling flat, 12 plants [unitprice] => 12.5 ) [4]
=> Array ( [itemcd] => cucumber [itemcat] => VG [itemdesc] => Cucumber seed
package, Chyrnobyl hybrid cross 10cnt
[unitprice] => 0.03 ) [5] => Array ( [itemcd] => habanero [itemcat] => HP
[itemdesc] => Red Savina Habanero Pepper
seeds -- 20cnt, not for export [unitprice] => 2.85 ) [6] => Array ( [itemcd]
=> snapdragon [itemcat] => FL [itemdesc] =>
Snap Dragons, yellow/orange mix, seed package 50cnt [unitprice] => 1.25 )
[7] => Array ( [itemcd] => tulip [itemcat] => FL
[itemdesc] => Tulip bulbs ... spring delivery 8 sets [unitprice] => 42.5 )
[8] => Array ( [itemcd] => snappea [itemcat] => VG
[itemdesc] => Sugar snap peas - seed package 25 count [unitprice] => 2 ) [9]
=> Array ( [itemcd] => marigold [itemcat] =>
FL [itemdesc] => Marigold - Traditional ... seed package 40 cnt [unitprice]
=> 3.15 ) [10] => Array ( [itemcd] => bellpepper
[itemcat] => VG [itemdesc] => Green Bell Pepper - Sweet, seed package 30 cnt
[unitprice] => 4 ) [11] => Array ( [itemcd]
=> tigerlilly [itemcat] => FL [itemdesc] => Tiger Lilly seedlings 10cnt
[unitprice] => 5.2 ) [12] => Array ( [itemcd] => pequin
[itemcat] => HP [itemdesc] => Pequin ornamental hot pepper seed, 150 count
[unitprice] => 4.25 ) [13] => Array ( [itemcd]
=> seranno [itemcat] => HP [itemdesc] => Seranno Pepper - spicy! seed pack
42cnt [unitprice] => 1.25 ) [14] => Array (
[itemcd] => flamingo [itemcat] => LO [itemdesc] => Tacky plastic pink
flamingo, each [unitprice] => 5.23 ) [15] => Array (
[itemcd] => stork [itemcat] => LO [itemdesc] => Tacky plastic stork,
alienate the new mom! each [unitprice] => 7.25 ) [16]
=> Array ( [itemcd] => rabbit [itemcat] => LO [itemdesc] => Plastic lawn
rabbit, multiplies less than real, each [unitprice] =>
4.05 ) [17] => Array ( [itemcd] => barney [itemcat] => LO [itemdesc] =>
Barney the Giant Purple Dinosaur, take him please!
[unitprice] => 0.25 ) [18] => Array ( [itemcd] => gargoyle [itemcat] => LO
[itemdesc] => Gargoyle, plaster, for the goth in us
all! [unitprice] => 25 ) )

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:33 PM
To: '[EMAIL PROTECTED]'; Php
Subject: RE: [PHP] beginner in PHP


send the results of putting these two line just before your while loop
print_r($mycart);
print_r($catalog);

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:31 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Thanks, but that didn't work either

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys in an
array.
$catalog["itemcd"]
$catalog["unitprice"]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but
nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
> {
> if ($value == $catalog[itemcd])
> {
>
> echo $catalog[unitprice];
>
> }
> }
>
>
>Thanks
>
>Phil
>

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



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




RE: [PHP] beginner in PHP

2002-06-12 Thread Tom Rogers

Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value == 
$catalog["itemcd"]) will produce a match (and you do need the quotes really :)

echo "".print_r($catalogue)."".print_r($mycart)."";
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
>Thanks, but that didn't work either
>
>-Original Message-
>From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 11:32 PM
>To: [EMAIL PROTECTED]; Php
>Subject: Re: [PHP] beginner in PHP
>
>
>Hi
>itemcd and unitprice should be in quotes I think if they are keys in an
>array.
>$catalog["itemcd"]
>$catalog["unitprice"]
>
>Tom
>
>At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
>nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> > if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Dynamic Arrays

2002-06-12 Thread Miguel Cruz

On Wed, 12 Jun 2002, Tom Ray wrote:
> I have an array question. I want to use a dynamic array but I don't know 
> how to do this. What I want to do is this, I want to write a form script 
> that takes the elements of the form and submits them in the array then I 
> want to do a loop and check to see if each element in the array has a 
> value and then if it does bullocks for them, but if it doesn't then I 
> want it to come to a screeching halt and tell them what dolts they are 
> for missing a field. So basically I want to have a Required field option 
> for the form. I'm still learning arrays and dynamic arrays are just 
> throwing me and I can't find a good code example to work from.

Here's an example of what I think you're after:

   'Name: ',
'age' => 'Age: ',
'eyes' => 'Eyes:  Blue
   Red'
);

  if (isset($_REQUEST['form_posted']))
  {
$missing_field = 0;
$good_fields = '';
foreach ($fields as $name => $html)
{  
  if (!($val = $_REQUEST[$name]))
  { 
if (!$missing_field)
  echo "";
echo "The following field is mandatory:$html";
$missing_field = 1;
  }
  else
$good_fields .= "";
}
  
if ($missing_field)
{
  echo $good_fields
. '';
  exit;
}

else   
{   
  echo "Thank you for your input! Here's what we got:";
  foreach (array_keys($fields) as $name)
echo "$name: {$_REQUEST[$name]}";
  echo '';
}
  }  

  else
  {   
echo "";
foreach ($fields as $f)
  echo "$f";
echo '';
  }
   
  ?>

miguel


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




RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell

send the results of putting these two line just before your while loop
print_r($mycart);
print_r($catalog);

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:31 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Thanks, but that didn't work either

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys in an
array.
$catalog["itemcd"]
$catalog["unitprice"]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but
nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
> {
> if ($value == $catalog[itemcd])
> {
>
> echo $catalog[unitprice];
>
> }
> }
>
>
>Thanks
>
>Phil
>

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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Thanks, but that didn't work either

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys in an
array.
$catalog["itemcd"]
$catalog["unitprice"]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but
nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
> {
> if ($value == $catalog[itemcd])
> {
>
> echo $catalog[unitprice];
>
> }
> }
>
>
>Thanks
>
>Phil
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



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




Re: [PHP] Email not getting

2002-06-12 Thread Manisha

Hi,


How to get the php.ini file ? I tried to run phpinfo program and where I 
got following

Configuration File (php.ini) Path/usr/local/lib

I tried to open that file, it has only 2 lines as follows:

magic_quotes_gpc = On
error_reporting = 5


Any addition is required ?

Thanks
Manisha



At 10:13 PM 6/12/02 -0500, you wrote:
Yes what are your settings in php.ini, generally the default settings are
sufficient?
 > I am trying to send mail from Linux Redhat server through PHP. It is not
 > giving me any error but I am not getting any mail too.
 >
 > Following is the code
 >
 > 
 >
 >  $mailBody = "This is one line \ n This is a second line \n\n this is a
 > third line";
 >
 > $boolMail = mail ("[EMAIL PROTECTED]", "Test mail subj from local linux
 > server - PHP", $mailBody);
 > print ("Email has been send ");
 > ?>
 >
 > -
 >
 > Even I checked the email files at /var/spool/mqueue - There are 2 files,
 > one with message and one with lots of other info. But then why I am not
 > getting the emails ? Why they are remaining in the queue ? Is there any
 > setting required in php.ini ?
 >
 >
 > Thanks and regards
 > Manisha
 >
 >
 > --
 > PHP General Mailing List (http://www.php.net/)
 > To unsubscribe, visit: http://www.php.net/unsub.php
 >

-Pushkar S. Pradhan



Re: [PHP] beginner in PHP

2002-06-12 Thread Tom Rogers

Hi
itemcd and unitprice should be in quotes I think if they are keys in an array.
$catalog["itemcd"]
$catalog["unitprice"]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
> {
> if ($value == $catalog[itemcd])
> {
>
> echo $catalog[unitprice];
>
> }
> }
>
>
>Thanks
>
>Phil
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Thanks but that doesn't work.

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 10:59 PM
To: [EMAIL PROTECTED]
Cc: Php
Subject: Re: [PHP] beginner in PHP


Try this:

echo "$catalog[unitprice]";


in my experience I've only been able to use the echo() without the
quotation marks if I'm calling a function, for variables you need the
quotation marks.

Hope this helps.


Phillip Perry wrote:

>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but
nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
>   {
>if ($value == $catalog[itemcd])
>   {
>
>   echo $catalog[unitprice];
>
>   }
>   }
>
>
>Thanks
>
>Phil
>
>
>
>




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




RE: [PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

itemcd is an element of the array.. like this...

array ('itemcd' => 'book', 'itemdesc' => 'This book is great', 'unitprice'
=> '29.95');

-Original Message-
From: Pushkar Pradhan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] beginner in PHP


Is itemcd a variable then it should be used as $itemcd?
> Try this:
>
> echo "$catalog[unitprice]";
>
>
> in my experience I've only been able to use the echo() without the
> quotation marks if I'm calling a function, for variables you need the
> quotation marks.
>
> Hope this helps.
>
>
> Phillip Perry wrote:
>
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but
nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> >  if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


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



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




[PHP] converting C to PHP

2002-06-12 Thread Martin Towell

I'm converting some C functions to PHP and have come across this:

int skipf(..., char *format)
{
  /* ... */
  cp = format;
  char *cp, *cp2;
  multiplier = strtol(cp, &cp2, 10);
  /* ... */
}


How can I implement this line in PHP ?
  multiplier = strtol(cp, &cp2, 10);


Oh, and an example of format is "12L20W2P"

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




Re: [PHP] Email not getting

2002-06-12 Thread Pushkar Pradhan

Yes what are your settings in php.ini, generally the default settings are
sufficient?
> I am trying to send mail from Linux Redhat server through PHP. It is not
> giving me any error but I am not getting any mail too.
>
> Following is the code
>
> 
>
>  $mailBody = "This is one line \ n This is a second line \n\n this is a
> third line";
>
> $boolMail = mail ("[EMAIL PROTECTED]", "Test mail subj from local linux
> server - PHP", $mailBody);
> print ("Email has been send ");
> ?>
>
> -
>
> Even I checked the email files at /var/spool/mqueue - There are 2 files,
> one with message and one with lots of other info. But then why I am not
> getting the emails ? Why they are remaining in the queue ? Is there any
> setting required in php.ini ?
>
>
> Thanks and regards
> Manisha
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


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




Re: [PHP] beginner in PHP

2002-06-12 Thread Pushkar Pradhan

Is itemcd a variable then it should be used as $itemcd?
> Try this:
>
> echo "$catalog[unitprice]";
>
>
> in my experience I've only been able to use the echo() without the
> quotation marks if I'm calling a function, for variables you need the
> quotation marks.
>
> Hope this helps.
>
>
> Phillip Perry wrote:
>
> >Can someone tell me why this doesn't work?
> >The $mycart array is fine and the $catalog array is also fine but nothing
> >inside the if statement prints. I've tried other echo statements but nothing
> >prints at all.
> >
> >while (list($key,$value) = each($mycart))
> > {
> >  if ($value == $catalog[itemcd])
> > {
> >
> > echo $catalog[unitprice];
> >
> > }
> > }
> >
> >
> >Thanks
> >
> >Phil
> >
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan


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




[PHP] Email not getting

2002-06-12 Thread Manisha

I am trying to send mail from Linux Redhat server through PHP. It is not 
giving me any error but I am not getting any mail too.

Following is the code





-

Even I checked the email files at /var/spool/mqueue - There are 2 files, 
one with message and one with lots of other info. But then why I am not 
getting the emails ? Why they are remaining in the queue ? Is there any 
setting required in php.ini ?


Thanks and regards
Manisha


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




RE: [PHP] Dynamic Arrays

2002-06-12 Thread Martin Towell

If you want to use an array for you form, then here's one method

on you form page

*
*

...


on you script page
\n";
?>

I haven't tested it though. Maybe you could use array_diff() ???

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Dynamic Arrays


I have an array question. I want to use a dynamic array but I don't know 
how to do this. What I want to do is this, I want to write a form script 
that takes the elements of the form and submits them in the array then I 
want to do a loop and check to see if each element in the array has a 
value and then if it does bullocks for them, but if it doesn't then I 
want it to come to a screeching halt and tell them what dolts they are 
for missing a field. So basically I want to have a Required field option 
for the form. I'm still learning arrays and dynamic arrays are just 
throwing me and I can't find a good code example to work from.

TIA.


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

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




RE: [PHP] Varible Varibles

2002-06-12 Thread Peter

Ok,...

what sort situations would you benifit using the first method?

ie

is it more suiteable to making some conditions

eg

$a = foo;
while {$$a <= bar)
echo "$a";
endwhile;







-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 13 June 2002 12:44 PM
To: 'Peter'; Php
Subject: RE: [PHP] Varible Varibles


well, the first method is the same as saying
$a = "foo";
$foo = "bar";
echo "$a $foo";

whereas the second method is appending "bar" to $a (thus making it "foobar")

In first method, you get two variables, the second, just one

-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:42 PM
To: Php
Subject: [PHP] Varible Varibles


howdy,
I'm just curious here about varible varibles ... I know that you can, well
it's documented that you can, do the following



which will produce  foo bar

now what I am curious about is, how much of a difference does that really
make when you compare it to..






Cheers

Peter
"the only dumb question is the one that wasn't asked"



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


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




Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc

Hi John,



Btw, according to the error message, there's no such function as 'RIGHT' in 
PostgreSQl. (Sorry about referring to the string as an array in a session 
variable -- I've extracted the code from some other stuff that I had been 
working on.)

Sigh. I'd like to know why this doesn't work: how I can extract the last few 
characters from the array.

Regards,
Andre

On Wednesday 12 June 2002 09:34 pm, you wrote:
> I don't understand why you keep referring to the string as an array in a
> session variable. Can you show me  how you are issuing the query,
> fetching the result, assigning it to the session, etc...
>
> It should be as easy as this:
>
>  $result = MySQL_query("SELECT RIGHT(date_column,4) AS Year FROM
> tablename");
> while($row = MySQL_fetch_array($result))
> {
>   echo $row['Year'];
> }
> ?>
>
> You know you could write a simple little script to convert this into the
> correct format for a date column.
>
> If you want to do sorting by year, you can try this:
>
> SELECT date_column FROM table ORDER BY RIGHT(date_column,4) ASC
>
> ---John Holmes...
>
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 9:32 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Extracting from an Array
> >
> > Hi John,
> >
> > Yup. I know now that I've caused myself all sorts of grief when I set
>
> it
>
> > to
> > varchar. If I recall correctly (and I set this up four months ago when
>
> I
>
> > began coding) I couldn't get it format without the crummy little
>
> dashes.
>
> > So I
> > set it to a string.
> >
> > Much coding later, I realize that I could solve this problem by
>
> changing
>
> > it
> > back to 'date' type, but as i'm writing, I remember that this
>
> particular
>
> > array has only one use - and in a string format it's easier to
>
> manipulate.
>
> > [Bad reason, I guess with hindsight -- perhaps it's a hangover from my
> > Paradox PAL days where I needed to format the string for 'other
> > purposes'.]
> >
> > Your last point is precisely what I'm writing about: it IS all messed
>
> up!
>
> > So,
> > the upshot is - live with it, and don't use it; or change it. Hmmm. I
>
> had
>
> > planned to sort a column by 'Year', but it might be a case of
>
> 'overkill' -
>
> > -
> > the form is already loaded with enough options.
> >
> > Now that being said, this is more a problem of why can't I get ALL of
>
> the
>
> > last part of the array? Suppose I wanted to extarct something that was
>
> not
>
> > a
> > date like: $_SESSION['odd'] which was varchar in the format of
>
> "Session is
>
> > closed". Now if I wanted to extract the last part: 'closed' what I've
> > tried
> > wouldn't work. It would give me: "c" -- how would I get the rest of
>
> the
>
> > characters?
> >
> > Thanks for the advice,
> > Regards,
> > Andre
> >
> > On Wednesday 12 June 2002 08:25 pm, you wrote:
> > > What are the possible reasons that you "need it to be a varchar" ??
>
> Do
>
> > > you realize how much extra work you are creating for yourself? Do
>
> you
>
> > > realize that you can have your users enter data in one format, and
> > > convert it to another format for MySQL? Do you realize you can use
> > > DATE_FORMAT() in your query to re-format the date back to dd-mm-
>
> if
>
> > > you want to? Do you realize that if you ever wanted to sort by this
> > > column, you'd be all messed up? It'll sort as a string, where "10"
>
> is
>
> > > less than "2". Do you realize what I'm trying to say??
> > >
> > > ---John Holmes...
> > >
> > > > -Original Message-
> > > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, June 12, 2002 8:15 PM
> > > > To: Lazor, Ed
> > > > Cc: [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] Extracting from an Array
> > > >
> > > > Thanks Ed,
> > > >
> > > > Slight change -- I forgot that the delimiter was a 'space'.
>
> Anyway, I
>
> > > > still
> > > > get the first letter of the last part of the array. I guess what I
> > >
> > > need is
> > >
> > > > something that specifies a range as in something like this:
> > > >
> > > > $Year = $Date[3-whatever?];
> > > >
> > > > Seems rather odd that with the string as varchar it does this.
>
> I've no
>
> > > > problem extracting various parts of a date from type 'date' but
>
> this
>
> > > wierd
> > >
> > > > date-thingy. . .  how I wish I didn't need it as varchar.
> > > >
> > > > Anyway, thanks -- I plug away at it.
> > > >
> > > > Regards,
> > > > Andre
> > > >
> > > > On Wednesday 12 June 2002 07:09 pm, you wrote:
> > > > > $sql = "select fieldname from tablename";
> > > > > $Results = mysql_query($sql, $DBLink);
> > > > > $Row = mysql_fetch_array($Results);
> > > > > $fieldname = $Row["fieldname"];
> > > > > $Date = explode("-", $fieldname);
> > > > > $Year = $Date[2];
> > > > >
> > > > > > -Original Message-
> > > > > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > > > > > Sent: Wednesday, June 12, 2002 4:11 PM
> > > > > > To: [EMAIL PROTECTED]
> > > > >

Re: [PHP] beginner in PHP

2002-06-12 Thread Tom Ray

Try this:

echo "$catalog[unitprice]";


in my experience I've only been able to use the echo() without the 
quotation marks if I'm calling a function, for variables you need the 
quotation marks.

Hope this helps.


Phillip Perry wrote:

>Can someone tell me why this doesn't work?
>The $mycart array is fine and the $catalog array is also fine but nothing
>inside the if statement prints. I've tried other echo statements but nothing
>prints at all.
>
>while (list($key,$value) = each($mycart))
>   {
>if ($value == $catalog[itemcd])
>   {
>
>   echo $catalog[unitprice];
>
>   }
>   }
>
>
>Thanks
>
>Phil
>
>
>  
>



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




[PHP] beginner in PHP

2002-06-12 Thread Phillip Perry

Can someone tell me why this doesn't work?
The $mycart array is fine and the $catalog array is also fine but nothing
inside the if statement prints. I've tried other echo statements but nothing
prints at all.

while (list($key,$value) = each($mycart))
{
 if ($value == $catalog[itemcd])
{

echo $catalog[unitprice];

}
}


Thanks

Phil


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




Fwd: [PHP] Please HELP on SUID HELP

2002-06-12 Thread Yamin Prabudy

I used a script from PEAR to adduser/deluser/change password

the problem is the password file ini mode 600
and I run the script from web
I had turn on the
safe_mode = on
safe_mode_gid = on
the running script had a same UID GID with the password file

when I try it There a alot of error...
from reading the password file and I can't change the password
cause it said no permission to do that

can anyone help me with this suid stuf

Thanks in Advance
Yamin Prabudy


---
PRONET INTERNET SERVICE PROVIDER
http://www.pro.net.id
---


---
PRONET INTERNET SERVICE PROVIDER
http://www.pro.net.id
---


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



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




[PHP] Dynamic Arrays

2002-06-12 Thread Tom Ray

I have an array question. I want to use a dynamic array but I don't know 
how to do this. What I want to do is this, I want to write a form script 
that takes the elements of the form and submits them in the array then I 
want to do a loop and check to see if each element in the array has a 
value and then if it does bullocks for them, but if it doesn't then I 
want it to come to a screeching halt and tell them what dolts they are 
for missing a field. So basically I want to have a Required field option 
for the form. I'm still learning arrays and dynamic arrays are just 
throwing me and I can't find a good code example to work from.

TIA.


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




RE: [PHP] Varible Varibles

2002-06-12 Thread Martin Towell

well, the first method is the same as saying
$a = "foo";
$foo = "bar";
echo "$a $foo";

whereas the second method is appending "bar" to $a (thus making it "foobar")

In first method, you get two variables, the second, just one

-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 12:42 PM
To: Php
Subject: [PHP] Varible Varibles


howdy,
I'm just curious here about varible varibles ... I know that you can, well
it's documented that you can, do the following



which will produce  foo bar

now what I am curious about is, how much of a difference does that really
make when you compare it to..






Cheers

Peter
"the only dumb question is the one that wasn't asked"



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

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




[PHP] Varible Varibles

2002-06-12 Thread Peter

howdy,
I'm just curious here about varible varibles ... I know that you can, well
it's documented that you can, do the following



which will produce  foo bar

now what I am curious about is, how much of a difference does that really
make when you compare it to..






Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




[PHP] Re: POST/GET var problem

2002-06-12 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> take the following html code
> 
> 
> 
> 
> 
> Now when that is created by a php script the value that is passed back is 
> the following.
> 
> myimg.x="Click loc X"&myimg.y="Click loc y"
> 
> I could leave the name attribute off and I get an x/y value set that I can 
> use for some math functions I have.  The problem is that I have more than 
> one image that could be clicked on and depending on which you click on 
> determines what math to do.
> 
> $HTTP_POST_VARS['myimg.x'] seems to be an object as I can't do the following
> $x=$HTTP_POST_VARS['myimg.x'];
> 
> Anyone know how I can get this value into a variable I can use?

PHP will replace the dot with an underscore as dot is normally 
concatention operator.

Use 

$x=$HTTP_POST_VARS['myimg_x'];

or just test if _x or _y are set to see which image was used.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc

Hi John,

Yup. I know now that I've caused myself all sorts of grief when I set it to 
varchar. If I recall correctly (and I set this up four months ago when I 
began coding) I couldn't get it format without the crummy little dashes. So I 
set it to a string. 

Much coding later, I realize that I could solve this problem by changing it 
back to 'date' type, but as i'm writing, I remember that this particular 
array has only one use - and in a string format it's easier to manipulate. 
[Bad reason, I guess with hindsight -- perhaps it's a hangover from my 
Paradox PAL days where I needed to format the string for 'other purposes'.]

Your last point is precisely what I'm writing about: it IS all messed up! So, 
the upshot is - live with it, and don't use it; or change it. Hmmm. I had 
planned to sort a column by 'Year', but it might be a case of 'overkill' -- 
the form is already loaded with enough options.

Now that being said, this is more a problem of why can't I get ALL of the 
last part of the array? Suppose I wanted to extarct something that was not a 
date like: $_SESSION['odd'] which was varchar in the format of "Session is 
closed". Now if I wanted to extract the last part: 'closed' what I've tried 
wouldn't work. It would give me: "c" -- how would I get the rest of the 
characters?

Thanks for the advice,
Regards,
Andre

On Wednesday 12 June 2002 08:25 pm, you wrote:
> What are the possible reasons that you "need it to be a varchar" ?? Do
> you realize how much extra work you are creating for yourself? Do you
> realize that you can have your users enter data in one format, and
> convert it to another format for MySQL? Do you realize you can use
> DATE_FORMAT() in your query to re-format the date back to dd-mm- if
> you want to? Do you realize that if you ever wanted to sort by this
> column, you'd be all messed up? It'll sort as a string, where "10" is
> less than "2". Do you realize what I'm trying to say??
>
> ---John Holmes...
>
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 8:15 PM
> > To: Lazor, Ed
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Extracting from an Array
> >
> > Thanks Ed,
> >
> > Slight change -- I forgot that the delimiter was a 'space'. Anyway, I
> > still
> > get the first letter of the last part of the array. I guess what I
>
> need is
>
> > something that specifies a range as in something like this:
> >
> > $Year = $Date[3-whatever?];
> >
> > Seems rather odd that with the string as varchar it does this. I've no
> > problem extracting various parts of a date from type 'date' but this
>
> wierd
>
> > date-thingy. . .  how I wish I didn't need it as varchar.
> >
> > Anyway, thanks -- I plug away at it.
> >
> > Regards,
> > Andre
> >
> > On Wednesday 12 June 2002 07:09 pm, you wrote:
> > > $sql = "select fieldname from tablename";
> > > $Results = mysql_query($sql, $DBLink);
> > > $Row = mysql_fetch_array($Results);
> > > $fieldname = $Row["fieldname"];
> > > $Date = explode("-", $fieldname);
> > > $Year = $Date[2];
> > >
> > > > -Original Message-
> > > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, June 12, 2002 4:11 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] Extracting from an Array
> > > >
> > > >
> > > > I have a db field, type varchar, that is actually a 'date'
> > > > string formatted
> > > > as dd-mm-. I used type 'varchar' (rather than type
> > > > 'date') since I had to
> > > > accomplish other things with it.
> > > >
> > > > Now, however, I do need to extract the Year (the last four
> > > > digits in the
> > > > array). I've tried to access the array $_SESSION['expiry']
> > > > but I don't know
> > > > how to explode this array to extract all characters in last
> > > > item after the
> > > > last separator : i.e. '-'.  I've used "-" as the
> > > > separator, but I just
> > > > get the first number of the last part of the array, i.e.: '-Y'.
> > > >
> > > > Is there a way of extracting all characters in that array?
> > > >
> > > > I've tried a bunch of combinations, but I obviously don't
> > > > understand the
> > > > basic mechanics of array manipulation or 'slicing'. If
> > > > someone could point me
> > > > to a good resource, or explain what I'm doing wrong, I would
> > > > greatly any
> > > > assistance.
> > > >
> > > > Tia,
> > > > Andre
>
> 
> **
>
> > *
> >
> > >* This message is intended for the sole use of the individual and
>
> entity
>
> > to
> >
> > > whom it is addressed, and may contain information that is
>
> privileged,
>
> > > confidential and exempt from disclosure under applicable law.  If
>
> you
>
> > are
> >
> > > not the intended addressee, nor authorized to receive for the
>
> intended
>
> > > addressee, you are hereby notified that you may not use, copy,
>
> disclose
>
> > or
> >
> > > distribute to anyone the message or any information contained

[PHP] Re: Email validation

2002-06-12 Thread Manuel Lemos

Hello,

On 06/12/2002 01:56 PM, Jeroen Timmers wrote:
> Is there a simple function that validate an email adres

You may want to try this e-mail validation class that provides different 
levels of e-mail validation.

http://www.phpclasses.org/emailvalidation



-- 

Regards,
Manuel Lemos


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




RE: [PHP] safe scripting

2002-06-12 Thread John Holmes

Restart apache.

> -Original Message-
> From: Georgie Casey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 8:52 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] safe scripting
> 
> How do i setup safe mode scripting (each script has a different uid)
on my
> win32, apache, php setup? my plesk host has to use it and i want to be
> able
> to test my scripts on my own computer.
> 
> i set "safe mode = On" in my php.ini file but the script still lets me
> include a file, whereas the script on my proper host doesnt.
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] safe scripting

2002-06-12 Thread Georgie Casey

How do i setup safe mode scripting (each script has a different uid) on my
win32, apache, php setup? my plesk host has to use it and i want to be able
to test my scripts on my own computer.

i set "safe mode = On" in my php.ini file but the script still lets me
include a file, whereas the script on my proper host doesnt.




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




Re: [PHP] Email validation

2002-06-12 Thread Justin French

There is a great function library on http://killersoft.com/ which was
derived from what is widely considered the best email validation script in
Perl.

It also follows RFC 822 about as close as is possible.
[http://www.faqs.org/rfcs/rfc822.html]

I was about to start writing something simular, but decided not to re-invent
the wheel... I've adopted this script on every project from now on, thanks
to the kind person on this list who let me know about it!


Justin French


on 13/06/02 2:56 AM, Jeroen Timmers ([EMAIL PROTECTED]) wrote:

> Is there a simple function that validate an email adres
> 
> Thx
> 
> Jeroen Timmers
> 


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




RE: [PHP] Creatng a PHP chatroom

2002-06-12 Thread Peter

have a look on www.phpbuilder.com zend.com, www.phpwizard.net & the like and
have a look there .. particually phpwizard as there is  phpirc in there
under projects

Cheers
Peter

-Original Message-
From: Phil Powell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 13 June 2002 10:02 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Creatng a PHP chatroom


I am intrested in creating a chatroom entirely in PHP involving streaming
text.  Where can someone help me to find such a means of doing so?

Thanx
Phil
http://valsignalandet.com



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




RE: [PHP] POST Arrays with register globals..

2002-06-12 Thread John Holmes

$_POST['groups'] is an array. It's size is going to be dependant on how
many check boxes were checked. 

So, in your example, if only blah2 is selected, you'll have

$_POST['groups'][0] == '2'

You can use count($_POST['groups']) to see how many boxes were checked.

---John Holmes...

> -Original Message-
> From: Adam Plocher [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 4:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] POST Arrays with register globals..
> 
>  
blah1
> &nbps;
blah2
>  
blah3
> 
> I can't seem to access that data correctly when that form gets
submitted.
> 
> I have tried:
> 
> $groups[] = $_POST['groups[]'];
> and
> $groups[] = $_POST['groups'];
> 
> no luck..
> 
> Can somebody please give me a hand, thanks a lot.
> 
> -Adam


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




RE: [PHP] POST/GET var problem

2002-06-12 Thread John Holmes

When a user clicks on an image to submit, two variables are created...

$image_x and $image_y

Or, using the HTTP or super global variables...

$HTTP_POST_VARS['image_x'], $HTTP_POST_VARS['image_y']
$_POST['image_x'], $_POST['image_y']

Try those...I'm pretty sure that's how it still works.

---John Holmes...

> -Original Message-
> From: Anzak Wolf [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 6:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] POST/GET var problem
> 
> take the following html code
> 
> 
> 
> 
> 
> Now when that is created by a php script the value that is passed back
is
> the following.
> 
> myimg.x="Click loc X"&myimg.y="Click loc y"
> 
> I could leave the name attribute off and I get an x/y value set that I
can
> use for some math functions I have.  The problem is that I have more
than
> one image that could be clicked on and depending on which you click on
> determines what math to do.
> 
> $HTTP_POST_VARS['myimg.x'] seems to be an object as I can't do the
> following
> $x=$HTTP_POST_VARS['myimg.x'];
> 
> Anyone know how I can get this value into a variable I can use?
> 
> _
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Re: Querying for MAX

2002-06-12 Thread John Holmes

Show your code and learn how to use the MySQL_fetch_array() function...

www.php.net/mysql_fetch_array

---John Holmes...

> -Original Message-
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 6:19 PM
> To: PHP DB List; PHP General List
> Subject: RE: [PHP] Re: Querying for MAX
> 
> When I try to use this SELECT MAX(column) AS amount FROM table; with
> PHP, the result I get is always: "Resource id #2" and not the number I
> expect... but if I run this at the mysql command line, it shows the
> expected number/value. What is that?
> 
> César Aracena
> IS / MCSE+I
> Neuquén, NQN
> (0299) 156-356688
> (0299) 446-6621
> 
> > -Mensaje original-
> > De: Leon Mergen [mailto:[EMAIL PROTECTED]]
> > Enviado el: Miércoles, 12 de Junio de 2002 05:13 p.m.
> > Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Asunto: [PHP] Re: Querying for MAX
> >
> > select max(id) as amount from table
> >
> > "César aracena" <[EMAIL PROTECTED]> wrote in message
> > 003301c21240$0cdcf790$89c405c8@gateway">news:003301c21240$0cdcf790$89c405c8@gateway...
> > I'm sorry if this mensaje is posted twice. I sent it yesterdays, but
> > then my ISP had problems with e-mail and I lost dozens of them and
> don't
> > know if sent OK.
> >
> >
> > Hi all,
> >
> > What I'm trying to do here is not inside PHP nor MySQL books I have.
I
> > need to query the DB to look the max result in a column. That is, if
I
> > have affiliate members with ID going from 1 to 10, get the query to
> know
> > that the last member added was 10 so I can add member 11 without
using
> > auto_increment, because I need to insert old members too which
already
> > have ID numbers. Is that possible?
> >
> > Thanks in advance,
> >
> >
> > Cesar Aracena 
> > CE / MCSE+I
> > Neuquen, Argentina
> > +54.299.6356688
> > +54.299.4466621
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Extracting from an Array

2002-06-12 Thread John Holmes

What are the possible reasons that you "need it to be a varchar" ?? Do
you realize how much extra work you are creating for yourself? Do you
realize that you can have your users enter data in one format, and
convert it to another format for MySQL? Do you realize you can use
DATE_FORMAT() in your query to re-format the date back to dd-mm- if
you want to? Do you realize that if you ever wanted to sort by this
column, you'd be all messed up? It'll sort as a string, where "10" is
less than "2". Do you realize what I'm trying to say??

---John Holmes...

> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 8:15 PM
> To: Lazor, Ed
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Extracting from an Array
> 
> Thanks Ed,
> 
> Slight change -- I forgot that the delimiter was a 'space'. Anyway, I
> still
> get the first letter of the last part of the array. I guess what I
need is
> something that specifies a range as in something like this:
> 
> $Year = $Date[3-whatever?];
> 
> Seems rather odd that with the string as varchar it does this. I've no
> problem extracting various parts of a date from type 'date' but this
wierd
> date-thingy. . .  how I wish I didn't need it as varchar.
> 
> Anyway, thanks -- I plug away at it.
> 
> Regards,
> Andre
> 
> 
> On Wednesday 12 June 2002 07:09 pm, you wrote:
> > $sql = "select fieldname from tablename";
> > $Results = mysql_query($sql, $DBLink);
> > $Row = mysql_fetch_array($Results);
> > $fieldname = $Row["fieldname"];
> > $Date = explode("-", $fieldname);
> > $Year = $Date[2];
> >
> > > -Original Message-
> > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, June 12, 2002 4:11 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Extracting from an Array
> > >
> > >
> > > I have a db field, type varchar, that is actually a 'date'
> > > string formatted
> > > as dd-mm-. I used type 'varchar' (rather than type
> > > 'date') since I had to
> > > accomplish other things with it.
> > >
> > > Now, however, I do need to extract the Year (the last four
> > > digits in the
> > > array). I've tried to access the array $_SESSION['expiry']
> > > but I don't know
> > > how to explode this array to extract all characters in last
> > > item after the
> > > last separator : i.e. '-'.  I've used "-" as the
> > > separator, but I just
> > > get the first number of the last part of the array, i.e.: '-Y'.
> > >
> > > Is there a way of extracting all characters in that array?
> > >
> > > I've tried a bunch of combinations, but I obviously don't
> > > understand the
> > > basic mechanics of array manipulation or 'slicing'. If
> > > someone could point me
> > > to a good resource, or explain what I'm doing wrong, I would
> > > greatly any
> > > assistance.
> > >
> > > Tia,
> > > Andre
> >
> >
>

**
> *
> >* This message is intended for the sole use of the individual and
entity
> to
> > whom it is addressed, and may contain information that is
privileged,
> > confidential and exempt from disclosure under applicable law.  If
you
> are
> > not the intended addressee, nor authorized to receive for the
intended
> > addressee, you are hereby notified that you may not use, copy,
disclose
> or
> > distribute to anyone the message or any information contained in the
> > message.  If you have received this message in error, please
immediately
> > advise the sender by reply email and delete the message.  Thank you
very
> > much.
> 
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the Holy Souls in Purgatory.
> 
> May God bless you abundantly in His love!
> For a free Cenacle Scriptural Rosary Booklet:
http://www.webhart.net/csrb/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Querying for MAX <-- solved

2002-06-12 Thread César Aracena

Come to think now, you are all right about making the field
auto_increment, instead of asking the DB which one is the following
number. It's just that I have a pretty large old DB in which this field
is NOT in sequence and should be imported before I keep designing the
scripts.

Thanks to all of you who helped me.

César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621

> -Mensaje original-
> De: John Holmes [mailto:[EMAIL PROTECTED]]
> Enviado el: Miércoles, 12 de Junio de 2002 08:51 p.m.
> Para: 'César Aracena'; 'PHP DB List'; 'PHP General List'
> Asunto: RE: [PHP] Querying for MAX
> 
> Just note that this will fail miserably unless you are locking your
> tables around the SELECT MAX() and the INSERT. What if 3 different
users
> all select the same MAX() and try to insert the next number?
> 
> You really need to re-think your database design if you have to do it
> this way.
> 
> ---John Holmes...
> 
> > -Original Message-
> > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 2:51 PM
> > To: 'PHP DB List'; 'PHP General List'
> > Subject: RE: [PHP] Querying for MAX
> >
> > Thanks Natalie & Ed. This Works just fine.
> >
> > What I want to do, is let a person subscribe new affiliates without
> > having to look up what the last affiliate's number was and show the
> next
> > one in the "new affiliate" form.
> >
> > César Aracena
> > IS / MCSE+I
> > Neuquén, NQN
> > (0299) 156-356688
> > (0299) 446-6621
> >
> > > -Mensaje original-
> > > De: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]]
> > > Enviado el: Miércoles, 12 de Junio de 2002 03:39 p.m.
> > > Para: 'César Aracena'; 'PHP DB List'; PHP General List
> > > Asunto: RE: [PHP] Querying for MAX
> > >
> > > is
> > >
> > > select MAX()
> > >
> > > what you are looking for?  I know it works on numeric columns, I'm
> not
> > > sure
> > > if it works on non-numbers, you'd have to look it up in a SQL
> Tutorial
> > > somewhere.
> > >
> > > Good luck!
> > >
> > > -Natalie
> > >
> > > -Original Message-
> > > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, June 12, 2002 2:36 PM
> > > To: 'PHP DB List'; PHP General List
> > > Subject: [PHP] Querying for MAX
> > >
> > >
> > > I'm sorry if this mensaje is posted twice. I sent it yesterdays,
but
> > then
> > > my
> > > ISP had problems with e-mail and I lost dozens of them and don't
> know
> > if
> > > sent OK.
> > >
> > >
> > > Hi all,
> > >
> > > What I'm trying to do here is not inside PHP nor MySQL books I
have.
> I
> > > need
> > > to query the DB to look the max result in a column. That is, if I
> have
> > > affiliate members with ID going from 1 to 10, get the query to
know
> > that
> > > the
> > > last member added was 10 so I can add member 11 without using
> > > auto_increment, because I need to insert old members too which
> already
> > > have
> > > ID numbers. Is that possible?
> > >
> > > Thanks in advance,
> > >
> > >
> > > Cesar Aracena 
> > > CE / MCSE+I
> > > Neuquen, Argentina
> > > +54.299.6356688
> > > +54.299.4466621
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Extracting from an Array

2002-06-12 Thread David Freeman


 > I have a db field, type varchar, that is actually a 'date' 
 > string formatted as dd-mm-. I used type 'varchar' (rather than 
 > type 'date') since I had to accomplish other things with it.

 > Now, however, I do need to extract the Year (the last four 
 > digits in the array).

Ummm, are you sure it's an array?  How are you extracting the date
string from your database?  Normally you'd end up with a string when you
extract a varchar field from a database.

 > I've tried to access the array $_SESSION['expiry'] but I don't know 
 > how to explode this array to extract all characters

I take it you are setting this session variable from the date
information in the database?

Is the code that sets the session variable changing the format of the
database information at all?  If not then you should still have your
date in the form 'dd-mm-' shouldn't you?

 > Is there a way of extracting all characters in that array?

I'm not sure you have an array to deal with unless you're talking about
the result of exploding your text string.

If you've exploded your string and are now trying to deal with the array
then, given what you've said, $array_name[2] would probably contain the
year.

Alternately, if you've got the string to work with you might find it
just as effective to do this:

$year = substr($full_date_string, -4);

This will grab the last four characters from the string which, in your
case, would be the year.

CYA, Dave


--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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




RE: [PHP] Extracting from an Array

2002-06-12 Thread John Holmes

How about just

SELECT RIGHT(fieldname,4) FROM tablename

---John Holmes...

> -Original Message-
> From: Lazor, Ed [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 7:09 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Extracting from an Array
> 
> 
> $sql = "select fieldname from tablename";
> $Results = mysql_query($sql, $DBLink);
> $Row = mysql_fetch_array($Results);
> $fieldname = $Row["fieldname"];
> $Date = explode("-", $fieldname);
> $Year = $Date[2];
> 
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 4:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Extracting from an Array
> >
> >
> > I have a db field, type varchar, that is actually a 'date'
> > string formatted
> > as dd-mm-. I used type 'varchar' (rather than type
> > 'date') since I had to
> > accomplish other things with it.
> >
> > Now, however, I do need to extract the Year (the last four
> > digits in the
> > array). I've tried to access the array $_SESSION['expiry']
> > but I don't know
> > how to explode this array to extract all characters in last
> > item after the
> > last separator : i.e. '-'.  I've used "-" as the
> > separator, but I just
> > get the first number of the last part of the array, i.e.: '-Y'.
> >
> > Is there a way of extracting all characters in that array?
> >
> > I've tried a bunch of combinations, but I obviously don't
> > understand the
> > basic mechanics of array manipulation or 'slicing'. If
> > someone could point me
> > to a good resource, or explain what I'm doing wrong, I would
> > greatly any
> > assistance.
> >
> > Tia,
> > Andre
> >
> 
>

**
> **
> This message is intended for the sole use of the individual and entity
to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you
are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy,
disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please
immediately
> advise the sender by reply email and delete the message.  Thank you
very
> much.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc

Thanks Ed,

Slight change -- I forgot that the delimiter was a 'space'. Anyway, I still 
get the first letter of the last part of the array. I guess what I need is 
something that specifies a range as in something like this:

$Year = $Date[3-whatever?];

Seems rather odd that with the string as varchar it does this. I've no 
problem extracting various parts of a date from type 'date' but this wierd 
date-thingy. . .  how I wish I didn't need it as varchar.

Anyway, thanks -- I plug away at it.

Regards,
Andre


On Wednesday 12 June 2002 07:09 pm, you wrote:
> $sql = "select fieldname from tablename";
> $Results = mysql_query($sql, $DBLink);
> $Row = mysql_fetch_array($Results);
> $fieldname = $Row["fieldname"];
> $Date = explode("-", $fieldname);
> $Year = $Date[2];
>
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 4:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Extracting from an Array
> >
> >
> > I have a db field, type varchar, that is actually a 'date'
> > string formatted
> > as dd-mm-. I used type 'varchar' (rather than type
> > 'date') since I had to
> > accomplish other things with it.
> >
> > Now, however, I do need to extract the Year (the last four
> > digits in the
> > array). I've tried to access the array $_SESSION['expiry']
> > but I don't know
> > how to explode this array to extract all characters in last
> > item after the
> > last separator : i.e. '-'.  I've used "-" as the
> > separator, but I just
> > get the first number of the last part of the array, i.e.: '-Y'.
> >
> > Is there a way of extracting all characters in that array?
> >
> > I've tried a bunch of combinations, but I obviously don't
> > understand the
> > basic mechanics of array manipulation or 'slicing'. If
> > someone could point me
> > to a good resource, or explain what I'm doing wrong, I would
> > greatly any
> > assistance.
> >
> > Tia,
> > Andre
>
> ***
>* This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.

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

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

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




[PHP] Creatng a PHP chatroom

2002-06-12 Thread Phil Powell

I am intrested in creating a chatroom entirely in PHP involving streaming text.  Where 
can someone help me to find such a means of doing so?

Thanx
Phil
http://valsignalandet.com




RE: [PHP] RE: Thumbnails from mySQL binary data

2002-06-12 Thread John Holmes

Make it when it's uploaded. Then you make just one user wait on the
server, instead of the multitude of users just viewing pages...

---John Holmes...

> -Original Message-
> From: Shane [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 4:10 PM
> To: Philip Hallstrom
> Cc: php
> Subject: [PHP] RE: Thumbnails from mySQL binary data
> 
> I have read warnings that this (imagecreatefromstring.php) is killer
SLOW
> simply because it is server side. Have you found this to be true?
> 
> Would you suggest just making the thumbnail when the file is uploaded,
or
> do you think it is wiser just to  make a thumbnail when the user
requests
> it, and just make them wait for the server side code to crunch?
> 
> Thanks again group!!!
> - NorthBayShane
> 
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 12:56 PM
> To: Shane
> Cc: php
> Subject: Re: Thumbnails from mySQL binary data
> 
> 
> start with this:
> 
> http://www.php.net/manual/en/function.imagecreatefromstring.php
> 
> On Wed, 12 Jun 2002, Shane wrote:
> 
> > Greetings, I just started playing with the GD functions. (FUN!!!)
And I
> am looking for advice or scripts on how to turn binary data from my DB
> into thumbnails.
> >
> > I understand how to make thumbnails from existing images already
> "sitting in a directory," but how can I get a scaled image to be made
> directly from the binary data in my DB.
> >
> > Your guidance or advice would be most helpful and TRULY appreciated.
> >
> > As always, my final functions will be posted for all.
> > Thanks in advance my friends!!!
> >
> > - NorthBayShane
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] calc.php missing in cvs

2002-06-12 Thread David Norman

I checked out the version of Date by Baba, but I don't see Calc.php in
the Date subdirectory on cvs.php.net.

David Norman - deekayen
http://atthat.com/

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: [PHP] Postgres query problem

2002-06-12 Thread Aaron

Yeah, I found the problem, It was adding a "order by lower(title)"  in 
another class which I forgot about when I was trying to test the query.

so it works fine now. So yep, using, joines, case, order bys, 
lowers,inheritance in php/postgres all work fine.


1LT John W. Holmes wrote:

>Double check that  you have a.title, and not just title by itself. Two
>tables must have a title column, so make sure  you specify which one you
>mean.
>
>---John Holmes...
>
>- Original Message -
>From: "Aaron" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, June 12, 2002 12:40 AM
>Subject: [PHP] Postgres query problem
>
>
>  
>
>>I have a sql quer like this : " select a.title AS bugga, b.id AS asdf
>>FROM tableone AS a FULL JOIN tabletwo AS b ON(a.title=b.filething)"
>>
>>anyway, thats a test query which is slightly smaller then the one I
>>want. BUT when i use it from the command console in postgres, it works
>>no problem
>>
>>but in php it complains about ambiguos column "title"..   so I dont
>>know what I can do about it.
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>  
>




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




RE: [PHP] Querying for MAX

2002-06-12 Thread John Holmes

Just note that this will fail miserably unless you are locking your
tables around the SELECT MAX() and the INSERT. What if 3 different users
all select the same MAX() and try to insert the next number?

You really need to re-think your database design if you have to do it
this way.

---John Holmes...

> -Original Message-
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 2:51 PM
> To: 'PHP DB List'; 'PHP General List'
> Subject: RE: [PHP] Querying for MAX
> 
> Thanks Natalie & Ed. This Works just fine.
> 
> What I want to do, is let a person subscribe new affiliates without
> having to look up what the last affiliate's number was and show the
next
> one in the "new affiliate" form.
> 
> César Aracena
> IS / MCSE+I
> Neuquén, NQN
> (0299) 156-356688
> (0299) 446-6621
> 
> > -Mensaje original-
> > De: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]]
> > Enviado el: Miércoles, 12 de Junio de 2002 03:39 p.m.
> > Para: 'César Aracena'; 'PHP DB List'; PHP General List
> > Asunto: RE: [PHP] Querying for MAX
> >
> > is
> >
> > select MAX()
> >
> > what you are looking for?  I know it works on numeric columns, I'm
not
> > sure
> > if it works on non-numbers, you'd have to look it up in a SQL
Tutorial
> > somewhere.
> >
> > Good luck!
> >
> > -Natalie
> >
> > -Original Message-
> > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 2:36 PM
> > To: 'PHP DB List'; PHP General List
> > Subject: [PHP] Querying for MAX
> >
> >
> > I'm sorry if this mensaje is posted twice. I sent it yesterdays, but
> then
> > my
> > ISP had problems with e-mail and I lost dozens of them and don't
know
> if
> > sent OK.
> >
> >
> > Hi all,
> >
> > What I'm trying to do here is not inside PHP nor MySQL books I have.
I
> > need
> > to query the DB to look the max result in a column. That is, if I
have
> > affiliate members with ID going from 1 to 10, get the query to know
> that
> > the
> > last member added was 10 so I can add member 11 without using
> > auto_increment, because I need to insert old members too which
already
> > have
> > ID numbers. Is that possible?
> >
> > Thanks in advance,
> >
> >
> > Cesar Aracena 
> > CE / MCSE+I
> > Neuquen, Argentina
> > +54.299.6356688
> > +54.299.4466621
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Querying for MAX

2002-06-12 Thread Martin Towell

what's you're after is
select max(id) from table

-Original Message-
From: David Freeman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 9:36 AM
To: 'PHP General List'
Subject: RE: [PHP] Querying for MAX




 > What I'm trying to do here is not inside PHP nor MySQL books 
 > I have. I need to query the DB to look the max result in a 
 > column. That is, if I have affiliate members with ID going 
 > from 1 to 10, get the query to know that the last member 
 > added was 10 so I can add member 11 without using 
 > auto_increment, because I need to insert old members too 
 > which already have ID numbers. Is that possible?

This is really a mysql question rather than a php question and would
probably be more appropriate to a mysql list.  In any event, if you
seriously think auto_increment is not your solution here you probably
need to rethink your database design.  This is exactly what
auto_increment is for.  If someone is already in the list then you can
get their ID with a select and then do an update on their row, if
someone doesn't exist then you add them and ID auto_increments in the
process.

--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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

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




[PHP] Re: Email howTo ?

2002-06-12 Thread Manuel Lemos

Hello,

On 06/12/2002 05:42 PM, Septic Flesh wrote:
> any way to send an email with php without using SENDMAIL ???  in a linux
> (slack8) ?

You can use SMTP but not with mail() under Linux.

If you want to use SMTP, you may want to try this class.

http://www.phpclasses.org/smtpclass


-- 

Regards,
Manuel Lemos


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




RE: [PHP] Querying for MAX

2002-06-12 Thread David Freeman



 > What I’m trying to do here is not inside PHP nor MySQL books 
 > I have. I need to query the DB to look the max result in a 
 > column. That is, if I have affiliate members with ID going 
 > from 1 to 10, get the query to know that the last member 
 > added was 10 so I can add member 11 without using 
 > auto_increment, because I need to insert old members too 
 > which already have ID numbers. Is that possible?

This is really a mysql question rather than a php question and would
probably be more appropriate to a mysql list.  In any event, if you
seriously think auto_increment is not your solution here you probably
need to rethink your database design.  This is exactly what
auto_increment is for.  If someone is already in the list then you can
get their ID with a select and then do an update on their row, if
someone doesn't exist then you add them and ID auto_increments in the
process.

--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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




RE: [PHP] Automatic user login under NT

2002-06-12 Thread John Holmes

It is $_SERVER["LOGON_USER"]. You have to enable Integrated Windows
Authentication under Directory Security in IIS>

---John Holmes...

> -Original Message-
> From: Barajas, Arturo [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 12:43 PM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] Automatic user login under NT
> 
> Greetings, everyone.
> 
> I'm new on the list (not so on PHP).
> 
> I'm stuck with a little problem, I'm trying to implement some PHP
pages at
> work, where ASP is used. The platform is NT 4.0 SP6, with PHP 4.2.1.
> 
> My problem is that with ASP I can have something like
> Request.ServerVariables("LOGON_USER"). I've tried using
> $_SERVER["LOGON_USER"] but to no avail. Curiously,
> Request.ServerVariables("REMOTE_ADDR") and $_SERVER["REMOTE_ADDR"]
work
> like a charm.
> 
> How can I obtain the login the user entered when logged to his/her
> machine?
> 
> Thanks in advance.
> --
> Un gran saludo/Big regards...
>Arturo Barajas
>Sistemas PPG SJR
>+52 (427) 271-9100, ext. 448
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] F5 problem...

2002-06-12 Thread Chris Shiflett

The best way to do this is with an HTTP header called Location.

It is used like this. If page1.php contains a form that submits to 
page2.php, you will want to handle the form data with page2.php, and 
when you're finished, have a line that looks like this:

header("Location: http://yoursite.org/page3.php";);

In this example page3.php would be what you want the user to see, so any 
output that is in page2.php should be moved to here. When the user 
refreshes the page, only page3.php will be executed. If the user clicks 
back once, page1.php is displayed (the form). So, the intermediate 
"processing" page is transparent.

Chris

WISTA.pl wrote:

>Hello group,
>
>I need a good solution to prevent sending form data to server after hiting
>refresh. How can PHP know  that user hit refresh and sent data that already
>have been  stored in database (without querying database)?
>
>Remek
>
>
>
>  
>



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




RE: [PHP] F5 problem...

2002-06-12 Thread Lazor, Ed

Create seperate documents:  one to display the form and another to process
the form.  

add.php // displays new form
add_handler.php  // process form input

On the form processing, check for the presence of HTTP_POST_VARS before
proceeding.

if (isset($HTTP_POST_VARS))
{
###  process form ###
}
else
header("Location: add.php");



> -Original Message-
> From: WISTA.pl [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 3:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] F5 problem...
> 
> 
> Hello group,
> 
> I need a good solution to prevent sending form data to server 
> after hiting
> refresh. How can PHP know  that user hit refresh and sent 
> data that already
> have been  stored in database (without querying database)?
> 
> Remek
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] F5 problem...

2002-06-12 Thread WISTA.pl

Hello group,

I need a good solution to prevent sending form data to server after hiting
refresh. How can PHP know  that user hit refresh and sent data that already
have been  stored in database (without querying database)?

Remek



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




RE: [PHP] Extracting from an Array

2002-06-12 Thread Lazor, Ed


$sql = "select fieldname from tablename";
$Results = mysql_query($sql, $DBLink);
$Row = mysql_fetch_array($Results);
$fieldname = $Row["fieldname"];
$Date = explode("-", $fieldname);
$Year = $Date[2];

> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Extracting from an Array
> 
> 
> I have a db field, type varchar, that is actually a 'date' 
> string formatted 
> as dd-mm-. I used type 'varchar' (rather than type 
> 'date') since I had to 
> accomplish other things with it.
> 
> Now, however, I do need to extract the Year (the last four 
> digits in the 
> array). I've tried to access the array $_SESSION['expiry'] 
> but I don't know 
> how to explode this array to extract all characters in last 
> item after the 
> last separator : i.e. '-'.  I've used "-" as the 
> separator, but I just 
> get the first number of the last part of the array, i.e.: '-Y'.
> 
> Is there a way of extracting all characters in that array?
> 
> I've tried a bunch of combinations, but I obviously don't 
> understand the 
> basic mechanics of array manipulation or 'slicing'. If 
> someone could point me 
> to a good resource, or explain what I'm doing wrong, I would 
> greatly any 
> assistance.
> 
> Tia,
> Andre
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] Re: Automatic user login under NT

2002-06-12 Thread Steve Edberg

At 01:39 PM 6/12/02 , Barajas, Arturo wrote:
> > From: Lazor, Ed [mailto:[EMAIL PROTECTED]]
>
>Hi, Ed.
>
> > and I'm pretty sure I'm not the only one he's helped.  That
> > garners even more respect - IMHO.
>
>I'm new on the list, so I really don't know Rasmus, or what he does. As 
>far as I've read messages, he seems to be really appreciated and 
>respected, one way or another.


You can check out this bit from the PHP archives, written by Rasmus:

 http://www.php.net/manual/phpfi2.php#history

and take a look through the credits

 http://www.php.net/credits.php

and count how many times his name appears. In short, PHP sprang from his 
brain. Now, it springs from many brains.

 -steve


++
| Steve Edberg  [EMAIL PROTECTED] |
| Database/Programming/SysAdmin(530)754-9127 |
| University of California, Davis http://pgfsun.ucdavis.edu/ |
+-- Gort, Klaatu barada nikto! --+



[PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc

I have a db field, type varchar, that is actually a 'date' string formatted 
as dd-mm-. I used type 'varchar' (rather than type 'date') since I had to 
accomplish other things with it.

Now, however, I do need to extract the Year (the last four digits in the 
array). I've tried to access the array $_SESSION['expiry'] but I don't know 
how to explode this array to extract all characters in last item after the 
last separator : i.e. '-'.  I've used "-" as the separator, but I just 
get the first number of the last part of the array, i.e.: '-Y'.

Is there a way of extracting all characters in that array?

I've tried a bunch of combinations, but I obviously don't understand the 
basic mechanics of array manipulation or 'slicing'. If someone could point me 
to a good resource, or explain what I'm doing wrong, I would greatly any 
assistance.

Tia,
Andre

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

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

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




RE: [PHP] Else/For loop

2002-06-12 Thread David Freeman


 > Being relatively new to php, I discovered the following 
 > after about 2 hours of debugging last night and was wondering why???
 > 
 > I had the following code:
 > 
 > if ( $num_results = 0 )
 > {
 >  echo "no records found";
 > }
 > else
 > {
 >  for ($i=0; $i < $num_results; $i++)
 >  {
 >  display record set
 >  }
 > }

 > The duduction...for loops will not work inside else 
 > statements. The question...why?

Your deduction is wrong, they do.  If this is the code that you're
actually using then I suspect that your problem is more in the
conditional you've got in your 'if' statement.  You aren't doing a
compare you're actually setting $num_results to 0.  A comparison is '=='
rather than just '.

--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au


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




RE: [PHP] how can i insert date

2002-06-12 Thread Lazor, Ed

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

-Original Message-
From: suman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 3:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how can i insert date


hi
i have a date,month and an year what is the function in php that i can i use

to convert the 3 vars into a date and insert into a postgres db.

bye
suman

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

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] Converting week number to unix timestamp

2002-06-12 Thread Lazor, Ed

You're looking for the mktime function.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 6:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Converting week number to unix timestamp


How can I convert the week number(i.e. 1 - 52) to a UNIX Timestamp?
 
Thanks
 
JJ Harrison
[EMAIL PROTECTED]  
www.tececo.com  

 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   



RE: [PHP] including functions, passing objects I created

2002-06-12 Thread Lazor, Ed

I'm not sure I completely understand what you're asking, but taking a
guess...

... assuming you're just wanting to work with the data...

... and assuming you're creating a results set from your db query, start
with this code:

$Results = mysql_query($sql, $DBLink);


Within your function, you can specify a global variable:

function ProcessData()
{
global $Results;



}


- or -

You can copy the results to an array and pass that around, like this:

$data = array;
$Results = mysql_query($sql, $DBLink);
while ($Row = fetch_array($Results))
$data[] = $Row[];

ProcessData($data);




function ProcessData($UserData)
{
... processing ...
}



-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 2:00 PM
To: PHP General List
Subject: [PHP] including functions, passing objects I created


I have a line class that I'm using to draw a line graph of up to 5 lines.
Since I query the db for each of those lines (with a # as lineNum), my code
to take everything out of the fetch_arrays is fairly cumbersome.  I use this
code in 4 different programs (the graph, the printable graph, the data
table, and the accessible [D]).  To avoid code duplication, I'd really like
to be able to pass $sql and the 5 lines to a function in a different file,
that all 4 of my programs can use.
 
I have tried both 
 
function runSQL ($sql, &$line1, &$line2...) {
...
}
 
and 
 
function runSQL ($sql, $line1, $line2...) {
...
return array ($line1, $line2...);
}
 
but both ways timeout.  Is there any way for me to put data into my line
objects from a function?  I know that the include is working because I have
a test function that just prints out "Hello".
 
I've checked the manual, but it doesn't say anything about having a
user-made object as a param or a return.
 
Thanks for any info you may have!
 
-Natalie
 

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] how can i insert date

2002-06-12 Thread suman

hi
i have a date,month and an year what is the function in php that i can i use 
to convert the 3 vars into a date and insert into a postgres db.

bye
suman

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




RE: [PHP] Re: Querying for MAX

2002-06-12 Thread César Aracena

When I try to use this SELECT MAX(column) AS amount FROM table; with
PHP, the result I get is always: "Resource id #2" and not the number I
expect... but if I run this at the mysql command line, it shows the
expected number/value. What is that?

César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621

> -Mensaje original-
> De: Leon Mergen [mailto:[EMAIL PROTECTED]]
> Enviado el: Miércoles, 12 de Junio de 2002 05:13 p.m.
> Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Asunto: [PHP] Re: Querying for MAX
> 
> select max(id) as amount from table
> 
> "César aracena" <[EMAIL PROTECTED]> wrote in message
> 003301c21240$0cdcf790$89c405c8@gateway">news:003301c21240$0cdcf790$89c405c8@gateway...
> I'm sorry if this mensaje is posted twice. I sent it yesterdays, but
> then my ISP had problems with e-mail and I lost dozens of them and
don't
> know if sent OK.
> 
> 
> Hi all,
> 
> What I'm trying to do here is not inside PHP nor MySQL books I have. I
> need to query the DB to look the max result in a column. That is, if I
> have affiliate members with ID going from 1 to 10, get the query to
know
> that the last member added was 10 so I can add member 11 without using
> auto_increment, because I need to insert old members too which already
> have ID numbers. Is that possible?
> 
> Thanks in advance,
> 
> 
> Cesar Aracena 
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Converting week number to unix timestamp

2002-06-12 Thread webmaster



How can I convert the week number(i.e. 1 - 52) to a 
UNIX Timestamp?
 
Thanks
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] POST/GET var problem

2002-06-12 Thread Anzak Wolf

take the following html code





Now when that is created by a php script the value that is passed back is 
the following.

myimg.x="Click loc X"&myimg.y="Click loc y"

I could leave the name attribute off and I get an x/y value set that I can 
use for some math functions I have.  The problem is that I have more than 
one image that could be clicked on and depending on which you click on 
determines what math to do.

$HTTP_POST_VARS['myimg.x'] seems to be an object as I can't do the following
$x=$HTTP_POST_VARS['myimg.x'];

Anyone know how I can get this value into a variable I can use?

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


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




[PHP] RE: [PHP-DB] Re: Querying for MAX

2002-06-12 Thread César Aracena

When I try to use this SELECT MAX(column) AS amount FROM table; with
PHP, the result I get is always: "Resource id #2" and not the number I
expect... but if I run this at the mysql command line, it shows the
expected number/value. What is that?

César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621

> -Mensaje original-
> De: Leon Mergen [mailto:[EMAIL PROTECTED]]
> Enviado el: Miércoles, 12 de Junio de 2002 05:13 p.m.
> Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Asunto: [PHP-DB] Re: Querying for MAX
> 
> select max(id) as amount from table
> 
> "César aracena" <[EMAIL PROTECTED]> wrote in message
> 003301c21240$0cdcf790$89c405c8@gateway">news:003301c21240$0cdcf790$89c405c8@gateway...
> I'm sorry if this mensaje is posted twice. I sent it yesterdays, but
> then my ISP had problems with e-mail and I lost dozens of them and
don't
> know if sent OK.
> 
> 
> Hi all,
> 
> What I'm trying to do here is not inside PHP nor MySQL books I have. I
> need to query the DB to look the max result in a column. That is, if I
> have affiliate members with ID going from 1 to 10, get the query to
know
> that the last member added was 10 so I can add member 11 without using
> auto_increment, because I need to insert old members too which already
> have ID numbers. Is that possible?
> 
> Thanks in advance,
> 
> 
> Cesar Aracena 
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 
> 
> 
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Store/Retrieve Word Documents in MySQL/PHP?

2002-06-12 Thread Håkan Askengren

Super
Thanks a lot.
/Håkan

"Miguel Cruz" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I usually just grep through the one that comes with Apache; it's fairly
> thorough. You might find it in /usr/local/apache/conf/mime.types
>



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




[PHP] RE: Thumbnails from mySQL binary data

2002-06-12 Thread Philip Hallstrom

If I had the choice I would make the thumbnail when it gets uploaded using
the netpbm stuff (netpbm.sourceforge.net).  I've found netpbm makes *much*
nicer and smaller (file size wise) thumbnails than GD.

-philip

On Wed, 12 Jun 2002, Shane wrote:

> I have read warnings that this (imagecreatefromstring.php) is killer
> SLOW simply because it is server side. Have you found this to be true?
>
> Would you suggest just making the thumbnail when the file is uploaded,
> or do you think it is wiser just to make a thumbnail when the user
> requests it, and just make them wait for the server side code to crunch?
>
> Thanks again group!!!
> - NorthBayShane
>
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 12:56 PM
> To: Shane
> Cc: php
> Subject: Re: Thumbnails from mySQL binary data
>
>
> start with this:
>
> http://www.php.net/manual/en/function.imagecreatefromstring.php
>
> On Wed, 12 Jun 2002, Shane wrote:
>
> > Greetings, I just started playing with the GD functions. (FUN!!!) And I am looking 
>for advice or scripts on how to turn binary data from my DB into thumbnails.
> >
> > I understand how to make thumbnails from existing images already "sitting in a 
>directory," but how can I get a scaled image to be made directly from the binary data 
>in my DB.
> >
> > Your guidance or advice would be most helpful and TRULY appreciated.
> >
> > As always, my final functions will be posted for all.
> > Thanks in advance my friends!!!
> >
> > - NorthBayShane
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>


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




Re: [PHP] Email howTo ?

2002-06-12 Thread Scott

Point the php.ini to a smart host that will accept the connections.  We 
do that on our Linux boxes at the office.  All mail passes to a Notes 
server.


On Wed, 12 Jun 2002, Septic Flesh wrote:

> any way to send an email with php without using SENDMAIL ???  in a linux
> (slack8) ?
> 
> thanks in advance..
> 
> --
> 
> 
> Sapilas@/dev/pinkeye
> 
> 
> 
> 
> 
> 

-- 
-
Now Playing:  Sugar Ray - Answer The Phone
  Server Uptime:  187 days

www.scottah.com



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




[PHP] including functions, passing objects I created

2002-06-12 Thread Leotta, Natalie (NCI/IMS)

I have a line class that I'm using to draw a line graph of up to 5 lines.
Since I query the db for each of those lines (with a # as lineNum), my code
to take everything out of the fetch_arrays is fairly cumbersome.  I use this
code in 4 different programs (the graph, the printable graph, the data
table, and the accessible [D]).  To avoid code duplication, I'd really like
to be able to pass $sql and the 5 lines to a function in a different file,
that all 4 of my programs can use.
 
I have tried both 
 
function runSQL ($sql, &$line1, &$line2...) {
...
}
 
and 
 
function runSQL ($sql, $line1, $line2...) {
...
return array ($line1, $line2...);
}
 
but both ways timeout.  Is there any way for me to put data into my line
objects from a function?  I know that the include is working because I have
a test function that just prints out "Hello".
 
I've checked the manual, but it doesn't say anything about having a
user-made object as a param or a return.
 
Thanks for any info you may have!
 
-Natalie
 

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

 



RE: [PHP] while...

2002-06-12 Thread Lazor, Ed

Why not use while to loop through the shopping cart and add items to the
message variable?

$message = "
Here is your order:
";

while ($Row = mysql_fetch_array($Results))
$message .= "item description information";

$message .= "

Thanks for your order...


";


-Original Message-
From: Phil Reid [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 1:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] while...


I have a function in my script which sends an e-mail to my client
company with details of a shopping cart order. I was wondering if it is
possible to use a while loop inside the mail function so that I can send
details of multiple items in one e-mail. 
 
Here is the code I am using. And bear in mind that I am a newbie to PHP,
so if the mistake is obvious you will need to forgive me.
 
$message = "---Client Information---\nUsername:
$result[username]\nE-Mail Address: $result[email]\nContact Method:
$contactoption\nForename: $result[forename]\nSurname:
$result[surname]\nCompany: $result[company]\nHouse Number or Name:
$result[address1]\nAddress Line 2: $result[address2]\nAddress line
3(optional): $result[address3]\nLocality: $result[local]\nCity:
$result[city]\nPostcode: $result[postcode]\nHome Telephone:
$result[homephone]\nWork Phone: $result[workphone]\nMobile Phone:
$result[mobilephone]\nID: $result[id]\n--Order
Details--while ($shoppingrow =
mysql_fetch_array($shoppingresult))\nGrade: $shoppingrow[0]\nLength:
$shoppingrow[1]";
 
$extra = "From: $result[forename]\r\nReply-To:
$result[email]\r\n";
mail ("[EMAIL PROTECTED]", "James Laird Website Order",
$message);
 
If anyone can be of assistance it would be very much appreciated. 
 
Regards,
 
Phil Reid
 
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] GD imagecreatefromstring ADVICE??

2002-06-12 Thread Shane

Anyone have any opinions or real world experience using the function 
"imagecreatefromstring?"

Not much out there on the web? I am looking for the best method for making 
"thumbnails" from my binary DB data.

Thanks again group!!!
- NorthBayShane

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




[PHP] while...

2002-06-12 Thread Phil Reid

I have a function in my script which sends an e-mail to my client
company with details of a shopping cart order. I was wondering if it is
possible to use a while loop inside the mail function so that I can send
details of multiple items in one e-mail. 
 
Here is the code I am using. And bear in mind that I am a newbie to PHP,
so if the mistake is obvious you will need to forgive me.
 
$message = "---Client Information---\nUsername:
$result[username]\nE-Mail Address: $result[email]\nContact Method:
$contactoption\nForename: $result[forename]\nSurname:
$result[surname]\nCompany: $result[company]\nHouse Number or Name:
$result[address1]\nAddress Line 2: $result[address2]\nAddress line
3(optional): $result[address3]\nLocality: $result[local]\nCity:
$result[city]\nPostcode: $result[postcode]\nHome Telephone:
$result[homephone]\nWork Phone: $result[workphone]\nMobile Phone:
$result[mobilephone]\nID: $result[id]\n--Order
Details--while ($shoppingrow =
mysql_fetch_array($shoppingresult))\nGrade: $shoppingrow[0]\nLength:
$shoppingrow[1]";
 
$extra = "From: $result[forename]\r\nReply-To:
$result[email]\r\n";
mail ("[EMAIL PROTECTED]", "James Laird Website Order",
$message);
 
If anyone can be of assistance it would be very much appreciated. 
 
Regards,
 
Phil Reid
 
 



  1   2   3   >