[PHP] PHP-MySQL connection problem

2002-07-29 Thread Manisha

Hi,

My server is running on shared server which has support for PHP 4.1.2. I 
installed mySQL for our shared server. I also installed phpMyAdmin. Both 
are running properly. But I am facing following problems

1) If there is any error in the script - It is not getting displayed - 
screen is becoming blank, so it is becoming very difficult for me to make 
out any mistake.

2) I am trying to send email - but not getting any email. This is the script

?
$mailBody = This is one line \ n This is a second line \n\n this is a 
third line;

$boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody);
print (Email has been send );
?

I am getting print statement but not the mail. Any extra settings are 
required ?

Thanks in advance
Manisha




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




[PHP] libphp4.so

2002-07-29 Thread Peter

howdy,

i've got it all configured correctly .. well it doesn't spit any errors out
on make
but when i got to view a web page it opens a down load box ..so i added this

LoadModule php4_modulelibexec/libphp4.so

to httpd.conf as per the manual and restarted apache but it didn't start
saying it couldn't find libphp.so which leads me to my question .. that file
is created automatically correct?

i havent been able to find that file on my machine any where.. so i can't
point it to another location ... any one got any ideas what i should do as i
have not seen any info any where that will direct me in this situation...


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




Re: [PHP] Logging out with authentication

2002-07-29 Thread Peter Janett

I looked at how phpMyAdmin did it, and came up with this.

1) Put this at the top of your main page:

// this handles the log out
if (isset($PHP_AUTH_USER)  $old_usr == $PHP_AUTH_USER) {
 header('WWW-Authenticate: Basic realm=Your Protected Area Name');
header('HTTP/1.0 401 Unauthorized');
echo 'htmlbodyThis area requires authentication. If you are trying
to
log in and out as the same user,
A HREF=http://your_main_log_in_page;click here/A./body/html';
exit;
} else {

2) End the else at the bottom of your main page ( put in the ending }).

3) Add a link to log out, like this:
A HREF=http://your_main_log_in_page?old_usr=?= $PHP_AUTH_USER?Log
out/A

That seems to work the way phpMyAdmin does, which I think is snazzy!

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

- Original Message -
From: Ray Todd Stevens [EMAIL PROTECTED]
To: Chris Shiflett [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, July 28, 2002 10:16 PM
Subject: Re: [PHP] Logging out with authentication


 I do understand how this works.  Yea the browser caches the
 information and returns it each time. I was tryiung to find a way to
 clear this cache.  (seems to be a failure in current browsers that
 there is no command for this)  Or have a system so that a cookie
 can be created that forces a change.  The problem I have with the
 cookie solution is that cookies only seem to change if the page is
 fully loaded.  I can rejject the login and make them reinter the
 userid.password if a cookie is set.  But I then can't erase the cookie.
 Once it is set the user id and password never will work again until
 the browser exits.

  Ray Todd Stevens wrote:
 
  I am working on a web site that is using php controled www-
  authenticate authentication.  User ids are specific to users and
  different pages and different levels of information for a given page
  will be displayed based on the user id used.  The problem is how do
  you log out without having to quit all browser sessions.
  
 
  HTTP authentication is a protocol-level mechanism that is outside of
  PHP. Though PHP gives you some control over the HTTP response (the
  message from the Web server to the Web client), it cannot grant you
  control of future HTTP requests (messages from the Web client to the
  Web server), which is what you are wanting to do.
 
  You see, there is no such thing as logging out with HTTP
  authentication (because you are never exactly logged in); every HTTP
  request must include the authentication credentials. Because most
  browsers will save this information rather than prompting for it for
  every request, it can appear as if you are logged in until the
  browser session is destroyed, but that's not actually how it works.
 
  So, in case I did not explain that well, whether the Web browser
  returns the HTTP authentication credentials in future requests is
  entirely up to the Web browser and is thus a browser configuration
  issue. However, I'm not aware (someone feel free to correct me) of any
  browsers that allow you to turn off this caching behavior with regards
  to HTTP authentication anyway, so you will have no option other than
  to end the browser session.
 
  That's not the answer you are wanting, but might I suggest you look
  into writing your own access restriction logic in PHP rather than
  using HTTP authentication. This is what most developers choose, and it
  will give you far more flexibility and security.
 
  Happy hacking.
 
  Chris
 
 


 
 --
 Ray Todd Stevens Specialists in Network and Security
 Consulting
 Senior ConsultantSoftware audit service available
 Stevens Services
 Suite 21
 3754 Old State Rd 37 N
 Bedford, IN 47421
 (812) 279-9394
 [EMAIL PROTECTED]

 Thought for the day:
 Concerto (n): a fight between a piano and a pianist.


 For PGP public key send message with subject
 please send PGP key

 If this message refers to an attachment the attachment
 may arrive as a seperate mail message depending on the
 type of mail client and gateway software you are using.


 --
 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: Logging out with authentication

2002-07-29 Thread JJ Harrison

You could redirect to a file outside the 'realm' by using header(location:
) or just linking to it.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com


Ray Todd Stevens [EMAIL PROTECTED] wrote in message
3D44690D.25129.D620734@localhost">news:3D44690D.25129.D620734@localhost...
 I am working on a web site that is using php controled www-
 authenticate authentication.  User ids are specific to users and
 different pages and different levels of information for a given page
 will be displayed based on the user id used.  The problem is how do
 you log out without having to quit all browser sessions.  Anyone
 doing this?  Care to share code that makes it work?
 
 --
 Ray Todd Stevens Specialists in Network and Security
 Consulting
 Senior ConsultantSoftware audit service available
 Stevens Services
 Suite 21
 3754 Old State Rd 37 N
 Bedford, IN 47421
 (812) 279-9394
 [EMAIL PROTECTED]

 Thought for the day:
 Concerto (n): a fight between a piano and a pianist.


 For PGP public key send message with subject
 please send PGP key

 If this message refers to an attachment the attachment
 may arrive as a seperate mail message depending on the
 type of mail client and gateway software you are using.




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




[PHP] Re: PHP + Form + Session Problem. Please help

2002-07-29 Thread JJ Harrison

I could take a guess. I would imagine that you are not closing all of your
browser windows. This means that the session cookie was being kept.

First I recommend using session_destroy(); at the end of your session work.

Also writting your script as if register globals was off would probably fix
it. e.g. use $_SESSION['qty'] instead of $qty for session data. Using
scripts ensures greater compatibilty and (hopefully) better security.

For more info on Register Globals you should check out these pages:
http://www.php.net/manual/en/security.registerglobals.php

http://www.php.net/manual/en/language.variables.predefined.php

I also suggest buying a book for PHP(if you don't have one) I would
recommend PHP and MySQL Web Development by Luke Welling and Laura Thopson.

It includes a working example of what you are probably trying to do.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com


Wee Keat [EMAIL PROTECTED] wrote in message
008601c236bc$a656e7a0$6300a8c0@wickid">news:008601c236bc$a656e7a0$6300a8c0@wickid...


Hi all,

I have been working on an online shopping thingy for quite a while and I
have encounter a strange problem which could not be solved. Deeply needed
your help.

Problem:

Its very hard to explain this. So, if you do not quite understand it, please
tell me, I will send some screenshots to you personally... I tried send it
here but it was rejected.

Okay.. here goes... I have a product list, where customers can select which
products to buy and enter the quantity they want...

Upon clicking on Order button, the customer is brought to his shopping
cartwhere there is the product, with price in Per Unit, Qty, and Total
Price . In this area, value for Qty column is obtained from the $qty that
is passed on from the previous page, where it is also a registered in
session_register(qty). (The same goes to the Product, where prod_id is
obtained from $prod_id, also a session registered variable.)

It worked out fine so far... it could get the product, unit price, qty and
the total price.

But then, when I continued shopping second time, doing the same thing, first
select the product, then enter the quantity and then dump it in the shopping
cart, something starts going wrong... the Qty column do not show any value
at all..

However, products are still working... which means that the $prod_id session
is recorded. How come?


Here is the snippet of the script:
(took out the HTML font tags to make it more readable)

The code I used to create the table in the product list

-

?php
session_start();
session_register(qty);
?


 all other normal thingy..


while($query_data = mysql_fetch_array($result)) {

$price = $query_data[price_lq] * $rrp * $gst;
$RowColor = useColor();

echo TR BGCOLOR=\$RowColor\;
echo TD.$query_data[prod_brand]./TD;
echo TD.$query_data[prod_code]./TD;
echo TD.$query_data[prod_desc]./TD;
echo TD$,number_format($price, 2, '.', ''),/TD;
echo TDinput name=\qty[.$query_data[prod_id].]\ type=\text\
size=\1\/TD\n;
echo TDinput type=\checkbox\ name=\choice[,
$query_data[prod_id], ]\ value=\, $query_data[prod_id],\/TD\n;

  }

all other html stuffs.


---



This is the code I used for the shopping cart

---


?php
session_start();
session_register(qty);
?


 all other normal thingy..


while (list($key,$prod_id) = each($cart)) {
   $result = mysql_query(SELECT * FROM products WHERE prod_id = '$prod_id'
ORDER BY prod_brand ASC, $link_id);
   $query_data = mysql_fetch_array($result);
   $RowColor = useColor();
   $index = $query_data[prod_id];
   $quantity = $qty[$index];
   $price_perunit = $query_data[price_lq] * $rrp * $gst;
   $total_price = $query_data[price_lq] * $rrp * $gst * $quantity;
   $grandtotal = $grandtotal + $total_price;

   echo TR BGCOLOR=\$RowColor\;
   echo TD.$query_data[prod_brand]./TD;
   echo TD.$query_data[prod_desc]./TD;
   echo TD$.number_format($price_perunit, 2, '.', '')./TD;
   echo TD.$quantity./TD;
   echo TD$.number_format($total_price, 2, '.',
'')./strongBR/FONTnbsp;nbsp;/TD\n;
   echo \tTDa href=\delete.php?delete=.$query_data[prod_id].\
Onclick=\return confirm('Are you sure?');\;
   echo [Delete]/a/TD/TR;

  }

other html stuffs.


--




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




RE: [PHP] Oracle 8i SQL Problem..

2002-07-29 Thread Rudolf Visagie

Oracle 9i would be happy with the left join syntax but not 8i.

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 6:09 AM
To: 'Nick Oostveen'; Frank S. Kicenko; [EMAIL PROTECTED]
Subject: RE: [PHP] Oracle 8i SQL Problem..


You'll prob. need to use the (+) to join
like this

SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2,
usergrp.userid, users.userdescrip
FROM grp, usergrp, users
WHERE grp.grp = usergrp.grp (+)
AND usergrp.userid=users.userid (+)
ORDER BY grp.grp

-Original Message-
From: Nick Oostveen [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 1:47 PM
To: Frank S. Kicenko; [EMAIL PROTECTED]
Subject: Re: [PHP] Oracle 8i SQL Problem..


I could be wrong on this but I believe that Oracle 8i uses a proprietary 
join syntax.  This support has been added in the latest version of Oracle, 
but with 8i I believe you're out of luck using the left join keywords.

Check out 
http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for 
more info on this.

At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote:
Hi,
This really isn't a PHP issue..sorry.

I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL
which works for MSSQL 2K and seems correct for Oracle... but keeps
giving me a Error.. ORA-00933 SQL command not properly ended on the
following query...

SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2,
usergrp.userid, users.userdescrip
 FROM grp
 LEFT JOIN usergrp
 ON grp.grp=usergrp.grp
 LEFT JOIN users
 ON usergrp.userid=users.userid
 ORDER BY grp.grp

The error keeps pointing at the first LEFT JOIN. Anybody know why?

--
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] Re: Reg-Vulnerabilities in PHP

2002-07-29 Thread JJ Harrison

I don't know. php_info();?

But why use PHP 4.0.6 ?

We are up to PHP 4.2.2 now(Which was just realeased due to a security bug).

--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Senthilvelavan [EMAIL PROTECTED] wrote in message
009101c236bc$61c8b410$300110ac@snpsi">news:009101c236bc$61c8b410$300110ac@snpsi...
Hello Folks,
 I have applied patch to PHP4.0.6.Any one of you please
suggest on how to test the patched version and confirm that the
vulnerability is fixed.
[Note :Patch is applied for the following Vulnerability.
Vulnerabilities in the  php_mime_split function may allow an intruder to
execute arbitrary code with
the privileges of the web server.]
Any help is appreciated.
Advance thanks and regards,
Senthil.





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




[PHP] Reg patch for PHP4.0.6

2002-07-29 Thread SenthilVelavan

Hello Folks,
I have applied a patch from 
http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz
for PHP 4.0.6. Is my patched PHP4.0.6 is compatible to PHP4.2.2. If not please list 
the features or bugs that are not fixed with my patch applied version.

Which one is advicable?
1.Either the PHP4.0.6 with patch from 
http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz
OR
2.To directly go for PHP4.2.2

Any help is appreciated.

Advance thanks and regards,
Senthil.



[PHP] Picking up Data of Previous Date from Table

2002-07-29 Thread Thomas Edison Jr.

Glory!

I have one Table (Transactions), having a Date Column,
with date stored as -MM-DD

I have another Table (Holdings), having a Date Column,
with date stored as -MM-DD

Now i'm joining the two tables, to get data from both
the tables and display on the page. The query i'm
using is something like this :

SELECT * FROM transactions,holdings where
transactions.isinno=holdings.isinno AND
transactions.clientid='$clientid' AND
holdings.clbal!=0 GROUP BY holdings.isinno ORDER BY
shares

This statement works fine, and for any given date,
extracts Data from both the tables and displays in a
particular row format.

I have to also to do some Calculations as i have
Debit, Credit  Opening Balance of a day, and have to
generate the Closing Balance.

Now for this purpose i'm facing a simple problem. The
Data being picked up is of the same date from both the
Tables. However, what is required is that the Data
from the Holdings table needs to be picked up from a
Date a day earlier then the Transactions Table Data.

For eg:- If i'm displaying Transactions Table Data of
2002-06-22, then the Holdings Data should be picked up
of date 2002-06-21 !! 

The thing is that i have Debit  Credit in
Transactions Table, and the Closing Balance in
Holdings Table. The Closing Balance of 21st is the
Opening Balance of 22nd. So when i display the
Transactions Table for 22nd, Debit  Credit of 22nd is
Subtracted  Added to the Opening Balance of 21st to
get the Closing Balance. So this is what i have to do.
I need to pick up the Opening Balance from the
Holdings Table of a Date Previous to the Transactions
that i'm displaying. 

How can i do this?

Thanks,
T. Edison Jr.



__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP] Re: Reg patch for PHP4.0.6

2002-07-29 Thread Manuel Lemos

Hello,

On 07/29/2002 04:44 AM, Senthilvelavan wrote:
 Hello Folks,
 I have applied a patch from 
http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz
 for PHP 4.0.6. Is my patched PHP4.0.6 is compatible to PHP4.2.2. If not please list 
the features or bugs that are not fixed with my patch applied version.
 
 Which one is advicable?
 1.Either the PHP4.0.6 with patch from 
http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz
 OR
 2.To directly go for PHP4.2.2

If you do not need any features of the newer version, just stick to 
4.0.6 with that patch applied.


-- 

Regards,
Manuel Lemos


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




RE: [PHP] PHP-MySQL connection problem

2002-07-29 Thread John Holmes

 My server is running on shared server which has support for PHP 4.1.2.
I
 installed mySQL for our shared server. I also installed phpMyAdmin.
Both
 are running properly. But I am facing following problems
 
 1) If there is any error in the script - It is not getting displayed -
 screen is becoming blank, so it is becoming very difficult for me to
make
 out any mistake.

Check PHP.ini and make sure display_errors is ON.

 2) I am trying to send email - but not getting any email. This is the
 script
 ?
 $mailBody = This is one line \ n This is a second line \n\n this is a
 third line;
 
 $boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody);
 print (Email has been send );
 ?
 
 I am getting print statement but not the mail. Any extra settings are
 required ?

Just the settings in PHP.ini in the mail section. Ensure you are even
using a PHP.ini to begin with, too. If there isn't one, PHP will use its
own defaults. 

Load up a page that has just ? Phpinfo(); ? in it and in the first
block shown, it'll tell you where PHP thinks it's PHP.ini file is. Edit
that file if it's there. If it's not, then look for a PHP-ini.dist or
PHP-ini.recommended in the files you downloaded and rename it to PHP.ini
and copy it to that location. 

---John Holmes...


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




[PHP] Re: pdflib, NEED HELP with function problem (newby)

2002-07-29 Thread Richard Lynch

PDF_set_text_pos($p, 80, 670);
PDF_show($p, Requirements:);

works just fine outside of a function but if I put the same thing inside a
function like so

function help()
 {
  PDF_set_text_pos($p, 80, 670);
  PDF_show($p, Test:);
 }

I get this error:

Warning: pdf_set_text_pos(): supplied argument is not a valid pdf object
resource in /var/www/html/form/test.php on line 16

$p is not in scope inside the function.

One of the purposes of a function is to isolate all your variables so that
you can't possibly screw up somebody else's variables with your function and
vice versa.

So $p is empty inside of help()

You can either:

Pass in $p as an argument (best) or declare it global:

function help($p){
...
}

function help(){
  global $p;
...
}


-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: slow reading from socket

2002-07-29 Thread Richard Lynch

Hi

I am building (or attemting to build) an msn messenger class. I am having 
problems reading from the socket.

I open a connection with fsockopen(), i then write commands to the socket 
with fputs(). I am reading wth fgets().

It is all fine if I am reading one line returned by the server, the script 
runs quickly. However is i wish to read multiple lines the script basically 
stops. I am working with code like this to read multiple lines...

Maybe I'm just being goofy, but how do you expect PHP to know that it should
stop?...

I mean, it's a socket, and it's probably still open and waiting to
send/receive info, so when do you think PHP's fgets() should stop?...

I think there are probably specific tokens/lines/keywords in the MSN
protocol that you're going to have to use to know when read() has finished
getting a whole chunk of information...

What that token *IS*, I dunno.  Only MS knows, I guess...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: what is the .Xauthority file

2002-07-29 Thread Richard Lynch

I just connected to my web server and found that there was a new file named
.Xauthority, which I didn't created.  Does anyone know what this file is?
Can I delete it?

If you tried to run X (X-Windows) at some point, that file would be created,
I think...

man X

might, eventually, if you dig, explain what it actually is.

You can probably look inside it, it's probably just text (or a directory
full of text files).  Most .X stuff that ends up cluttering (blech) up your
home directory is just text.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Possible to have optional values in function?

2002-07-29 Thread Richard Lynch

is it possible to have optional values in a PHP function?

some of the built in ones have optional parameters.

Yes.

And it's documented in the manual:
http://php.net/functions

And it's just like C anyway, mostly, so you could have tried it and had an
answer faster than asking thousands of people.

You also can have an unlimited number of arguments and there are functions
for meta information about the number of arguments.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: phpinfo()

2002-07-29 Thread Richard Lynch

hi all!!
below is the display of one of my configuration of php on the first server..

my question is that possible for me to hide out all the environment
variables such as user, hossttype.. editor... term etc and how?

Try this:
?php
  unset($_ENV);
  phpinfo();
?

Also, there *might* be arguments to phpinfo() that would display only
specific sections or something...

http://php.net/phpinfo

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Ming Sprite confusion

2002-07-29 Thread Richard Lynch

Please cc me on answers, as I'm way behind in this list...

I have a perfectly good Ming (Flash) movie coming out of PHP, but it's a bit
large...

I'd like to put this thing on a diet.

I figured I could do it with a Sprite for the tiny portion that's animated,
but I'm not getting quite what I expect for output...

Here's the way it should look:
http://tourbaby.com/scheduleswf.htm
350K

Here's the Sprite version:
http://tourbaby.com/scheduleswf.htm?useSprite=1
80K

Here's the source:
http://tourbaby.com/scheduleswf.phps

It seems to be skipping all the nextframe calls I make on the Sprite in
the animation loop...  What's up with that?

Am I just being bone-headed about something?  (Probably, but what?)

The background map JPEG is only like 24K, but still I don't need to repeat
that whole thing every frame...

PS Any way to get the text back to blank so I don't create/destroy 50 text
objects?
PPS Any way to diagnose a bloated Ming movie and determine where all the
space is going?
PPPS Anything else I could do to put this thing on a diet?
S Any pointers to OpenSource text-to-speech applications would be quite
useful as well.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PHP 4.2.2 and Apache LoadModule issue

2002-07-29 Thread Richard Lynch

Hi All.

I am having a weird problem... my PHP is outputting a libphp4.a and
libphp4.la modules and I can't get Apache to recognize this type of
file. Is there a way to tell PHP to generate a .so module? Or how can
I get Apache to use the .a and .la modules?

I *think* PHP outputs .so *ONLY* if you use --with-apxs, not
--with-apache...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: my application is not able to communicate with qmail sever !

2002-07-29 Thread Richard Lynch

I am running my PHP application running on apache webserver.I am using
Qmail(installed on Linux operating system) as an SMTP server..The problem
is..I am not able to send any mails from my application using Qmail.Whereas
I am able to send mails from my application using SendMail..My PHP
application is running on windows 2000 and the qmail is running on
Linux.

You mean PHP is installed on Win2K, and qmail lives on the Linux box, right?
 OPTION 1.

Or are you just telling us your browser is on Windows, which doesn't really
matter to the sending of mail?... OPTION 2.


The following is the technical information I am using in my application.

A) The mail configuration settings (in php.ini) are.

1)SMTP = 192.168.10.24
2)sendmail_from = [EMAIL PROTECTED]
3)sendmail_path = /var/qmail/bin/sendmail

I tried with the following two options too..that didn't work out..

sendmail_path = /var/qmail/bin/sendmail
sendmail_path = /usr/sbin/sendmail

OPTION 1.
The path is irrelevant if your sendmail and PHP aren't on the same box,
almost for sure...

I don't see *how* PHP could possibly be expected/allowed to run an arbitrary
program on some other computer than the one that it's living on...


OPTION 2.
Assuming qmail's sendmail wrapper works just like sendmail, you probably
need:
sendmail_path = /usr/qmail/bin/sendmail -t

You may also want to check out other flags like -i

B) And I am using php's inbuilt mail()  function in my application as
follows..

mail([EMAIL PROTECTED],test,test);

Then when I tried from application I got the following message from Qmail
server..

See http://pobox.com/~djb/docs/smtplf.html.;

When I have gone to the above link it is saying the following things the
qmail expects :

1)  Every line in an Internet mail message is required to end with CR LF.
The entire message ends with CR LF dot CR LF.  822bis specifically prohibits
other uses of LF.

Yes, use \r\n, not just \n if you want to be kosher.

Though Un*x boxes usually fix it for you anyway.

2)The mail clients discussed above are incorrectly ending lines with LF and,
in most cases, ending the entire message with LF dot LF. That's not CR LF
dot CR LF, so a server such as msn.com will sit there waiting for the rest
of the message. After a while it'll give up and drop the connection. Your
mail doesn't get through.

Same as 1.

Some mail servers convert a bare LF into CR LF, and accept LF dot LF as the
end of a mail message.

Same as 1.

I wonder whether the php mail() function handles the mail ...The format
qmail is expecting.

OPTION 1.
Yes.  But qmail isn't involved in this picture at all.

OPTION 2.
It's almost for sure not that PHP isn't using \r\n
Whatever is going wrong, it ain't that.

I just want to know why the mails are not going through qmail from my
application where as my application is able to send mail using sendmail
with the above settings..

OPTION 1.
I don't see how the qmail/sendmail matters if you are using SMTP to send the
mail.

OPTION 2.
The defaults for -t may be different for qmail/sendmail...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Using cookies with PHP

2002-07-29 Thread Richard Lynch

Does anyone have examples on how to use cookies with PHP?

Yes.

The manual has examples.  Lots.

And there are a ton of them on every PHP code archive I've ever seen.

I'm just getting 
into this and would like to know the difference between
stored cookies and non-stored per session cookies.

Stored cookies have a time limit

Session cookies have no time limit, so they just die when the browsers
closes.

Does PHP support both?

Yes.  You'd have to work at it pretty hard and be pretty stupid about it to
write a language that only supported one or the other...

Not even Microsoft could manage that one, mostly, I think.

Though you *DO* have to provide *BOTH* time out *and* path for some versions
of IE, if you want a cookie to last.  Just the time won't work.  Stupid IE.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: including just created file

2002-07-29 Thread Richard Lynch

$cache_file_name = cache/$id/$tid. ($showall ? '_all.php' : '.php');
$cache_dir_name= cache/$id;
   
if(!file_exists($cache_file_name) || filectime($cache_file_name) +
30  time() ) {

If you may have loaded/altered the file system between calls to this
directory/file, you need to use:
http://php.net/clearstatcache

if(!is_dir($cache_dir_name)) {
mkdir($cache_dir_name, 0777);
}



$lock=@fopen($cache_file_name . '.lock','w');
if(flock($lock,LOCK_EX)) {
include('modules/rally_live/create_cache.php');
flock($lock,LOCK_UN);
}
fclose($lock);

What happens if I don't get the lock?...  You just skip all this code...
I think you need some kind of while() loop to just keep trying until you
*DO* get a lock...

Otherwise, you will sometimes blow right by here, read the file that the
other script got a lock for, but hasn't created yet, and BAM!, there's your
sometimes empty files that have the code in them when you go looking,
because you have a race condition.

}
clearstatcache();

H.  Might be okay for this to be only here, but I'd copy it above as
well.  *EVERYWHERE* you might need *current* file info.

for($i=0;!file_exists($cache_file_name);$i++) {
if($i==3) die('bCannot read cache file!/b');
clearstatcache();
}
include($cache_file_name);  // *sometimes includes empty file*
echo !-- File $cache_file_name included --;

The 'create_cache.php'  creates a php code, that later needs to be 
executed. The problem is, the just created cache file seems to be empty 
*sometimes* when included, however, if I look at it, it does contain 
code. I do call fflush($cache_file) before closing it, so I don't see 
why the file is empty.
If anyone can help me, I would be really glad.

I think it's just your locking mechanism isn't safe, as described above. 
You can probably get rid of the for loop now.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Changing a variable's value when a link is clicked

2002-07-29 Thread Richard Lynch

Is there a way to change the value of a global variable when someon clicks a
a href URL link on a web page?

Not really...

Or, more properly, Yes, but it wouldn't be the same global from PHP script
you're thinking of

Let's look at HTTP in slow-motion:

1. Browser requests URL.
2. Server gets URL request.
3. Server identifies request as PHP and starts PHP
4. PHP computes HTML and spews it out via Server and quits
5. Browser gets HTML
6. Browser displays HTML
7. User moves mouse
8. User clicks

As you can see PHP is not even in the picture after step 4.

You *COULD* have the click open up a whole 'nother HTTP connection, change a
value in a database somewhere, and then return a whole new HTML page...

Step back and tell us what you are trying to do.

I suspect PHP is the wrong weapon entirely, or that you're trying to do
something that is not really in the realm of known safe technology

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: How reliable is pcntl support?

2002-07-29 Thread Richard Lynch

I've recently had a need to write a standalone script that needs to fork off
a number of children during its operation, and I'd like to use PHP since
I've already written most of the functions in a web application I did in
PHP.  But, I'm now not so sure if that's feasible.

It can certainly be done, any number of ways...

According to the docco, process control is supplied by the pcntl module
which isn't compiled into PHP by default (and doesn't appear to be compiled
into the 4.1.2 Red Hat RPMs that are on the machine).  The documentation
also describes it as experimental, although that could just be old
documentation...

The docos are almost for sure correct.

PHP's idea of experimental is roughly equivalent to Microsoft version 2.2
products, if that helps :-)

The program would be a production system... before I proceed trying to
recompile support in, could I get some feedback on just how reliable it is?
Should I be trying to do this in another language instead?

If pcntl turns out to be unstable, or you just don't want to risk it, you
could:

1. Use  in exec() which sometimes works depending on if the command you
exec() binds stdout/stderr or not, which Apache/PHP are already using for
the browser, so if it does, your  doesn't work.
[At least, that's my working hypothesis...]

2. Have a shell stub that does the fork() for you, but do all the grungy
work in PHP, which makes life easy.

3. Have the shell fork() off as many children you need to start with, or...

Well many more variations on #2 are possible really.

While you may lose a little bit of performance in the fork itself, that's
probably not going to be a bottle-neck overall, unless you're just
process-crazy or something...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PostgreSQL

2002-07-29 Thread Richard Lynch

How can i enable PostgreSQL module?
I have installed PHP 4 on IIS5, Windows 2000

I don't *think* PostgreSQL runs under Windows, really...

You can maybe install the CygWin stuff (a Linux emulator under Windows) and
get that to work, but:

1. Don't expect good performance.  CygWin ain't a Ferrari.
2. Don't even count on it not crashing...  I don't think CygWin is really
all that stable, LAST I HEARD.

It's been at least a year, maybe two, since I even looked into this, so I
could be way out of date.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PHP Integration...

2002-07-29 Thread Richard Lynch

1) Integration with Outlook (yes the application will only ever be run on
windows).

Define Integration... :-)

Does it need to read the user's Outlook mailbox files or something?

Or does it just need to send/receive email?

Or what?

I'll give as many answers as I can, but this is not really a well-defined
question:

PHP can send mail just fine using SMTP servers, Pegasus command-line email,
or any other email program that will run from MS-DOS and send email out.

You can use almost any program that accepts email, and configure it to
EXECute PHP when it gets email matching whatever criteria that program knows
how to match.  I have no idea how you'd get MS Exchange (blech) to fire up
an auto-responder, but once you know how to do that, doing:
C:/path/to/php.exe -q C:/path/to/autoresponser.php
should not be the hard part.

2) Integration with Credit Checking agencies (UK).

This is usually just a question of using cURL to contact their server and
spewing the right stuff at it to make it answer you nicely...

Some of those agencies will probably have a pre-packaged PHP script for you,
so shop around for one that does, if you can.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: filling an array(2)

2002-07-29 Thread Richard Lynch

h.  Ok.  Can somebody explain this one?  Why won't it work correctly?

for($m=1;$m=5;$m++){
 $div_idd[$m]=${'row-sub' . $m . 'd'};
}

Can it not be done with a 3 parter?  The columns in the table that $row 
gets, are sub1d, sub2d, sub3d, sub4d and sub5d.  Or is it the - that is 
messing it up?  I have tried escaping them row\-\sub, but that didn't work.
What would I search for on the PHP site or where are directions located 
that tells me how to use this type of putting a variable together.  It 
makes it hard to search for it if I don't know what it is called.

You want to search for variable variables

At a guess, you need:

$div_idd[$m] = $row-{'sub' . $m . 'd'};

For sure, you need to get the subXd part together before you get the - or
the $row involved.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PHP UPGRADE on LINUX

2002-07-29 Thread Richard Lynch

  We have to upgrade our PHP to the latest stable version on Redhat Linux 
7.3.  We have lots of user using our PHP so what are all the precautions 
and steps involved while doing this operations without disturbing their 
existing program.

At a minimum, we gotta know what version you are *ON*...

For starters, you should *WARN* your clients of the impending upgrade.

Then *THEY* can prepare any known issues like register_globals etc.

Make 100% sure that you also keep all the extensions to PHP you already
have.  Maybe add a couple more.  Maybe upgrade the old ones while you are at
it.

You *ARE* going to install on a DEVELOPMENT box with no customers and test
first, right?

Do a backup of the PRODUCTION box before installing, of course.

Upgrade very early Monday morning so that corporate customers:
A) Don't lose a lot of stuff if you need to back off to your backup
B) Are coming in to work anyway, so any problems you've created are solvable
at their work-hours, not 4 am on a Sunday.

Most sites can be down for a few hours and just blame it on network errors
or something...  Though if there are mission-critical sites on that
server... Well, you ought to have roll-over fail-safes in the first place,
right?  Upgrade one at a time, and be ready to roll-over fast.

Put yourself in your customer's shoes and ask yourself all the worst What
if...?s

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Red Hat 7.2 enabling MySQL on preinstalled PHP

2002-07-29 Thread Richard Lynch

I installed PHP when I installed Red Hat 7.2 without MySQL.  I have now
added MySQL but I can't figure out how to enable it in PHP. Can anyone help?

There are three possibilities:
1. PHP already has MySQL support, and you're done.
2. You need to install a different PHP RPM or tarball to get MySQL.
3. You *have* MySQL support, but for a different version of MySQL than you
installed.

?php phpinfo();?

Will tell you if you have MySQL support.  Either you see MySQL (do a
Find...) somewhere on that web page, or you ain't got MySQL.

It will also tell you what *VERSION* of MySQL support you have.

You probably know what version of MySQL you just installed.

If those versions don't match up, do something to make them match -- Install
older MySQL or newer PHP or whatever.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: calling user-defined php functions from a href tag

2002-07-29 Thread Richard Lynch

There MUST be some creative way to call a user-defined PHP function from
an a href tag.

No, there mustn't :-)

Does anyone have any suggestions?

For example:

==
html
a href=?php joe(); ? Click here to start function joe(). /a

?php
function joe() {
  $temp1=10;
  $temp2=20;
  $result=$temp1+$temp2;
  echo The result of this function is:  . $result;
}
?

/html
==

So, if the user clicks on the link, he'll see:  The result of this
function is: 20

Any ideas? Any help would be VERY much appreciated. Thanks!

See my post minutes ago about user clicking.  If you can't find it, search
for my name and slow-motion

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: portal / content management

2002-07-29 Thread Richard Lynch

Hi

Can anyone recommend a good portal system / content management system
(polls, forums, etc.)  I have tried phpnuke but am bound to the standard
layout of it i.e content in the centre and blocks on the left or right.

phpnuke has all kinds of skins and templates and whatnot with different
layouts...

There are other choices, however...  Is eGrail still around?

Try http://php.net/links.php -- I'll bet there are links there to PHP CMS
systems.  Or just Google for PHP and CMS

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: File Browser like Win Explorer in php

2002-07-29 Thread Richard Lynch

I am wondering if anyone has created or know where I can get a code for
browsing files and directory in using php in linux. The one I am looking
for is file browsing capability that is similar to Window Explorer,
meaning you can expand and collapse directory.
I just don't want to re-invent the wheel. If anyone knows about this,
please let me know. I appreciate the help. 

Are you browsing the files across an HTTP connection?

Cuz all the little triangles and stuff are gonna get dog-slow for most
users...

Every single click will probably require another HTTP request...

At any rate, search the code archives listed at:
http://php.net/links.php

If you are using PHP to do this locally, it seems kinda silly to do, but
maybe a PHP-GTK solution is out there for it.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Pulling a data from array of checkboxes

2002-07-29 Thread Richard Lynch

I am passing a value of checkboxes in a form to a new page like this (see 
example here: http://www.gibsonusa.com/test/check/)
In a new page how can I pull the data from a MySQL database according to 
each value I passed from a previous page? In other words: Assume that the 
value of a checkbox equal to the ID of the record in a database. The value 
of checkbox 1 (for example) is 12345 and the value of checkbox2 is 67890. 
After passing those values to a new page how can I pull the rest of the 
information from a database for those values?

?php
  if (isset($chk)  is_array($chk)){
$ids = implode(', ', $chk);
$query = select whatever from sometable where id in ($ids);
mysql_query($query, $connection) or error_log(mysql_error());
...
  }
?

By the way:

1. If you're Gibson the guitar maker, send me one :-)
2. There's no friggin' way I'm downloading a new version of IE just to view
your site.  Get real :-)
3. And on my *other* computer, IE isn't even an option.  And your error page
doesn't actually display any info about my browser.

You *really* need to support more than just the most recent version of IE if
you expect to get traffic... :-)


-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Sending a File to User's Browser

2002-07-29 Thread Richard Lynch

Hello,

I need a user to save an image file to their disk. Normally when someone 
clicks on an link to a .jpg file, the fil will display on the same browser 
window, since it is capable of displaying such files. Now, I don't want 
this to happen, I need to be able to show the user the Save As.. dialog 
when they click the link. I know it can be done bc I've seen it in 
phpMyAdmin, when you want to save the database dump. If you dont click 
Save as file it just displays the text in your browser.

A HREF=download.php/whatever.jpg?filename=whatever.jpgDownload
Whatever.jpg/A

- download.php -
?php
  header(Content-type: application/octet-stream);
  header(Content-length:  . filesize(/path/to/$filename));
  readfile(/path/to/$filename);
?


NOTES:
Some stupid browsers will *INSIST* on using the URL to guess what kind of
file it is, and what default name to prompt with, no matter *what* headers
you send.  That's why the funky extra whatever.jpg is between the / and the
? in the link.

There are more headers like Content-disposition to convince even more
browsers to do the right file name in the prompt.


-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Extra spacing with br in HTML

2002-07-29 Thread Richard Lynch

 I am using a textarea to pass information to PHP.  I want to be able to
include HTML tags inside the text area.  I am using ln2br() to properly
convert line breaks to HTML.  This is where my issue comes up.

Lets say I have

ul
  liBlar/li
/ul

ln2br() will crunch that and put out:
ulbr /
  liBlar/libr /
/ulbr /

That creates a lot of white space when that HTML is rendered.  How do I
tell PHP not to put line breaks in a situation like that?

You can't really have the user putting in HTML and then you adding in
nl2br() as well...

If you're gonna let them type in HTML, just have them put in any line-breaks
and P tags they need.

If they don't understand the BR or P tag, they won't be able to do any
others either.  :-)

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: php 'mail()' security

2002-07-29 Thread Richard Lynch

How can I make my form which entered by a user, then sent to a company
employee, secure, not vulnerable attack?

What kind of attack?...

Rule #1.
NEVER trust data coming in from the user.

Things to maybe check:
The email should be within a certain reasonable length.

Their subject should not contain newlines.

Their email should only contain ASCII characters?  Or rip out any non-ASCII.
 Of course, that will screw international users...  Kinda depends on your
needs, and projected client base.

The email itself is, of course, inherently INSECURE in its transmission, and
subject to forgery, spoofing, interception, or replacement, unless you PGP
sign and encrypt it.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PHP/MySQL Search Engine Query Question

2002-07-29 Thread Richard Lynch

I am currently working on a website that is implemented using PHP and MySQL.

The site currently has a simple search engine that allows a shopper to type
in a search string that is stored in $search. For example, if a shopper
types in 1972 Ford Mustang
$string =1972 Ford Mustang

Using the following SQL statement:
SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search%

Records are returned that have this exact string and in this exact order
(I'm aware a wild card character is included on the front and back of the
string).

My desire is to be able to logically AND each token of the search together
independent or the order of the tokens.
I want to return all records that have Mustang AND 1972 AND Ford.

Since a shopper inputs the search string in advance I don't know how many
tokens will be used.

How about using OR and a ranked sorting so that the more words that match,
the better?

?php
  if (!isset($start)){
$start = 0; # Or is it 1?  MySQL/PostgreSQL do it differently.  G.
  }
  $words = explode(' ', $search);
  $query = select whatever, 0 ;
  while (list(,$word) = each($words)){
if (trim($word)){
  $query .=  + whatevercolumn LIKE '%$word%' ;
}
  }
  $query .=  as score ;
  $query .=  from sometable ;
  $query .=  where score  0 ;
  $query .=  order by score desc ;
  $query .=  limit $start, $limit ;
?

Since LIKE returns TRUE/FALSE, when you add them up they turn into 1/0,
and you get a one-point score for each matching word.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: file_name

2002-07-29 Thread Richard Lynch

I 'm trying to work with file upload, I already  read several sites who
refer that php will set the variable file_name automaticly,.

I made 2 tries one on line 6 and other on line 7  of the atached code, but
both does not work.

Why I receive the folowing errors, and how can I correct

Notice: Undefined index: file_name in
d:\inetpub\wwwroot\impac\php\upfile.php on line 6

Successfully uploaded
Notice: Undefined variable: file_name in
d:\inetpub\wwwroot\impac\php\upfile.php on line 7

From the Manual:

$_FILES['userfile']['name']

Not $_FILES['userfile_name']

http://www.php.net/manual/en/features.file-upload.php


-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: cant send data from a website to another

2002-07-29 Thread Richard Lynch


Hi newsgroup friends,
my name is mike and im qite new to php.
i have one problem: i cant send date via a form action=example.php
method=post.
so in the the php file called example, i write echo $nameofthefield, but the
data isnt send, so nothing is written in the browser!
what can i do?

Read about the recent change to register_globals in any of 40,000 emails or
on the http://php.net site.

Or just use $_POST['nameofthefield']

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Help reg. create user and allocate space

2002-07-29 Thread Richard Lynch
I am using PHP-4.1.1, postgresql on Linux.

I want the following functionality, I dont know how to implement it.

Each time a new user registeres, I want to create mail account by the name
he specifies and allocate him some space of the server, say 2mb.

How this is incorporated ?

Woof.

DANGER WILL ROBINSON DANGER

If you allow PHP to create a user account with actual login, then *ANYBODY*
else on the same server can upload a PHP file and create some accounts for
themselves.  With a little more work, they might even be able to create a
'root' account.

Do you *really* need this "feature"?

If so, you're going to *HAVE* to understand the Operating System and its
security measures, and do the least INsecure thing you can and still make it
work.

For starters, everything should be in SSL (HTTPS) so that you're not
transmitting their new username/password in the clear.

Then, you've *GOT* to find some way of limiting the circumstances under
which this creation of a new user can happen.

Things to keep in mind:
You want it to happen *ONLY* in response to your PHP script, not just any
old PHP script.

You only want it to happen for users in the database already, right?

I would suggest that the safest way might be to do this:

Use PHP CGI (do ./configure WITHOUT the --with-apxs or --with-apache part)
and then write a command-line PHP script owned/readable/writable/executable
by 'root' and *NOT* readable, and *CERTAINLY* not writable/executable by
anybody else.

Then, you can simply have this script check for "new" users in the database
that don't have email yet.  Just add another column "has_email" and default
it to '0', and set it to '1' after you set up their email in this script.

You can run it as a cron job, and it would look like this:
?php
  $query = 'select username from users where has_email = 0';
  $newbies = mysql_query($query) or die(mysql_error()); # Okay to use or
die() for a root cron job
  while (list($username) = mysql_fetch_row($newbies)){
# Use http://php.net/exec to create a mailbox.  You are 'root'
if (...successfully_created_mailbox_for_this_user()...){
  $has_email[] = $username;
}
  }
  # Note that we *ONLY* update the ones we *ACTUALLY* created mailboxes for
  # If a *NEW* user has been added in the past half-second, we leave them
alone!
  if (is_array($has_email)){
$has_email = implode("', '", $has_email);
$query = "update users set has_email = 1 where username in
('$has_email')";
mysql_query($query) or die(mysql_error());
  }
?

You *STILL* have the weakness that anybody that can break into your database
can force a shell account to get created.  But at least the HTTP and PHP
side of it are relatively safe...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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


[PHP] Re: Oracle 8i SQL Problem..

2002-07-29 Thread Richard Lynch

Hi,
This really isn't a PHP issue..sorry.
 
I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL
which works for MSSQL 2K and seems correct for Oracle... but keeps
giving me a Error.. ORA-00933 SQL command not properly ended on the
following query...

SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2,
usergrp.userid, users.userdescrip
FROM grp
LEFT JOIN usergrp
ON grp.grp=usergrp.grp
LEFT JOIN users
ON usergrp.userid=users.userid
ORDER BY grp.grp

The error keeps pointing at the first LEFT JOIN. Anybody know why?

WILD GUESSES!

Maybe Oracle don't like when you don't say INNER or OUTER?

Maybe Oracle just plain won't let you do two LEFT JOINs in one?

Maybe Oracle wants some parens so it knows which LEFT JOIN to do first?

Maybe Oracle don't like the line-breaks?

Maybe you have some funky invisible non-ASCII character in there?
[Not likely, but...]

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Site Search

2002-07-29 Thread Richard Lynch


I'm wondering what is a good general approach to enabling site-wide
searches on any topic on a 100% PHP-powered portal-type site for a
tertiary institution (yet to be built). Most if not all content will be
contained in a database, spread across potentially many different
tables. 

How can all this stuff be searched efficiently and effectively to
hopefully find the punter what they're looking for? Searching the
sometimes lengthy main content fields (eg. an academic paper) in every
table of the entire database for every search doesn't seem like the way to
go. But apart from attempting to add some kind of subjective search
term fields to the data, I can't see how else it can be done.

Google for htdig and PHP and see if maybe the answer is to not do it in
PHP at all...

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: REGEX for phone #

2002-07-29 Thread Richard Lynch

I'm using a regular expression (below) to check phone numbers.  I'm getting
an error that I can't make sense of.

$regex = ^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$;

Output I'm getting =
Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28

Anyone know what this means?  I know it's not bitching about the phone
number, it's bitching about the expression.  But why?  Some thing wrong with
the expression?  It works fine in PERL, which this is supposed to be
compatible with.

For starters, if Perl wants \ PHP needs \\ since \ is special in both
languages.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: REGEX for credit card number

2002-07-29 Thread Richard Lynch

Does anyone have a regular expression that works to validate credit card
numbers?

http://php.net/links.php

has links to code archives that will give you tons of them.

Ditto for the phone numbers post I'm about to read.

NOTE:  Making users not be able to use phone numbers like 1-800-MY-STUFF is
just wrong, wrong, wrong, not to mention that sooner or later an
International user or somebody with an extension or who needs you to press
*2 to reach them is gonna get screwed by your stupid phone regex... Don't do
it.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: need help with uploading images

2002-07-29 Thread Richard Lynch

I'm trying to get an uploader to work, where you check to make sure it's a
jpeg file that's being uploaded, and no other files allowed. the server is
unix linux using php4.1

http://php.net/getimagesize

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Adding slashes when magic quotes is off?

2002-07-29 Thread Richard Lynch

I'm making a website for a friend, and trying to do everything the right 
way.  I want to add slashes to EGPCS values.  I know how to use this, 
but one of the comments on the get_magic_quotes_gpc entry in the manual 
points out that it wouldn't work with arrays in these values - and they 
have a point.  Does anyone have code that works with arrays in EGPCS 
values?  Thanks.

Something like this:

function array_add_slashes($data){
  if (is_array($data)){
while (list($key, $value) = each($data)){
  $result[$key] = array_add_slashes($value);
}
  }
  else{
$result = addslashes($data);
  }
  return $result;
}

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: sessions and https

2002-07-29 Thread Richard Lynch

Do sessions not work when using an https connection?  It seems I'm losing my
data between pages.

You will need to pass the Session ID from page to page any time the user
crosses the HTTP/HTTPS boundary.

Actually, once you pass it, it will stick around on both, but you may want
to be sure and synchronize by passing it on every boundary point.

But Cookies sent to the HTTPS are not on the HTTP and vice versa.

That ain't PHP, that's just how cookies work.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: Nope it didn't work :(

2002-07-29 Thread Richard Lynch

I've been trying a few things that should actually work and for some strange
reason they aren't. It's a strange one indeed. jpg is not a MIME type though
(just thought I'd let you know that) but nevertheless it should work, but
for some weird reason it isn't.
I'll keep plugging away at it till I figure it out.

Already answered the original, but thought I'd add:

The $_FILE['filename']['type']

is just set to whatever the browser *CLAIMS* the file's type is.

So, (A) every damn browser sets it differently and (B) a real hacker can
make it be any damn thing they want and it can't be trusted anyway.

$_FILE['filename']['type'] is therefore essentially USELESS and might as
well be ripped out. :-)

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: PHP-MySQL connection problem

2002-07-29 Thread Richard Lynch

My server is running on shared server which has support for PHP 4.1.2. I 
installed mySQL for our shared server. I also installed phpMyAdmin. Both 
are running properly. But I am facing following problems

1) If there is any error in the script - It is not getting displayed - 
screen is becoming blank, so it is becoming very difficult for me to make 
out any mistake.

Check the php.ini values (or use ?php phpinfo();? to see what your values
are for error_reporting and error_logging and display_errors.

Your errors may be going into the Apache error log or even some other
separate log where they belong.

If so, your ISP is to be commended for their vigilance and Security focus.

2) I am trying to send email - but not getting any email. This is the script

?
$mailBody = This is one line \ n This is a second line \n\n this is a 
third line;

For one thing use \r\n not just \n.

Spec.

$boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody);
print (Email has been send );
?

I am getting print statement but not the mail. Any extra settings are 
required ?

if ($boolMail){
  print Email has been queued.BR\n;
}
else{
  print Couldn't even queue email, much less send it!BR\n;
}

Check your sendmail logs to see what's going on.
Also check the sendmail and SMTP settings in php.ini (or ?php phpinfo();?
and see if they make sense.

Also ask your ISP if PHP (user 'nobody', probably) is even *ALLOWED* to send
email.  Maybe not.  If they were paranoid enough to fix the logging, they
may have dis-allowed PHP to send email.


-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] Re: libphp4.so

2002-07-29 Thread Richard Lynch

howdy,

i've got it all configured correctly .. well it doesn't spit any errors out
on make
but when i got to view a web page it opens a down load box ..so i added this

LoadModule php4_modulelibexec/libphp4.so

to httpd.conf as per the manual and restarted apache but it didn't start
saying it couldn't find libphp.so which leads me to my question .. that file
is created automatically correct?

i havent been able to find that file on my machine any where.. so i can't
point it to another location ... any one got any ideas what i should do as i
have not seen any info any where that will direct me in this situation...

Do the make install again and pay attention to what scrolls by and see
where it puts the libphp4.so file.

Then, make sure that's where Apache expects it.

the LoadModule directive acts in conjunction with the one above all the
LoadModules that tells Apache where to start looking for Modules in the
first place.

Some folks set that in httpd.conf to include the libexec part, so then
your libexec in the LoadModule line is ending up doubling the libexec in
the path and that ain't gonna work.

If there are any *working* LoadModule lines, you can try digging around to
find them on your hard drive, and make sure libphp4.so is sitting next to
them, and then do the LoadModule the same way as the working ones.

http://apache.org will explain all the stuff I just said in formal language.
:-)

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

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




[PHP] ENCRYPT() in MySQL

2002-07-29 Thread Justin French

Hi all,

Sorry to be slightly OT, but I've prolly answered 1000 OT posts in the last
year, and this IS related for all those without mycrypt, so...

I'm on a shared server which does not have mcrypt... not good, since i want
to temporarily store credit card numbers in an encrypted manner, either in a
MySQL database, or in a text file.

So I started google'ing for a class or something that someone may have
written for two-way encryption WITH A KEY TO UNLOCK.

Couldn't find much, then did a search on MySQL.com, and found the ENCRYPT(),
DECRYPT(), ENCODE() and DECODE() functions.

Am I barking up the wrong tree, or can these be used for storing sensitive
information (credit card, etc etc) in a mysql table?

The MySQL manual isn't particularly in-depth about it all:
http://www.mysql.com/doc/M/i/Miscellaneous_functions.html


I AM running in a linux environment (RedHat I think)...


Thanks in advance,

Justin French


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




[PHP] slm

2002-07-29 Thread TUBA UGRAS

Merhaba,
Tolga, eger bu mesaj sana ulasirsa bana e-mail yollar misin :) ben tuba...

TUBA UÐRAÞ
[EMAIL PROTECTED]


_
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] Create a link where http://

2002-07-29 Thread Jesse Lawrence

Hello there, I'm putting together a message board, and
would like to automatically turn any instance of
http://whatever into a link, without requiring the
viewers to enter html.  I'm thinking regex is probably
the way to go with this, but I'm not really seeing how
to do it.  If someone could point me towards a
solution, it would be greatly appreciated.

Thanks very much, 
Jesse Lawrence
http://soniceast.d2g.ca/jesse/

__ 
Post your ad for free now! http://personals.yahoo.ca

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




Re: [PHP] calling user-defined php functions from a href tag

2002-07-29 Thread Brent Baisley

Actually, this works very similar to Javascript in that you can use 
javascript to parse the URL and thus read values from the previous 
page. PHP will declare the variables with the values based on the URL, 
you don't even have to parse it.
If your URL/HREF is like this:
www.url.com/?variable=Valuevariable2=Valuevariable3=value...
Then on the receiving page, php will have those variables and values 
declared, just like a form was submitted. I'm sure there is some extra 
work you will need to if you are using PHP 4.2 with the globals off. I 
haven't moved up to that version yet.


On Friday, July 26, 2002, at 10:43 PM, Michael wrote:

 Basically, I have a php file with dozens of functions in it. I want ONE 
 of
 them to get called when a link is clicked.

 Currently, I achieve this with the use of HTML forms. My form 
 generates a
 list of options. And the user has to select an option, then click the
 SUBMIT button.
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




[PHP] Re: Create a link where http://

2002-07-29 Thread lallous

?
$mem = Hello world! http://www.helloworld.com\n

Hello world! ftp://ftp.server.com\n

Hello world www.helloworld.com;

// code starts here

$mem = preg_replace (/\s+([http:|ftp:]{0,1}\S+\.\S+)/me, ' A href=\'.

(ereg('^[http:|ftp:]','\\1')

? '\\1\\\1/A'

: 'http://\\1\;http://\\1/A'), $mem);

print ($mem);

?

good luck,

Jesse Lawrence [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello there, I'm putting together a message board, and
 would like to automatically turn any instance of
 http://whatever into a link, without requiring the
 viewers to enter html.  I'm thinking regex is probably
 the way to go with this, but I'm not really seeing how
 to do it.  If someone could point me towards a
 solution, it would be greatly appreciated.

 Thanks very much,
 Jesse Lawrence
 http://soniceast.d2g.ca/jesse/

 __
 Post your ad for free now! http://personals.yahoo.ca



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




Re: [PHP] Call func with variable num params (Dont confuse with making func variable params)

2002-07-29 Thread Brent Baisley

Pass your parameter as an array rather than a variable. Then you 
traverse the array to get all your values.


On Friday, July 26, 2002, at 09:38 PM, Mathieu Dumoulin wrote:

 Ok, here i made a function that can accept an unknown number of params.

 In fact, it's a data interface for a mysql database, when i call the
 object's constructor it is in possibility to pass any number of table 
 names
 from 1 to x. Now i got this other class called a data interfacer which 
 sends
 a certain number of tables to the data interface constructor. I tried 
 doing:

 $interface = new data_interface($table1, eval($table2, $table3, 
 $table4));
 $interface = eval(new data_interface($table1, $table2, $table3, 
 $table4));

 and various other tries. The thing is i can't know how many tables can 
 be
 transfered from the data interfacer to the data_interface. So i could 
 make a
 if..elseif...elseif until i reach something like 10 tables but still, 
 it's
 not a good practice, i'm sure there is a way to emulate real parameters 
 when
 they are needed and skip them in the call if you don't have them.

 Can anybody help me out?

 InsaneCoder

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


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




[PHP] PHP counterpart to 4GuysFromRolla?

2002-07-29 Thread Paul Dionne

Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/

I always thought it was a great resource, easy to use, and full of 
information.  I have not found anything nearly as comparable for PHP so far.

Paul

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




[PHP] Re: PHP counterpart to 4GuysFromRolla?

2002-07-29 Thread lallous

www.phpbeginner.com
http://www.zend.com/zend/tut/

.
.
.

Paul Dionne [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/

 I always thought it was a great resource, easy to use, and full of
 information.  I have not found anything nearly as comparable for PHP so
far.

 Paul



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




RE: [PHP] PHP counterpart to 4GuysFromRolla?

2002-07-29 Thread Jay Blanchard

[snip]
Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/
[/snip]

http://www.phpbuilder.com ?

Jay

Monday is an awful way to spend 1/7th of your life 

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort  Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***


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




Re: [PHP] PHP counterpart to 4GuysFromRolla?

2002-07-29 Thread Jason Wong

On Monday 29 July 2002 20:42, Paul Dionne wrote:
 Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/

 I always thought it was a great resource, easy to use, and full of
 information.  I have not found anything nearly as comparable for PHP so
 far.

www.phpbuilder.com is probably the closest.

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

/*
Yow!  I'm imagining a surfer van filled with soy sauce!
*/


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




[PHP] Re: Extra spacing with br in HTML

2002-07-29 Thread Kevin Breit

On Mon, 2002-07-29 at 05:29, Richard Lynch wrote:
 That creates a lot of white space when that HTML is rendered.  How do I
 tell PHP not to put line breaks in a situation like that?
 
 You can't really have the user putting in HTML and then you adding in
 nl2br() as well...
 
 If you're gonna let them type in HTML, just have them put in any line-breaks
 and P tags they need.
 
 If they don't understand the BR or P tag, they won't be able to do any
 others either.  :-)
Yeah.  Lucky for us, I am the user.  So, I know what rules to follow.  I
was just hoping for some extra convenience.

Thanks!
-- 
Kevin Breit [EMAIL PROTECTED]


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




[PHP] Brain Fart- table formatting help

2002-07-29 Thread Brian V Bonini

I'm having a total brain fart and can not seem to get the right logic for
this...

I'm trying to format the output of a db query with alternating row colors,
the thing is the usual
if ($i%2) {} will not work here because the alternating colors do not
necessarily fall on odd or even rows.

The one constant is that if ($row-show_title) is true the table row will
have a background color then I need to make the rows after that alternate
until if ($row-show_title) is true again.

Roughly I have the whole thing laid out like this right now:

echo table BORDER=\0\ CELLSPACING=\0\ CELLPADDING=\2\\n;
while($row = mysql_fetch_object($result)) {
if($row-show_company  $row-show_title  $row-show_month) {
display month;
} else if ($row-show_title) {
display title;
display first row with background color;
} else {
display rows with no background color; //right here needs to alternate
tr background color
}
}
echo /table;

I think I've been looking at his too long and I just have jello brain right
now but I just can't seem to straighten this out in my head...

Thanks for the help...

-B


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




RE: [PHP] Brain Fart- table formatting help

2002-07-29 Thread Jay Blanchard

[snip]
I'm trying to format the output of a db query with alternating row colors,
the thing is the usual
if ($i%2) {} will not work here because the alternating colors do not
necessarily fall on odd or even rows.
[/snip]

?php
$i = 0;
while($exrows = mysql_fetch_object($dbcdrex)){
$bgcolor = ($i++  1) ? '#FF' : '#CC';
//other table stuff
?

HTH!

Jay

Minds are like parachutes…they only function when OPEN

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort  Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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




Re: [PHP] Create a link where http://

2002-07-29 Thread Analysis Solutions

On Mon, Jul 29, 2002 at 08:12:33AM -0400, Jesse Lawrence wrote:
 would like to automatically turn any instance of
 http://whatever into a link, without requiring the
 viewers to enter html.

The mailing list archive:
http://groups.google.com/groups?group=php.general

Good search terms:
hyperlink regular expression

Yields this article:
http://groups.google.com/groups?q=hyperlink+%22regular+expression%22+group:php.generalhl=enlr=ie=UTF-8safe=offselm=3A248B2C.13ED233C%40analysisandsolutions.comrnum=2

Which has an excellent [shamelessly patting myself on the back] hyperlink
regular expression for ereg*:

  (http://|https://|ftp://|gopher://|news:|mailto:)
  ([[:alnum:]/!#$%'()*+,.:;=?@~-]+)([[:alnum:]/!#$%'()*+:;=?@~-])

Do note, if the last character of the URI is a , or . it assumes those
are punctuation and leaves them off.

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] Re: PostgreSQL

2002-07-29 Thread 1LT John W. Holmes

 I don't *think* PostgreSQL runs under Windows, really...

 You can maybe install the CygWin stuff (a Linux emulator under Windows)
and
 get that to work, but:

Can anyone confirm that PG will run under CygWin? Will it communicate with
PHP running on Windows, too? I'm just looking for a way to get familar with
PG, nothing production level, so I don't care how slow it is or how often it
crashes...

Or can PG be compiled for Windows?

---John Holmes...


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




[PHP] Re: File Browser like Win Explorer in php

2002-07-29 Thread Reuben D. Budiardja

On Mon, 2002-07-29 at 05:15, Richard Lynch wrote:
 I am wondering if anyone has created or know where I can get a code for
 browsing files and directory in using php in linux. The one I am looking
 for is file browsing capability that is similar to Window Explorer,
 meaning you can expand and collapse directory.
 Are you browsing the files across an HTTP connection?
 Cuz all the little triangles and stuff are gonna get dog-slow for most
 users...

Yes, I am plannig to browse the files accross http conn. However, most
of the user is going to be in the LAN, thus speed is not that much a
problem. And I'm probably not going to use any image. Plus this is a
part of bigger apps, and it just seems convenience to have something
likt this.
 
 Every single click will probably require another HTTP request...

Correct. I toy with the idea of using javascript instead, but that means
I have to load everything at once to the client side. That is not really
healthy, as it might crash the browser. But again, this is not the
primary part of the apps.

 At any rate, search the code archives listed at:
 http://php.net/links.php

Have not found anything so far. I might just start doing it myself. 
But Thanks for the reply.

Reuben D. Budiardja



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




[PHP] Good books on sessions

2002-07-29 Thread Petre

What are good books/websites about sessions.
I'm looking for more advanced stuff, I have the Luke Welling/Laura 
Tompson book, and have read the manual, but I still have issues that are 
unresolved.

Thanks



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




Re: [PHP] Re: REGEX for phone #

2002-07-29 Thread Analysis Solutions

Hi Richard:

On Mon, Jul 29, 2002 at 05:02:49AM -0500, Richard Lynch wrote:
 
 For starters, if Perl wants \ PHP needs \\ since \ is special in both
 languages.

I'm curiuos what you're talking about.  The manual says nothing about this
in the PCRE section:
   Example 1. Examples of valid patterns
  * \/\w+/
  * |(\d{3})-\d+|Sm
http://www.php.net/manual/en/ref.pcre.php

The Pattern Syntax page has a backslashes section which states: In
particular, if you want to match a backslash, you write \\.

Then, all of my patterns work just fine w/o escaping the backslashes.

So, uh, what are you talking about? :)

--Dan

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

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




[PHP] Re: inserting info into db

2002-07-29 Thread lallous

You can save the answers in sessions or cookies and then insert them all in
one bunch.

Elias,
Tyler Durdin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a DB that will take answers to an 82 question survey, but i have
the
 survey divided into 4 html pages(forms) of 20 or so question per page. The
 people taking the survey are not required to fill out every question on
the
 survey. i was wondering how i can insert the data into the db this way.
For
 example,
 the first html page goes to question #24 the next starts at 25 an goes to
 47. How can i enter 25 to 47 into the db and keep it all in numerical
order
 when 1-24 are entered first? One more question, does anyone have any
 recommendations on how i can make it so the users can take page one of the
 survey and then come back and finish pages 2 (or something similar to this
 where they finish one of the pages and come back to finish the others
later)
 later? Thanks in advance.



 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com




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




[PHP] inserting info into db

2002-07-29 Thread Tyler Durdin

I have a DB that will take answers to an 82 question survey, but i have the 
survey divided into 4 html pages(forms) of 20 or so question per page. The 
people taking the survey are not required to fill out every question on the 
survey. i was wondering how i can insert the data into the db this way. For 
example,
the first html page goes to question #24 the next starts at 25 an goes to 
47. How can i enter 25 to 47 into the db and keep it all in numerical order 
when 1-24 are entered first? One more question, does anyone have any 
recommendations on how i can make it so the users can take page one of the 
survey and then come back and finish pages 2 (or something similar to this 
where they finish one of the pages and come back to finish the others later) 
later? Thanks in advance.



_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] Re: inserting info into db

2002-07-29 Thread Reuben D. Budiardja

You can save each page of the survey to somekind of temporary table in
the database, and assign a session_id to it. So everytime the user click
Go to Next Page, for example, the page actually submit the form,
process it using php, save it in a temporary table and use session_id to
identify it, and then the php can redirect to the next page.

The next time the user wants to go back to previous page, the page
actually query the temporary database to see if there are any survey
already in, and display them if there are, or put default values
otherwise. 

When the user get the last screen and click, for example, Submit my
Survey, then your page actually process all the data in the temporary
table, fuss with it anyway you want, and put them in the main table, and
delete all the entry in the temporary table that match with that
session_id.

Just remember that session_id is your key to identity this session, so
you need to pass that around between pages. This will allow multiple
user accessing the same program.

This is better and saver than using cookies. Since using cookies, you're
kind of at the mercy of the user. What happens if the user does not have
the cookie turn on? what happens if the user suddently, for some unknown
reason, want to delete all the cookies in the middle of doing the
survey? I don't know for sure but they are also cookies limitation for
storing data. So my advice, always try to use server side solution for
something like this.

Hope this helps.
Reuben D. Budiardja


On Mon, 2002-07-29 at 10:59, lallous wrote:
 You can save the answers in sessions or cookies and then insert them all in
 one bunch.
 
 Elias,
 Tyler Durdin [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I have a DB that will take answers to an 82 question survey, but i have
 the
  survey divided into 4 html pages(forms) of 20 or so question per page. The
  people taking the survey are not required to fill out every question on
 the
  survey. i was wondering how i can insert the data into the db this way.
 For
  example,
  the first html page goes to question #24 the next starts at 25 an goes to
  47. How can i enter 25 to 47 into the db and keep it all in numerical
 order
  when 1-24 are entered first? One more question, does anyone have any
  recommendations on how i can make it so the users can take page one of the
  survey and then come back and finish pages 2 (or something similar to this
  where they finish one of the pages and come back to finish the others
 later)
  later? Thanks in advance.
 
 
 
  _
  Chat with friends online, try MSN Messenger: http://messenger.msn.com
 
 
 
 
 -- 
 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] Ming Sprite confusion

2002-07-29 Thread Rasmus Lerdorf

You would probably stand more chance of an answer on the ming-fun mailing
list.

-Rasmus

On Mon, 29 Jul 2002, Richard Lynch wrote:

 Please cc me on answers, as I'm way behind in this list...

 I have a perfectly good Ming (Flash) movie coming out of PHP, but it's a bit
 large...

 I'd like to put this thing on a diet.

 I figured I could do it with a Sprite for the tiny portion that's animated,
 but I'm not getting quite what I expect for output...

 Here's the way it should look:
 http://tourbaby.com/scheduleswf.htm
 350K

 Here's the Sprite version:
 http://tourbaby.com/scheduleswf.htm?useSprite=1
 80K

 Here's the source:
 http://tourbaby.com/scheduleswf.phps

 It seems to be skipping all the nextframe calls I make on the Sprite in
 the animation loop...  What's up with that?

 Am I just being bone-headed about something?  (Probably, but what?)

 The background map JPEG is only like 24K, but still I don't need to repeat
 that whole thing every frame...

 PS Any way to get the text back to blank so I don't create/destroy 50 text
 objects?
 PPS Any way to diagnose a bloated Ming movie and determine where all the
 space is going?
 PPPS Anything else I could do to put this thing on a diet?
 S Any pointers to OpenSource text-to-speech applications would be quite
 useful as well.

 --
 Like Music?  http://l-i-e.com/artists.htm
 I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
 major distro).  Need to record live events (mixed already) to stereo
 CD-quality.  Soundcard Recommendations?
 Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
 post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
 audio-to-disk.

 --
 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] Good books on sessions

2002-07-29 Thread Rasmus Lerdorf

What issues?  Just ask.

-Rasmus

On Mon, 29 Jul 2002, Petre wrote:

 What are good books/websites about sessions.
 I'm looking for more advanced stuff, I have the Luke Welling/Laura
 Tompson book, and have read the manual, but I still have issues that are
 unresolved.

 Thanks



 --
 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] Brain Fart- table formatting help

2002-07-29 Thread Brian V Bonini

Isn't that the same thing essentially? See, from the time ($row-show_title)
is true until it is true again is not a fixed number so the only constant is
that if ($row-show_title) is true then the tr background color will be
on. Then I need to alternate the background color between on and off until
($row-show_title) is true again. Then start the process over. So I'm sure
my ignorance has prevented me from fully understanding what you tried to
show me below but isn't that the same as saying:
if ($i1) {
 do this;
} else {
 do this;
}
which is the same as if ($i%2) { etc. }

???

-B

 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 29, 2002 9:19 AM
 To: 'Brian V Bonini'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Brain Fart- table formatting help


 [snip]
 I'm trying to format the output of a db query with alternating row colors,
 the thing is the usual
 if ($i%2) {} will not work here because the alternating colors do not
 necessarily fall on odd or even rows.
 [/snip]

 ?php
 $i = 0;
 while($exrows = mysql_fetch_object($dbcdrex)){
   $bgcolor = ($i++  1) ? '#FF' : '#CC';
 //other table stuff
 ?

 HTH!

 Jay

 Minds are like parachutes…they only function when OPEN

 *
 * Want to meet other PHP developers *
 * in your area? Check out:  *
 * http://php.meetup.com/*
 * No developer is an island ... *
 *

 ***
 * *
 * Texas PHP Developers Meeting*
 * Spring 2003 *
 * T Bar M Resort  Conference Center  *
 * New Braunfels, Texas*
 * Interested? Contact;*
 * [EMAIL PROTECTED] *
 * *
 ***




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




[PHP] Patch 4.2.2

2002-07-29 Thread Sonket

I download Patch for 4.2.1 to become to 4.2.2
I apply it :

cd /usr/local
patch -p0 path/to/patch

it seems the patch is correctly installed, but when the result of 
phpinfo() tells me that the installed version is 4.2.1 yet !

NEWS file is modified, etc, but i don't know if this patch is working.

I don't know too, if afterwards 'patch -p0 path/to/patch' i have run 
./configure
make
make install

I never have apply any patch for my php...
Sorry for my poor english :P


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




[PHP] PHP 4.2.2 vpopmail

2002-07-29 Thread Jakub Zawierucha

I have little problem with vpopmail functions from PHP 4.2.2. When I use 
  vpopmail_auth_user ( blah, foo.bar.pl, secret string ); I get no 
correct return value ( echo vpopmail_auth_user ( blah, foo.bar.pl, 
secret string ); - give me no result ). This values are 100% good. I 
have Apache with suEXEC (VirtualHost - User vpopmail, Group vchkpw).


Here's details:

My Apache:
 ./configure \
 --enable-suexec \
 --suexec-caller=www-data \
 --suexec-docroot=/usr/local/apache \
 --server-uid=www-data \
 --server-gid=www-data \
 --enable-module=log_referer \
 --enable-module=usertrack \
 --disable-module=imap \
 --activate-module=src/modules/php4/libphp4.a \
 --prefix=/usr/local/apache

cd src
# ADD line AddModule modules/php4/libphp4.a in Configure
./Configure
make
cd ..
make install

My PHP:

 ./configure \
 --enable-tokenizer \
 --enable-track-vars \
 --enable-ftp \
 --enable-safe-mode \
 --with-vpopmail=/home/vpopmail \
 --with-apache=${SRC_APACHE_DIR} \
 --prefix=/usr/local

 make;make install

infophp(); produce:

vpopmail version  5.2.1
vpopmail uid/gid php uid/gid/euid/egid 89/89 33/33/33/33
vpopmail dir /home/vpopmail
vpopmail vadddomain  /home/vpopmail/bin/vadddomain
vpopmail vdeldomain  /home/vpopmail/bin/vdeldomain
vpopmail vaddaliasdomain /home/vpopmail/bin/vaddaliasdomain
vpopmail valias support  Enabled


UIDs and GIDs :

# cat /etc/group | grep 'vchkpw'
vchkpw:x:89:
# cat /etc/passwd | grep 'vpopmail'
vpopmail:x:89:89::/home/vpopmail:/bin/bash
# cat /etc/passwd | grep 'www-data'
www-data:x:33:33:www-data:/var/www:/non

Is this problem of my configuration or broken code of php extensions ?
--

---= Jakub Zawierucha teku(at)teku.ptc.pl.nospam - remove .nospam =---


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




Re: [PHP] Picking up Data of Previous Date from Table

2002-07-29 Thread Analysis Solutions

On Mon, Jul 29, 2002 at 01:03:55AM -0700, Thomas Edison Jr. wrote:
 
 SELECT * FROM transactions,holdings where
 transactions.isinno=holdings.isinno AND
 transactions.clientid='$clientid' AND
 holdings.clbal!=0 GROUP BY holdings.isinno ORDER BY
 shares

 Now for this purpose i'm facing a simple problem. The
 Data being picked up is of the same date from both the
 Tables. However, what is required is that the Data
 from the Holdings table needs to be picked up from a
 Date a day earlier then the Transactions Table Data.

You don't have any JOIN's in there.  Set up your JOIN syntax something 
like this:

...FROM transactions
LEFT JOIN holdings
ON (transactions.date = date_sub(holdings.date, INTERVAL 1 DAY))...

This probably isn't exactly what you need because I'm not really paying 
attention to the exact demands your request.  Rather, I'm pointing you in 
the right direction for you to figure out what you need to do by reading 
the manual, hacking and searching newsgroup archives.

--Dan

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

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




[PHP] Dates and Date()

2002-07-29 Thread Christopher J. Crane

I believethisto be one way to find out yesterday's date:
$tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));

However, I would like to have a snippet of code to tell me how to get the
date of today - 10 days ago.

if today is jul 29, 2002, how do I get the date funtion to tell me 10 days
ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from
29, but what happens if the date was jul 2, 2002. How do I get the correct
date returned




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




Re: [PHP] Dates and Date()

2002-07-29 Thread Rasmus Lerdorf

$ts = strtotime(-10 days);

On Mon, 29 Jul 2002, Christopher J. Crane wrote:

 I believethisto be one way to find out yesterday's date:
 $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));

 However, I would like to have a snippet of code to tell me how to get the
 date of today - 10 days ago.

 if today is jul 29, 2002, how do I get the date funtion to tell me 10 days
 ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from
 29, but what happens if the date was jul 2, 2002. How do I get the correct
 date returned




 --
 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] Dates and Date()

2002-07-29 Thread Analysis Solutions

On Mon, Jul 29, 2002 at 10:51:39AM -0400, Christopher J. Crane wrote:
 I believethisto be one way to find out yesterday's date:
 $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));
 
 However, I would like to have a snippet of code to tell me how to get the
 date of today - 10 days ago.

You have a working example of how to get yesterday.  Did you even try to
rework it to get ten days ago by substituting -10 for -1?  What
happened?

--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] Brain Fart- table formatting help

2002-07-29 Thread Jay Blanchard

[snip]
Isn't that the same thing essentially? See, from the time ($row-show_title)
is true until it is true again is not a fixed number so the only constant is
that if ($row-show_title) is true then the tr background color will be
on. Then I need to alternate the background color between on and off until
($row-show_title) is true again. Then start the process over. So I'm sure
my ignorance has prevented me from fully understanding what you tried to
show me below but isn't that the same as saying:
if ($i1) {
 do this;
} else {
 do this;
}
which is the same as if ($i%2) { etc. }
[/snip]

Ah, well... that was not clearly explained in your first post. You wanted
alternating rows colors, and that is what I gave you. Let's see if I
understand the question;

For each show_title there are multiple rows of data, but they do not match
row counts from show to show?
You want the alternating colors to begin with each show_title, in other
words the row with the show_title in it shall always be gray, while others
rows alternate between white and gray?

Jay

Madness takes its toll-please have exact change

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort  Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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




RE: [PHP] Patch 4.2.2

2002-07-29 Thread Matt Babineau

Did you restart Apache? I am an Apache Newbie, but I would think you
would need to simple restart apache to take the old PHP out of memory so
it can load the new one?

Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Sonket [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 29, 2002 10:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Patch 4.2.2


I download Patch for 4.2.1 to become to 4.2.2
I apply it :

cd /usr/local
patch -p0 path/to/patch

it seems the patch is correctly installed, but when the result of 
phpinfo() tells me that the installed version is 4.2.1 yet !

NEWS file is modified, etc, but i don't know if this patch is working.

I don't know too, if afterwards 'patch -p0 path/to/patch' i have run 
./configure
make
make install

I never have apply any patch for my php...
Sorry for my poor english :P


-- 
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] Dates and Date()

2002-07-29 Thread Andrey Hristov



- Original Message -
From: Christopher J. Crane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 5:51 PM
Subject: [PHP] Dates and Date()


 I believethisto be one way to find out yesterday's date:
 $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));

 However, I would like to have a snippet of code to tell me how to get the
 date of today - 10 days ago.

 if today is jul 29, 2002, how do I get the date funtion to tell me 10 days
 ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from
 29, but what happens if the date was jul 2, 2002. How do I get the correct
 date returned

All date functions handle correctly this case
 so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002));
will be:
06:22:2002
You can add/substract what you wish and will get correct results in case the
the resulting timestamp is between 1.1.1970 and somewhere in year 2038.


Best regards,
Andrey Hristov


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




Re: [PHP] Brain Fart- table formatting help

2002-07-29 Thread 1LT John W. Holmes

So only increase $i when $row-show_title is true.

if($row-show_title) { $i++; }
$bgcolor = ($i  1) ? '#FF' : '#CC';

---John Holmes...

- Original Message -
From: Brian V Bonini [EMAIL PROTECTED]
To: Jay Blanchard [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, July 29, 2002 10:26 AM
Subject: RE: [PHP] Brain Fart- table formatting help


 Isn't that the same thing essentially? See, from the time
($row-show_title)
 is true until it is true again is not a fixed number so the only constant
is
 that if ($row-show_title) is true then the tr background color will be
 on. Then I need to alternate the background color between on and off until
 ($row-show_title) is true again. Then start the process over. So I'm sure
 my ignorance has prevented me from fully understanding what you tried to
 show me below but isn't that the same as saying:
 if ($i1) {
  do this;
 } else {
  do this;
 }
 which is the same as if ($i%2) { etc. }

 ???

 -B

  -Original Message-
  From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 29, 2002 9:19 AM
  To: 'Brian V Bonini'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Brain Fart- table formatting help
 
 
  [snip]
  I'm trying to format the output of a db query with alternating row
colors,
  the thing is the usual
  if ($i%2) {} will not work here because the alternating colors do not
  necessarily fall on odd or even rows.
  [/snip]
 
  ?php
  $i = 0;
  while($exrows = mysql_fetch_object($dbcdrex)){
  $bgcolor = ($i++  1) ? '#FF' : '#CC';
  //other table stuff
  ?
 
  HTH!
 
  Jay
 
  Minds are like parachutes.they only function when OPEN
 
  *
  * Want to meet other PHP developers *
  * in your area? Check out:  *
  * http://php.meetup.com/*
  * No developer is an island ... *
  *
 
  ***
  * *
  * Texas PHP Developers Meeting*
  * Spring 2003 *
  * T Bar M Resort  Conference Center  *
  * New Braunfels, Texas*
  * Interested? Contact;*
  * [EMAIL PROTECTED] *
  * *
  ***
 
 


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



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




Re: [PHP] Patch 4.2.2

2002-07-29 Thread Sonket

yes, yes, and the version don't change...

Matt Babineau wrote:
 Did you restart Apache? I am an Apache Newbie, but I would think you
 would need to simple restart apache to take the old PHP out of memory so
 it can load the new one?
 
 Matt Babineau
 MCWD / CCFD
 -
 e: [EMAIL PROTECTED]
 p: 603.943.4237
 w: http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105
 
 
 -Original Message-
 From: Sonket [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, July 29, 2002 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Patch 4.2.2
 
 
 I download Patch for 4.2.1 to become to 4.2.2
 I apply it :
 
 cd /usr/local
 patch -p0 path/to/patch
 
 it seems the patch is correctly installed, but when the result of 
 phpinfo() tells me that the installed version is 4.2.1 yet !
 
 NEWS file is modified, etc, but i don't know if this patch is working.
 
 I don't know too, if afterwards 'patch -p0 path/to/patch' i have run 
 ./configure
 make
 make install
 
 I never have apply any patch for my php...
 Sorry for my poor english :P
 
 



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




Re: [PHP] ENCRYPT() in MySQL

2002-07-29 Thread Analysis Solutions

On Mon, Jul 29, 2002 at 10:06:29PM +1000, Justin French wrote:
 
 I'm on a shared server which does not have mcrypt... not good, since i want
 to temporarily store credit card numbers in an encrypted manner, either in a
 MySQL database, or in a text file.

Uh, what are you going to do with the cc data that you need to store it?


 Couldn't find much, then did a search on MySQL.com, and found the ENCRYPT(),
 DECRYPT(), ENCODE() and DECODE() functions.
 
 Am I barking up the wrong tree, or can these be used for storing sensitive
 information (credit card, etc etc) in a mysql table?

Should work.

--Dan

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

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




[PHP] Array variable in Javascript PHP

2002-07-29 Thread Sheni R. Meledath

Hello:

In a form I am using a series of check boxes for a number of lists. Some 
calculations has to be done on the client side using Javascript depending 
upon the check box values. For this I am using a single variable name 
(array) for the check boxes in a list and another for the next list and so 
on. The format I have used is
input type=checkbox name=list1 value=Education onclick=addList() 
Education
input type=checkbox name=list1 value=Profession onclick=addList() 
Profession

I can access these variables from Javascript as list1[0]  list1[1].
(document.form.list1['0'].checked  document.form.list1['1'].checked

But when this form is submitted to the PHP script I am getting only the 
last value. list1 = 'Profession'. I am not getting an array of values.
?
for ($i=0; $icount($list1); $i++)
{
$listall .= '$list1[$i],';
}
?

How can I accomplish both these operations? I cannot use single variables 
names for each item in the form, because it is more than 1000. Also I want 
to use both Javascript  PHP operations. Please help to solve this issue or 
suggest some other ways to accomplish this business logic.

Many Thanks in Advance  Best Regards
Sheni R Meledath
[EMAIL PROTECTED]


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




[PHP] Array variable in Javascript PHP

2002-07-29 Thread Sheni R. Meledath

Hello:

In a form I am using a series of check boxes for a number of lists. Some 
calculations has to be done on the client side using Javascript depending 
upon the check box values. For this I am using a single variable name 
(array) for the check boxes in a list and another for the next list and so 
on. The format I have used is
input type=checkbox name=list1 value=Education onclick=addList() 
Education
input type=checkbox name=list1 value=Profession onclick=addList() 
Profession

I can access these variables from Javascript as list1[0]  list1[1].
(document.form.list1['0'].checked  document.form.list1['1'].checked

But when this form is submitted to the PHP script I am getting only the 
last value. list1 = 'Profession'. I am not getting an array of values.
?
for ($i=0; $icount($list1); $i++)
{
$listall .= '$list1[$i],';
}
?

How can I accomplish both these operations? I cannot use single variables 
names for each item in the form, because it is more than 1000. Also I want 
to use both Javascript  PHP operations. Please help to solve this issue or 
suggest some other ways to accomplish this business logic.

Many Thanks in Advance  Best Regards
Sheni R Meledath
[EMAIL PROTECTED]


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




[PHP] Re: filling an array(2)

2002-07-29 Thread Steve Buehler

That did the trick.  Thank you SO MUCH.

Steve

At 03:48 AM 7/29/2002 -0500, Richard Lynch wrote:
 h.  Ok.  Can somebody explain this one?  Why won't it work correctly?
 
 for($m=1;$m=5;$m++){
  $div_idd[$m]=${'row-sub' . $m . 'd'};
 }
 
 Can it not be done with a 3 parter?  The columns in the table that $row
 gets, are sub1d, sub2d, sub3d, sub4d and sub5d.  Or is it the - that is
 messing it up?  I have tried escaping them row\-\sub, but that didn't 
 work.
 What would I search for on the PHP site or where are directions located
 that tells me how to use this type of putting a variable together.  It
 makes it hard to search for it if I don't know what it is called.

You want to search for variable variables

At a guess, you need:

$div_idd[$m] = $row-{'sub' . $m . 'd'};

For sure, you need to get the subXd part together before you get the - or
the $row involved.

--
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
ow3



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
ow3


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




Re: [PHP] Array variable in Javascript PHP

2002-07-29 Thread Danny Shepherd

Try using:

input type=checkbox id=list1 name=list1[] value=Education
onclick=addList() Education
input type=checkbox id=list1 name=list1[] value=Profession
onclick=addList() Profession

That's what I used when doing something pretty similar to you.

HTH

Danny.


- Original Message -
From: Sheni R. Meledath [EMAIL PROTECTED]
To: PHP Masters [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 4:11 PM
Subject: [PHP] Array variable in Javascript  PHP


 Hello:

 In a form I am using a series of check boxes for a number of lists. Some
 calculations has to be done on the client side using Javascript depending
 upon the check box values. For this I am using a single variable name
 (array) for the check boxes in a list and another for the next list and so
 on. The format I have used is
 input type=checkbox name=list1 value=Education onclick=addList()
 Education
 input type=checkbox name=list1 value=Profession
onclick=addList()
 Profession

 I can access these variables from Javascript as list1[0]  list1[1].
 (document.form.list1['0'].checked  document.form.list1['1'].checked

 But when this form is submitted to the PHP script I am getting only the
 last value. list1 = 'Profession'. I am not getting an array of values.
 ?
 for ($i=0; $icount($list1); $i++)
 {
 $listall .= '$list1[$i],';
 }
 ?



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




Re: [PHP] Array variable in Javascript PHP

2002-07-29 Thread Martin Clifford

PHP cannot read a JavaScript array, simple as that.  There are many workarounds, 
depending upon your situation.  You can, for instance, create a function that is 
called onsubmit, that will take any values in checked checkboxes and put them into a 
comma-delimitted string inside a hidden form element.  That string is then passed to 
the PHP page, where it can be parsed (ala implode/explode) and put into a new array.

I hope that made some sense :o)

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


 Sheni R. Meledath [EMAIL PROTECTED] 07/29/02 11:18AM 
Hello:

In a form I am using a series of check boxes for a number of lists. Some 
calculations has to be done on the client side using Javascript depending 
upon the check box values. For this I am using a single variable name 
(array) for the check boxes in a list and another for the next list and so 
on. The format I have used is
input type=checkbox name=list1 value=Education onclick=addList() 
Education
input type=checkbox name=list1 value=Profession onclick=addList() 
Profession

I can access these variables from Javascript as list1[0]  list1[1].
(document.form.list1['0'].checked  document.form.list1['1'].checked

But when this form is submitted to the PHP script I am getting only the 
last value. list1 = 'Profession'. I am not getting an array of values.
?
for ($i=0; $icount($list1); $i++)
{
$listall .= '$list1[$i],';
}
?

How can I accomplish both these operations? I cannot use single variables 
names for each item in the form, because it is more than 1000. Also I want 
to use both Javascript  PHP operations. Please help to solve this issue or 
suggest some other ways to accomplish this business logic.

Many Thanks in Advance  Best Regards
Sheni R Meledath
[EMAIL PROTECTED] 


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



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




RE: [PHP] Re: Table formatting -- PARTIALY SOLVED

2002-07-29 Thread César Aracena

Thnx a lot Martin and all, this worked. Anyway, apart of this being a
logical solution (I almost kill myself for not thinking it before), why
is that the FOR looping (before using that division operator) worked in
such a strange way? Isn't it supposed to stop looping if nothing else is
fetched from the DB?

Pardon my interest in learning, but this is how I am.

Thanks a lot, C.

 -Original Message-
 From: Martin Towell [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 29, 2002 2:05 AM
 To: 'César Aracena'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Table formatting
 
 try changing these two lines
 
 $num_rows = mysql_num_rows($result);
 $num_cols = 2;
 
 to this
 
 $num_cols = 2;
 $num_rows = mysql_num_rows($result) / $num_cols;
 
 this isn't the full solution, but will help you on your way...
 
 HTH
 Martin
 
 -Original Message-
 From: César Aracena [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 29, 2002 2:03 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Table formatting
 
 
 I know no one in this list like to think we newbie's want the job done
 for us, so I'm trying to figure out the below question myself, but
trust
 me when I say it's making me nuts... this is my best shot so far:
 
 $query = SELECT * FROM saav_arts ORDER BY artid;
 $result = mysql_query($query) or die(mysql_error());
 $num_rows = mysql_num_rows($result);
 $num_cols = 2;
 
 for ($x = 0; $x  $num_rows; $x++)
 {
   echo tr;
 
   for ($i = 0; $i  $num_cols; $i++)
   {
 
   $row = mysql_fetch_array($result);
   echo td align=\center\;
   echo a href=\details.php?artid=.$row[artid].\img
 src=\.$CFG-artdir./.$row[artsmall].\
 ALT=\.$row[artname].\ BORDER=\0\/a;
   echo /td;
   }
 
   echo /tr;
 }
 
 The thing is that it shows up two columns as I want, but not the 4
 images that I have in DB... it shows 2 rows of 2 images each and
antoher
 2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was
 looping again with nothing to fetch from the DB... What is this?
 
 Jason: as I wrote this, your tip came over and as you can see I did
 figure it out (almost melted my brain though)... now, do you know what
 is going on?
 
 Thanx, C.
 
  -Original Message-
  From: César Aracena [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 29, 2002 12:27 AM
  To: 'Chris Earle'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Re: Table formatting
 
  I like this method a lot. Now, considering I do like FOR looping as
a
  fact, how can I make a loop inside another loop. I mean, if I tell
the
  first loop that $i=0 and then do the comparison and then add 1 to
$i,
 in
  the inner or second loop should I state that $i=$i or what? Also
make
 it
  $i=0???
 
  Thanks, C.
 
   -Original Message-
   From: Chris Earle [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, July 27, 2002 1:54 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Re: Table formatting
  
   You can do what he said or just put a separate loop inside the
  original
   loop.
  
   Depending on how you get the info, you can use either way (his
would
   create
   less overhead if you are just using the same TD info every row,
   otherwise
   they're really the same because his way you'll have to create an
 array
  to
   access later for multiple rows, or just do my way and have the
loop
  access
   the NEXT *3* (or whatever) items ...).
  
   i.e.,
   for (LOOP FOR TR)
   {
   for (LOOP FOR TD) {}
   }
  
   César aracena [EMAIL PROTECTED] wrote in message
   001a01c234f0$a5e8ad80$28ed0dd1@gateway">news:001a01c234f0$a5e8ad80$28ed0dd1@gateway...
   Hi all.
  
   Last nite I've came across a problem I wasn't able to figure out
by
 my
   self. It's not difficult to make a loop that will make new *TABLE
  ROWS*
   (tr) to show several DB objects in a nice way. what I need to
do,
 is
   to display 2 or maybe even 3 of this objects stored in a DB per
 table
   row, separated in different *TABLE COLUMS* (td). how can I
achieve
   this? What I usually do is:
  
   --
   // DB QUERY
   $query = SELECT * FROM table_name;
   $result = mysql_query($query) or die(mysql_error());
   $num_rows = mysql_num_rows($result);
  
   // NOW THE LOOP
   for ($i=0; $i$num_rows; $i++)
   {
$row = mysql_fetch_array($result);
echo tr;
echo td;
echo $row[whatever];
echo /td;
echo /tr;
   }
   --
  
   but how can I get 2 or 3 columns displaying different db objects?
A
  loop
   inside a loop?
  
   Thanks in advance,
  
mailto:[EMAIL PROTECTED] 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 

RE: [PHP] Stopping Multiple Entries in mySQL DB

2002-07-29 Thread Thomas Edison Jr.

Hi,

Ok i cant actully do this. I have many multiple
entries already in the table which i do not wish to
delete. And it won't alter table with these multiple
entries.

So what i need is a PHP Engineered solution, where my
PHP code would check for existing entries and deny
entry

Thanks,
T. Edison Jr.


--- John Holmes [EMAIL PROTECTED] wrote:
  I just want my Adding Into Database script to
 check if
  the Name/Country already exists, and if it does,
 it
  shouldn't be allowed.
  
  If some with
  Name : Jackson
  Country : USA
  exists in my DB, no one with same name/country
 should
  be able to add his name/country in the DB.
 
 Have your database handle that, not PHP.
 
 When you create your table, make the combo of Name
 and Country unique.
 
 CREATE TABLE your_table {
   Name VARCHAR(15),
   Country VARCHAR(15),
   UNIQUE Name_Country (Name, Country)
 }
 
 Then you can have Jackson, USA, Jackson, UK,
 Someone Else, USA,
 etc...just not the same combination at all.
 
 ---John Holmes...
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP] major problem using mv command to a directory

2002-07-29 Thread electroteque

hi guys i have a big problem i need to fix , i was moving a tar ball to
another dir , using
mv ImageMagick-i686-pc-linux-gnu.tar.gz /home/usr, i now cannot move into
the usr directory, it has somehow appended the tar ball into the driectory
strucuture and cant undo this ? please help



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




RE: [PHP] Brain Fart- table formatting help

2002-07-29 Thread Brian V Bonini

 Ah, well... that was not clearly explained in your first post. You wanted
 alternating rows colors, and that is what I gave you. Let's see if I
 understand the question;

 For each show_title there are multiple rows of data, but they do not match
 row counts from show to show?
 You want the alternating colors to begin with each show_title, in other
 words the row with the show_title in it shall always be gray, while others
 rows alternate between white and gray?


Sorry, I thougth I had explained it better.. But, yes, you have explained it
well now...


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




Re: [PHP] Re: PostgreSQL

2002-07-29 Thread Danny Shepherd

Checkout this FAQ - http://www.ejip.net/faq/postgresql_win_setup_faq.jsp

HTH

Danny.

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Richard Lynch [EMAIL PROTECTED]; Hadi [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 2:24 PM
Subject: Re: [PHP] Re: PostgreSQL


  I don't *think* PostgreSQL runs under Windows, really...
 
  You can maybe install the CygWin stuff (a Linux emulator under Windows)
 and
  get that to work, but:

 Can anyone confirm that PG will run under CygWin? Will it communicate with
 PHP running on Windows, too? I'm just looking for a way to get familar
with
 PG, nothing production level, so I don't care how slow it is or how often
it
 crashes...

 Or can PG be compiled for Windows?

 ---John Holmes...


 --
 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] Stopping Multiple Entries in mySQL DB

2002-07-29 Thread 1LT John W. Holmes

 Ok i cant actully do this. I have many multiple
 entries already in the table which i do not wish to
 delete. And it won't alter table with these multiple
 entries.

 So what i need is a PHP Engineered solution, where my
 PHP code would check for existing entries and deny
 entry

So do it...

SELECT 1 FROM your_table WHERE name = 'NAME FROM FORM' AND city = 'CITY FROM
FORM'

If a row is returned, then a match is found and you shouldn't insert it
again. If no row is returned, then there's no match and you can insert.

You'd be better off to clean up your database now, though...

---John Holmes...

 --- John Holmes [EMAIL PROTECTED] wrote:
   I just want my Adding Into Database script to
  check if
   the Name/Country already exists, and if it does,
  it
   shouldn't be allowed.
  
   If some with
   Name : Jackson
   Country : USA
   exists in my DB, no one with same name/country
  should
   be able to add his name/country in the DB.
 
  Have your database handle that, not PHP.
 
  When you create your table, make the combo of Name
  and Country unique.
 
  CREATE TABLE your_table {
  Name VARCHAR(15),
  Country VARCHAR(15),
  UNIQUE Name_Country (Name, Country)
  }
 
  Then you can have Jackson, USA, Jackson, UK,
  Someone Else, USA,
  etc...just not the same combination at all.
 
  ---John Holmes...
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 __
 Do You Yahoo!?
 Yahoo! Health - Feel better, live better
 http://health.yahoo.com


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




Re: [PHP] Re: Help reg. create user and allocate space

2002-07-29 Thread Rick Widmer

At 04:55 AM 7/29/02 -0500, Richard Lynch wrote:
 I am using PHP-4.1.1, postgresql on Linux.
 
 I want the following functionality, I dont know how to implement it.
 
 Each time a new user registeres, I want to create mail account by the name
 he specifies and allocate him some space of the server, say 2mb.

If this is on Linux, BSD or some UNIX, take a look at Qmail + Vpopmail and
use a virtual domain so at least your email users aren't assigned shell 
accounts
on the server.

http://www.qmail.org

http://www.inter7.com

Rick


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




RE: [PHP] Re: Table formatting -- PARTIALY SOLVED

2002-07-29 Thread César Aracena

I just found a new problem when using the solution Martin tells me
below... if I take out one record from the DB, leaving just 3 objects,
the web page displays:

row1 = 2 objects in two columns
row2 = 1 object in the first column and a *NOT DISPLAYED* image in the
2nd column... how can I override this fourth image from *TRYING TO*
showing?

Thanx a lot, C.

 -Original Message-
 From: César Aracena [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 29, 2002 12:39 PM
 To: 'Martin Towell'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Table formatting -- PARTIALY SOLVED
 
 Thnx a lot Martin and all, this worked. Anyway, apart of this being a
 logical solution (I almost kill myself for not thinking it before),
why
 is that the FOR looping (before using that division operator) worked
in
 such a strange way? Isn't it supposed to stop looping if nothing else
is
 fetched from the DB?
 
 Pardon my interest in learning, but this is how I am.
 
 Thanks a lot, C.
 
  -Original Message-
  From: Martin Towell [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 29, 2002 2:05 AM
  To: 'César Aracena'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Re: Table formatting
 
  try changing these two lines
 
  $num_rows = mysql_num_rows($result);
  $num_cols = 2;
 
  to this
 
  $num_cols = 2;
  $num_rows = mysql_num_rows($result) / $num_cols;
 
  this isn't the full solution, but will help you on your way...
 
  HTH
  Martin
 
  -Original Message-
  From: César Aracena [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 29, 2002 2:03 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] Re: Table formatting
 
 
  I know no one in this list like to think we newbie's want the job
done
  for us, so I'm trying to figure out the below question myself, but
 trust
  me when I say it's making me nuts... this is my best shot so far:
 
  $query = SELECT * FROM saav_arts ORDER BY artid;
  $result = mysql_query($query) or die(mysql_error());
  $num_rows = mysql_num_rows($result);
  $num_cols = 2;
 
  for ($x = 0; $x  $num_rows; $x++)
  {
  echo tr;
 
  for ($i = 0; $i  $num_cols; $i++)
  {
 
  $row = mysql_fetch_array($result);
  echo td align=\center\;
  echo a href=\details.php?artid=.$row[artid].\img
  src=\.$CFG-artdir./.$row[artsmall].\
  ALT=\.$row[artname].\ BORDER=\0\/a;
  echo /td;
  }
 
  echo /tr;
  }
 
  The thing is that it shows up two columns as I want, but not the 4
  images that I have in DB... it shows 2 rows of 2 images each and
 antoher
  2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was
  looping again with nothing to fetch from the DB... What is this?
 
  Jason: as I wrote this, your tip came over and as you can see I did
  figure it out (almost melted my brain though)... now, do you know
what
  is going on?
 
  Thanx, C.
 
   -Original Message-
   From: César Aracena [mailto:[EMAIL PROTECTED]]
   Sent: Monday, July 29, 2002 12:27 AM
   To: 'Chris Earle'; [EMAIL PROTECTED]
   Subject: RE: [PHP] Re: Table formatting
  
   I like this method a lot. Now, considering I do like FOR looping
as
 a
   fact, how can I make a loop inside another loop. I mean, if I tell
 the
   first loop that $i=0 and then do the comparison and then add 1 to
 $i,
  in
   the inner or second loop should I state that $i=$i or what? Also
 make
  it
   $i=0???
  
   Thanks, C.
  
-Original Message-
From: Chris Earle [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 27, 2002 1:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Table formatting
   
You can do what he said or just put a separate loop inside the
   original
loop.
   
Depending on how you get the info, you can use either way (his
 would
create
less overhead if you are just using the same TD info every
row,
otherwise
they're really the same because his way you'll have to create an
  array
   to
access later for multiple rows, or just do my way and have the
 loop
   access
the NEXT *3* (or whatever) items ...).
   
i.e.,
for (LOOP FOR TR)
{
for (LOOP FOR TD) {}
}
   
César aracena [EMAIL PROTECTED] wrote in message
001a01c234f0$a5e8ad80$28ed0dd1@gateway">news:001a01c234f0$a5e8ad80$28ed0dd1@gateway...
Hi all.
   
Last nite I've came across a problem I wasn't able to figure out
 by
  my
self. It's not difficult to make a loop that will make new
*TABLE
   ROWS*
(tr) to show several DB objects in a nice way. what I need to
 do,
  is
to display 2 or maybe even 3 of this objects stored in a DB per
  table
row, separated in different *TABLE COLUMS* (td). how can I
 achieve
this? What I usually do is:
   
--
// DB QUERY
$query = SELECT * FROM table_name;
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($result);
   
// NOW THE LOOP
for ($i=0; $i$num_rows; $i++)
{
 $row = 

Re: [PHP] Dates and Date()

2002-07-29 Thread Christopher J. Crane

Ok here is what I did.
 $Hist_Time = gmstrftime('%m:%d:%Y', strtotime(-10 days));

Now I am wondering if there is a way to look for only the last day business
days and be returned in an array?
- Original Message -
From: Andrey Hristov [EMAIL PROTECTED]
To: Christopher J. Crane [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 10:59 AM
Subject: Re: [PHP] Dates and Date()




 - Original Message -
 From: Christopher J. Crane [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, July 29, 2002 5:51 PM
 Subject: [PHP] Dates and Date()


  I believethisto be one way to find out yesterday's date:
  $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));
 
  However, I would like to have a snippet of code to tell me how to get
the
  date of today - 10 days ago.
 
  if today is jul 29, 2002, how do I get the date funtion to tell me 10
days
  ago. with jul 29, 2002 as the date it would be easy, just subtract 10
from
  29, but what happens if the date was jul 2, 2002. How do I get the
correct
  date returned

 All date functions handle correctly this case
  so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002));
 will be:
 06:22:2002
 You can add/substract what you wish and will get correct results in case
the
 the resulting timestamp is between 1.1.1970 and somewhere in year 2038.


 Best regards,
 Andrey Hristov







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




Re: [PHP] inserting info into db

2002-07-29 Thread Rick Widmer

At 01:56 PM 7/29/02 +, Tyler Durdin wrote:
I have a DB that will take answers to an 82 question survey, but i have 
the survey divided into 4 html pages(forms) of 20 or so question per page. 
The people taking the survey are not required to fill out every question 
on the survey. i was wondering how i can insert the data into the db this 
way. For example,
the first html page goes to question #24 the next starts at 25 an goes to 
47. How can i enter 25 to 47 into the db and keep it all in numerical 
order when 1-24 are entered first? One more question, does anyone have any 
recommendations on how i can make it so the users can take page one of the 
survey and then come back and finish pages 2 (or something similar to this 
where they finish one of the pages and come back to finish the others 
later) later? Thanks in advance.

If I was doing it, I would probably INSERT a mostly empty record in the 
database when they start the survey.  It would just have the info to 
identify the person.  Then on each page of the survey you can UPDATE the 
fields for that page.  If you want to allow them to make changes it should 
be pretty easy.

Rick



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




  1   2   >