Re: [PHP] problem with mssql_query

2003-11-12 Thread Jason Wong
On Tuesday 11 November 2003 23:07, bob pillford wrote:
> Hi all i have the following code which isnt working correctly and i cant
> work out why. Any help would be greatly appreciated as its sending me
> crazy!
>
> $query = "select refno from campaign where appdate between 'nov 07 2003'
> and 'nov 08 2003' "; $result=mssql_query($query,$numero);
> $numrows=mssql_num_rows($result);
> $row=mssql_fetch_row($result);
> echo $numrows;
> print_r($row);
>
>
> Now this returns: 23
> Array ( [0] => 1044998 )
>
> which is 23 for number of rows the query returns but it only ever stores
> the 1st element of the returned array in $row.. Can someone tell me where i
> am going wrong as i need access to the other 22 rows that this query
> returns I have echoed the query and run the out put under freetds tsql
> and get the correct result (this is what i use to access the ms sql server
> 2000).

mssql_fetch_row() only gets *one* row. To get the rest use something like a 
while-loop. For examples refer to the similar mysql_* functions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You will pay for your sins.  If you have already paid, please disregard
this message.
*/

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



php-general Digest 12 Nov 2003 07:07:05 -0000 Issue 2410

2003-11-12 Thread php-general-digest-help

php-general Digest 12 Nov 2003 07:07:05 - Issue 2410

Topics (messages 169197 through 169233):

Re: help create community newbie guide to security
169197 by: Lowell Allen

How to adpated a javascrip with php...
169198 by: Payne
169205 by: Martin Towell
169207 by: Burhan Khalid

Re: configure hangs on pwrite
169199 by: John Nichel

Re: \n and 
169200 by: Marek Kilimajer
169202 by: Brian V Bonini

Philadelphia PHP Users Group
169201 by: Edward Dudlik

Re: location=  Construct Doc
169203 by: Mark
169208 by: Eugene Lee

whois api's
169204 by: Rolf Brusletto
169209 by: Vail, Warren
169218 by: Al

Miami User Group
169206 by: Cesar Cordovez
169223 by: David T-G

Unique ID
169210 by: Dimitri Marshall
169211 by: Marek Kilimajer
169212 by: Javier Muniz
169214 by: Boyan Nedkov
169215 by: John W. Holmes

Time problem
169213 by: Erin
169216 by: Chris Shiflett
169217 by: Vail, Warren
169221 by: John W. Holmes

sorting files by date
169219 by: Justin French
169220 by: Martin Towell
169222 by: David T-G

I meant 'PHP Atlanta user group'...
169224 by: David T-G

Execute Background Process
169225 by: apur kurub ver.1

nusoap
169226 by: Larry Brown

Pear
169227 by: Gary

Help with scripts to add records to a database
169228 by: Mark
169230 by: Mark
169231 by: Rolf Brusletto
169232 by: zhuravlev alexander

Can sudo be used for apache
169229 by: tirumal b

Re: problem with mssql_query
169233 by: Jason Wong

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
> Lawrence Kennon wrote:
>> For a BBS I would like to let users post links to
>> various resources. They 'post' a message to the BBS
>> via a form and that is stored in a MySQL db, then the
>> content of their 'post' is available to other users on
>> the BBS. Currently I strip out all PHP/HTML with the
>> strip_tags() function. What I would really like to do
>> is allow a limited set of HTML tags (like the anchor
>>  tag) but at the same time implement reasonable protection.
> 
> Get yourself a bbcode parser from phpclasses.org so you can use things
> like [b] [/b], and [url=] [/url], etc. This is safer than trying to deal
> with actual HTML, imo. Then use htmlentities() on the data instead of
> strip_tags(), so the users can actually write something like  and
> not have it stripped.

[snip]

I have a "best practice" question related to this thread. I usually store
data in MySQL without any translation, then use htmlspecialchars() before
displaying as HTML. This works well for a content management system where
administrators are entering data in forms and storing, but perhaps it's not
appropriate for storing information from website visitors. If that
information should be translated before storing, then I'd have some stuff
that needs htmlspecialchars() applied before displaying, and some stuff that
does not.

My question is, are there any disadvantages to always following the
procedure described below?

- Use htmlentities() on everything before storing in the database
- Retrieve and display in cms forms without any translation
- Retrieve and translate mnemonic codes (like [b] [eb] to 
) before displaying as HTML
- Retrieve and use html_entity_decode() if needed for non-HTML use (like for
plain text email), or if I actually *WANT* to use stored HTML code (like for
HTML-formatted email)

TIA

--
Lowell Allen
--- End Message ---
--- Begin Message ---
Hi,

I have a Javascript that I like to use with PHP/MYSQL, But I don't know 
how to mix the two...




bName = navigator.appName;
bVer = parseInt(navigator.appVersion);

if ((bName == "Netscape" && bVer >= 3) ||

(bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "n3";

else br = "n2";

if (br == "n3") {

   boardNum = 0;
   boardSpeed = 4000;

   billboards = new Array();
   billboards[0] = new Image();
   billboards[0].src = "$x";
   billboards[1] = new Image();
   billboards[1].src = "$x";
   billboards[2] = new Image();
   billboards[2].src = "$x";
   billboards[3] = new Image();
   billboards[3].src = "$x";
   billboards[4] = new Image();
   billboards[4].src = "$x";
   billboards[5] = new Image();
   billboards[5].src = "$x";
   billboards[6] = new Image();
   billboards[6].src = "$x";
   billboards[7] = new Image();
   billboards[7].src = "$x";
   }

[I like to make $x to be called from the database...]

[PHP] How to find the Drive letters

2003-11-12 Thread D. Jame
hi,

How to find the Drive letters and Drive Types of remote system WNT, i have system 
administrator password too.. 
this all work done with PHP pages, when my client give IP, user /password then my 
PHP scirpt show him that system drive/ folders...

Plz help...

thnx





Re: [PHP] How to handle the POST data

2003-11-12 Thread Kim Steinhaug
"There are many solutions. My favorite:"

That is, my favourite aswell! :) Works like a charm, not to say
the benefits. You get all the processing detail inside 1 single file,
which makes development easier in my opinion.

Kim

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



Re: [PHP] problem with mssql_query

2003-11-12 Thread bob pilly
Thanks!

Cheers

Bob 

--- Jason Wong <[EMAIL PROTECTED]> wrote: > On
Tuesday 11 November 2003 23:07, bob pillford
> wrote:
> > Hi all i have the following code which isnt
> working correctly and i cant
> > work out why. Any help would be greatly
> appreciated as its sending me
> > crazy!
> >
> > $query = "select refno from campaign where appdate
> between 'nov 07 2003'
> > and 'nov 08 2003' ";
> $result=mssql_query($query,$numero);
> > $numrows=mssql_num_rows($result);
> > $row=mssql_fetch_row($result);
> > echo $numrows;
> > print_r($row);
> >
> >
> > Now this returns: 23
> > Array ( [0] => 1044998 )
> >
> > which is 23 for number of rows the query returns
> but it only ever stores
> > the 1st element of the returned array in $row..
> Can someone tell me where i
> > am going wrong as i need access to the other 22
> rows that this query
> > returns I have echoed the query and run the
> out put under freetds tsql
> > and get the correct result (this is what i use to
> access the ms sql server
> > 2000).
> 
> mssql_fetch_row() only gets *one* row. To get the
> rest use something like a 
> while-loop. For examples refer to the similar
> mysql_* functions.
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> You will pay for your sins.  If you have already
> paid, please disregard
> this message.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  


Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

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



Re: [PHP] imagejpeg

2003-11-12 Thread Jason Wong
On Wednesday 12 November 2003 00:34, Egil Berntsen wrote:
> My site need to create some images on-the-fly(with user data) for every
> user but I have some problem with the creating of the jpeg-image. I put
> these images in my MySQL database for later use. This have to do somthing
> with write protection because this is not a problem when I'm working on
> localhost. The problem comes on .com.
>
> I'm trying this:
> $image = imagecreate(100,100);
> {some drawing}
> $fname="filename.jpg";
> ImageJPEG($image, $fname);
> {database}
> ImageDestroy($image);
> unlink($filename);
>
> And get this:
> Warning: imagejpeg(): Unable to open 'filename.jpg' for writing in ...

If you're going to be storing it in the DB then there's no need to write to a 
file first. Use the output buffer controls (manual > Output Control 
Functions) to capture the output of imagejpeg($image) and insert into the DB 
(after appropriate sanitation).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You have taken yourself too seriously.
*/

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



[PHP] Re: Share Folder...

2003-11-12 Thread Kim Steinhaug
Do you mean like windows shared folders?

What do you mean ?

kim

"D. Jame" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

I have three machine 1, 2, 3. all online & have unique IP. one of them (no.
3) running web server which configured with PHP,
now my problem is
I want to show share directory on Web page to my users. when they enter IP
of machine 1 or  2...
anyone to know...plz help me..


jame

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



[PHP] Re: Delete Temporary Internet Files

2003-11-12 Thread Kim Steinhaug
Hmm..

This shouldnt be a problem from what I know. Though it woldt be a perfect
system,

all you would need to do, is have a script that does :

1: Read the IE cache directory and puts all the entries into an array (all
the files),
2: unlink all the files in the array.

This would in my opinion work nice, except that alot of the files you cant
delete
at a given time, just try doing it manually. But itll clean the most. I
wouldnt recommend
this way of doing it, but it should work.

As for other files on the windows system, just be sure that hey arnt write
protected, as
PHP cant unlink / delete them then.

Kim

"Joe Mack" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am trying to use PHP to delete temporary internet files in IE6.  I would
> also like to access other "Internet Options" functions.  Any assistance
> would be appreciated.
>
> Thanks.
>
> Joe

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



Re: [PHP] First test release of BTportal made!!!!

2003-11-12 Thread Jason Wong
On Tuesday 11 November 2003 20:11, Burhan Khalid wrote:
> Bas wrote:
> > It's avaiable on:
> >
> > http://members.home.nl/famde.jong/portalBT-0.0.1.zip
>
> Get your own list. php.general is not your personal announcement list.

I think there's some double standards here :-)

It seems to be generally acceptable to have PHP-related product announcements 
on the list.

The honest truth Bas, if you're reading this, is that announcements for 
heavyweight, respected products are OK on this list. For products like 
portalBT (and BTML), I don't think many (any?) people are interested.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Birthdays are like busses, never the number you want.
*/

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



Re: [PHP] Execute Background Process

2003-11-12 Thread Burhan Khalid
apur kurub ver.1 wrote:

dear all

i will execute background process like
$program &
is there posible in php to process that statement? and return to php
immediately;
http://www.php.net/system

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] shell_exec with pipes

2003-11-12 Thread Mario Ohnewald
Hi,

> $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");

$var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
/tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
echo "Output: $var";

Still gives nothing back :/
Told you, its not that easy :P


Thank you very much, Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



[PHP] Re: get method http 1.1 eror

2003-11-12 Thread QT
Thanks all very usefull


"Qt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear Sirs,
>
> I am using following method for GET but I am getting this error from
server;
>
> HTTP/1.1 505 HTTP Version Not Supported Content-Type: text/plain Date:
Tue,
> 11 Nov 2003 10:08:44 GMT Server: Apache Coyote/1.0 Connection: close
>
>  $fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30);
> if (!$fp) {
> echo "$errstr ($errno)\n";
> } else {
> fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n");
> while (!feof($fp)) {
> echo fgets ($fp,128);
> }
> fclose ($fp);
> }
> ?>What should I do? I can't find any solutionBest Regards
>

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



Re: [PHP] Help with scripts to add records to a database

2003-11-12 Thread Boyan Nedkov
Rolf Brusletto wrote:
Mark wrote:

Sorry guys, I have tried all the suggestions so far with no luck.

Regards,
Mark


Mark - After the mysql_query($query); line add the following line

echo mysql_error();

run the script and try to add something again, if there is an error, it 
will tell you via mysql_error(); echo it out to the browser, and get 
back to me :)


do the same with the variable $query - insert a line

echo $query

into your code just before the query execution and check carefully the query 
string returned by that line

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


[PHP] OOP clarification: Messages between objects

2003-11-12 Thread Robert Ian Smit
I am trying to implement a generic form handler that is capable of
printing the form and checking the user input.

I want this application to be useful in the end, but I also use it
to explore OOP in PHP.

The working code at the moment is able to add HTML input elements to
the page. These fields are all objects that get added to the Form
object. When the user submits, the Form object tells all elements to
check their input and create error messages if needed.

So far so good. One of the intended applications is to store
addresses submitted by visitors to our website. We have users from
two countries, with two different zip-code systems.

I could ofcourse create a double check in the zipcode-object, but
this would mean that it would be possible to submit a zipcode from
the other country without any objection by the application.

I'd like the zipcode object to ask a question to find out what
country we're dealing with and then apply the check of the input
depending on the answer.

Although these questions are specific to my application, I guess my
real question is more general. When you have a containerobject that
stores different kinds of elements, how do you give the elements the
ability to learn about their surroundings so they can alter their
behaviour? 

I know have:

$foo = new Form();
$foo->addToForm(new Element('country'));
$foo->addToForm(new Element('zipcode'));
$foo->processForm();


I hope I made clear what it is I am trying to do. Hopefully I'll
receive a few hints to help me on my way.

Thanks,
Bob

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



Re: [PHP] shell_exec with pipes

2003-11-12 Thread Jason Wong
On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote:

> > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
>
> $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
> echo "Output: $var";
>
> Still gives nothing back :/
> Told you, its not that easy :P

Have you:

1) Turned on full error reporting?
2) Checked that (i) you're not running in safe_mode, or (ii) if you are, that 
you are allowed to access those executables?
3) Confirmed that the left side of the pipe is working and giving the expected 
output?
4) Tried giving the full path to grep?

If you're still having trouble with it you can try sticking the above into a 
little shell script and shell_exec() the shell script instead.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Due to lack of disk space, this fortune database has been discontinued.
*/

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



Re: [PHP] Unique ID

2003-11-12 Thread Marek Kilimajer
Javier Muniz wrote:
Neither auto-increment nor sequences allow you to do what you're asking for
though, which is like database garbage collection.  If you really need
something like this you should implement it in a cron job that runs during
non-peak hours as it will be quite an expensive operation on a large table
(the best way I can think of would be to iterate over all table rows and
look for "gaps" in the table, and for each gap take the record with the
highest ID and change the ID to fill the gap, then update all replys to
match the new ID, after everything is finished reset the sequence to the
highest id in the modified table and you're done).
I would not care about removing old posts. Good archive is always good :)

I don't know what you mean that your database could get huge, in my 
understanding that means millions of post per week.

Note from the MySQL manual for you auto_increment fans out there:

Posted by Jim Martin on Tuesday October 1 2002, @11:57am  

Just in case there's any question, the
AUTO_INCREMENT field /DOES NOT WRAP/. Once you
hit the limit for the field size, INSERTs generate
an error. (As per Jeremy Cole)
That is I will be able to insert only 4294967295 rows if the 
auto_increment is UNSIGNED INT. :( I guess I'll start to use UNSIGNED 
BIGINT, that will give me 18446744073709551615 rows, that ought to be 
enough for anybody. ;)

Marek

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


Re: [PHP] Can sudo be used for apache

2003-11-12 Thread David T-G
Tirumal --

...and then tirumal b said...
% 
% hello All,

Hi!


% 
%   Can i use sudo to assign certain privileges for the
% apache account as the webserver is running on that
% account. Will it be possible.

Yep.  Be careful!


% 
% Thank you

You're welcome!


% 
% Tirumal 


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Pausing in PHP

2003-11-12 Thread Nathan Taylor
sleep() should do what you need.

www.php.net/sleep

Regards,
Nathan
  - Original Message - 
  From: Donpro 
  To: php list 
  Sent: Monday, November 10, 2003 12:49 PM
  Subject: [PHP] Pausing in PHP


  Hi,
   
  Is there a PHP function that would allow the script execution to pause 'N'
  seconds?  This is analogous to the dBase inkey() function.
   
  Thanks,
  Don

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



[PHP] PHP5 interfaces

2003-11-12 Thread William Bailey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all,

I am currently starting a new personal project and thought that i would
start to implement it in PHP5. Now the new object model in PHP5 is
really nice and haveing objects bassed by reference by default saves a
lot of head aches :)
My question however probably comes from my lack of OO understanding.
Lets say i have the following class:
Final class Statistic {
~function __construct ($min, $max, $initValue=0) {
~}
~public function setValue ($value, $strict = false) {
~}
~public function applyDelta ($delta, $strict = false) {
~}
~public function getValue () {
~}
}
I want to implement some kind of onChange function and from what  i can
see that i have 2 options:
1. Create an OnChange object and make Statistic a child class.
2. Create an OnCHange interface and make Statistic implement it.
The problem is that nither are fully what i'm after. I want to be able
to use the onChange functionality on a number of other classes (all
implemented in the same way) and i also want to create a few other
onBlah functions that i also want to apply to objects along side if
required the onChange functionality.
So from this i can see that an interface would be the best way to go as
a class can implement any number of interfaces but can only be extend
from one parent. However using the example given all the onChange
functions for each object function exactly the same and will therefore
give me a lot of repeated code.
Is there any way to get around this. Something like an interface with a
fully defined function is what i'm really after.
The onChange function is currently...

~public function onChange ($object=null, $method=null) {
~if($object == null){
~$method = null;
~}
~if($object != null && !is_object($object)){
~$this->onChange();
~}else{
~$this->onChangeObject = $object;
~$this->onChangeMethod = $method;
~}
~}
- --
Regards,
William Bailey.
Pro-Net Internet Services Ltd.
http://www.pro-net.co.uk/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/shN6zSfrYDJMXmERAhv6AJ9a9D6D7C295Skefsi8HtInDiq9AgCgvLUa
DZiQJni5w0VqZOjfOdQ1xhc=
=b6B3
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP5 interfaces

2003-11-12 Thread William Bailey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all,

I am currently starting a new personal project and thought that i would
start to implement it in PHP5. Now the new object model in PHP5 is
really nice and haveing objects bassed by reference by default saves a
lot of head aches :)
My question however probably comes from my lack of OO understanding.
Lets say i have the following class:
Final class Statistic {
~function __construct ($min, $max, $initValue=0) {
~}
~public function setValue ($value, $strict = false) {
~}
~public function applyDelta ($delta, $strict = false) {
~}
~public function getValue () {
~}
}
I want to implement some kind of onChange function and from what  i can
see that i have 2 options:
1. Create an OnChange object and make Statistic a child class.
2. Create an OnCHange interface and make Statistic implement it.
The problem is that nither are fully what i'm after. I want to be able
to use the onChange functionality on a number of other classes (all
implemented in the same way) and i also want to create a few other
onBlah functions that i also want to apply to objects along side if
required the onChange functionality.
So from this i can see that an interface would be the best way to go as
a class can implement any number of interfaces but can only be extend
from one parent. However using the example given all the onChange
functions for each object function exactly the same and will therefore
give me a lot of repeated code.
Is there any way to get around this. Something like an interface with a
fully defined function is what i'm really after.
The onChange function is currently...

~public function onChange ($object=null, $method=null) {
~if($object == null){
~$method = null;
~}
~if($object != null && !is_object($object)){
~$this->onChange();
~}else{
~$this->onChangeObject = $object;
~$this->onChangeMethod = $method;
~}
~}
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/shU0zSfrYDJMXmERAr8OAJ9L1lQ5VUkNuHTJLP7jUpHAtSWheQCdF12b
XYoWdVBKzf4eYF3cBaKRamk=
=n8KJ
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Share Folder...

2003-11-12 Thread Kim Steinhaug
You wrote in email :
> How to find the Drive letters and Drive Types of remote system WNT, i have
> system administrator password too..
> this all work done by PHP, when my client give IP, user /password then
> my PHP scirpt show him  system drive/ folders... how it possible 
>
>
> Plz help...
>
> thnx

Using the EXEC command and parsing the output from this, it should be
possible given
the fact that your internal network has opened up for filesharing, and U are
running
win2000, you then have access to the tools that hackers love to use, but in
Ur case solves
the problem. By issuing this command into EXEC and pulling the output, and
the IP is
the name of the machine your locating, youll get what U want.

nbtstat -a 1.2.3.4

This will tell you the share names of that computer, and you will be able to
know the
names of the shared drives to access. This would have to be done to all the
IPs in
order to gain access to all the shares.

After this you have to parse each line from the output, and look for the
<20> folders,
which indicate an open share. Be aware that you should not open for this
type of
networking outbound to the internet, as hackers easilly can access your
machines as well.
I preferr installing 2 network cards in the machine, one for local network
and 1 for internet,
where the internet network card is blocked for NETBIOS over TCP/IP, and the
local
network connection is opened. If U only have 1 network card in each machine,
I suggest
U get a router with hardware firewall, where U insert the internet
connection directly into the
router, this will prevent NETBIOS over TCP/IP from the Internet.

Kim


>> Do you mean like windows shared folders?
>>
>> What do you mean ?
>>
>> kim
>>
> Hi,
>
> I have three machine 1, 2, 3. all online & have unique IP. one of them
(no.
> 3) running web server which configured with PHP,
> now my problem is
> I want to show share directory on Web page to my users. when they enter IP
> of machine 1 or  2...
> anyone to know...plz help me..
>
>
> jame

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



[PHP] Re: How to find the Drive letters

2003-11-12 Thread Kim Steinhaug
Check my reply under "Share folder".

>From what I know you cant get hold of the accuall drive letter on a remote
machine without hacking it,
and therefore my short answer will be that U cant do it. U can get the
shares, and access them as
explained in the other post -> but not the physical drive letters.

Kim

"D. Jame" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
hi,

How to find the Drive letters and Drive Types of remote system WNT, i have
system administrator password too..
this all work done with PHP pages, when my client give IP, user
/password then my PHP scirpt show him that system drive/ folders...

Plz help...

thnx

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



Re: [PHP] Help with scripts to add records to a database

2003-11-12 Thread Kim Steinhaug
Important to mention, that the reason why the

$variable

probably doesnt work is that your service provider
has turned off the globals. In this case you would need,
as Zhuravlev mentions, use $_POST["variable"] to
insert the records. All in all, since the factory setting in
the new versions of PHP are Globals off, using POST
and GET is much better practise, so just start using it, :)

And ofcourse :
If U are using GET method in your form, then you use
the $_GET["variable"] instead.

You probably also know, that the way U are writing your
code isnt very handy in the long run, if you alter your
database you will need to recode all the pages that inserts
anything. You probably know the names of your table, so
I would recommend you do this instead :

Say the table is like this, and to quicken my typing I
assume globals is on, :)

id
first
last
phone

You would write :
insert into contacts values ('','$first','$last','$phpne');

You should write this :
insert into contacts (first,last,phone) VALUES ('$first','$last','$phone');

WHY?
If you alter your table, insert a new row or remove
one, your example will fail mySQL and result in an
error since the query doesnt match the table. In my
example it will have no difference, aslong as first,last
and phone are still in the table. The autoincrement
value will still be updated as intended, aslong as the
table is correctly formatted (and it is, since your first
example works).

Kim





"Zhuravlev Alexander" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, Nov 11, 2003 at 07:44:58PM -0800, Mark wrote:
> > I am following the tutorial at
> > http://www.freewebmasterhelp.com/tutorials/phpmysql/
> > The source code is on the website on the left hand side
> > http://www.freewebmasterhelp.com/static/tutorials/phpmysql/example.zip
> >
> >
> > My software:
> > PHP version 4.3.4 on Windows 2000
> > MYSQL version 4.0.16 on Windows 2000
> > Apache version 1.3.29 on Windows 2000
> >
> > The problem is I cannot get the database to add a new records aside from
> > the auto-increment field. All the other fields are left blank when the
> > add.html is subitted.
> >
> > I have the add.html with the following code exactly the same as the
> > source code.
> >
> > 
> > First Name: 
> > Last Name: 
> > Phone: 
> > Mobile: 
> > Fax: 
> > E-mail: 
> > Web: 
> > 
> > 
> >
> >
> > The insert.php
> >  > include("dbinfo.inc.php");
> > mysql_connect(localhost,$username,$password);
> > @mysql_select_db($database) or die( "Unable to select database");
> >
> > $query = "INSERT INTO contacts VALUES
> > ('','$first','$last','$phone','$mobile','$fax','$email','$web')";
>
> http://ru3.php.net/manual/en/security.registerglobals.php
>
> try
> $query = "insert into contacts values
('',".$_POST['first'].",".$_POST['last'].",".$_POST['phone'].",".$_POST['mob
ile'],",".$_POST['fax'].",".$_POST['email'].",".$_POST['web'].")";
>
> and so on ...
>
> > mysql_query($query);
> >
> > mysql_close();
> > ?>
> >
> >
> >
> > Any help would be much appreciated.
> >
> > Regards,
> > Mark
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>  -- zhuravlev alexander
>u l s t u  n o c
>  ([EMAIL PROTECTED])

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



[PHP] PHP5 interfaces

2003-11-12 Thread William Bailey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all,

I am currently starting a new personal project and thought that i would
start to implement it in PHP5. Now the new object model in PHP5 is
really nice and haveing objects bassed by reference by default saves a
lot of head aches :)
My question however probably comes from my lack of OO understanding.
Lets say i have the following class:
Final class Statistic {
~function __construct ($min, $max, $initValue=0) {
~}
~public function setValue ($value, $strict = false) {
~}
~public function applyDelta ($delta, $strict = false) {
~}
~public function getValue () {
~}
}
I want to implement some kind of onChange function and from what  i can
see that i have 2 options:
1. Create an OnChange object and make Statistic a child class.
2. Create an OnCHange interface and make Statistic implement it.
The problem is that nither are fully what i'm after. I want to be able
to use the onChange functionality on a number of other classes (all
implemented in the same way) and i also want to create a few other
onBlah functions that i also want to apply to objects along side if
required the onChange functionality.
So from this i can see that an interface would be the best way to go as
a class can implement any number of interfaces but can only be extend
from one parent. However using the example given all the onChange
functions for each object function exactly the same and will therefore
give me a lot of repeated code.
Is there any way to get around this. Something like an interface with a
fully defined function is what i'm really after.
The onChange function is currently...

~public function onChange ($object=null, $method=null) {
~if($object == null){
~$method = null;
~}
~if($object != null && !is_object($object)){
~$this->onChange();
~}else{
~$this->onChangeObject = $object;
~$this->onChangeMethod = $method;
~}
~}
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/shpezSfrYDJMXmERAoQlAJ9VpDbsy85ID6gvdQ1WP2qN92NXYgCeOx4l
Ncl/xFGmYVvmftXRIgLbrew=
=tcFs
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: sorting files by date

2003-11-12 Thread Kim Steinhaug
U wouldnt need to timestamp it, split the filename insert into 2 dimensional
array,
and use the sort() command and you have it.

Se examples her, theres also examples of sorting into more levels, meaning
you
can sort first by date, then by filename aslong as you do your splitting
right, :)

http://se.php.net/sort

Kim

"Justin French" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have a dir of files saved in the following format: -MM-DD.mp4.  I
> know how to get the file names into an array, but I don't know how to
> sort the array so that the files appear in date order.  My guess was to
> use strtotime() to get the date into a timestamp, then sort on the
> timestamp, but there MUST be an easier way :)
>
> I've read through most of the array part of the manual, but can't see
> what I need.
>
>
> Justin

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



[PHP] Re: Time problem

2003-11-12 Thread Kim Steinhaug
Well,

If your into your programming, have a look at this one :
http://www.phpclasses.org/browse.html/package/1199.html

It does something else, but the same approach can be used to
format your readable dates. This wheel has surely been invented
already, so you probably should do some googling to find a
finnished class og function that does this for you.

Kim

"Erin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All,
> Sorry if this has been asked a 1000 times and if its easy to find in
the
> php manual but i cant seam to solve this.
>
> How do i convert a timestamp in to a normal readable time & date ie
>
> 2003155023
>
> into
>
> 11th November 2003 @ 15:50:23
>
>
> Many thanks, thought id ask someone is bound to have a snippet for this.
>
>
>
> Regards
>
> All
>
>
>
> Erin

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



RE: [PHP] First test release of BTportal made!!!!

2003-11-12 Thread Jay Blanchard
[snip]
The honest truth Bas, if you're reading this, is that announcements for 
heavyweight, respected products are OK on this list. For products like 
portalBT (and BTML), I don't think many (any?) people are interested.
[/snip]

Or he could put [ANNOUNCE] in the subject line. Seems there was a
request some time ago ...

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



[PHP] newbie question about scope

2003-11-12 Thread news.comcast.giganews.com
I am an experienced web developer who is just getting into php.  I have had
a php project fall into my lap and wanted a little advice.  Here is the
scoop:

A client moved their site from a server (unknown details) to a hosting
facility (php 4.3.2).  Now none of the scripts work.  I have guessed that
they are coming from an earlier version of apache/php.  Anyway it appears
that whoever created the site in the first place did not believe in scoping
variables.  Now any variable that is not properly scoped will not be read by
the server.  I know I can simply scope all of the variables, but I was
hoping there may be an easier way.  Also, how bad is the _REQUEST scope I
read that "it could not be trusted", however the previous developer created
the app in such a way that several places a variable could be _GET or _POST.
I apologize for the rambling and possible incoherency of this message, I am
a bit tired.

Matthew

PS. How do you scope queries?

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



Re: [PHP] newbie question about scope

2003-11-12 Thread Derek Ford
news.comcast.giganews.com wrote:

I am an experienced web developer who is just getting into php.  I have had
a php project fall into my lap and wanted a little advice.  Here is the
scoop:
   A client moved their site from a server (unknown details) to a hosting
facility (php 4.3.2).  Now none of the scripts work.  I have guessed that
they are coming from an earlier version of apache/php.  Anyway it appears
that whoever created the site in the first place did not believe in scoping
variables.  Now any variable that is not properly scoped will not be read by
the server.  I know I can simply scope all of the variables, but I was
hoping there may be an easier way.  Also, how bad is the _REQUEST scope I
read that "it could not be trusted", however the previous developer created
the app in such a way that several places a variable could be _GET or _POST.
I apologize for the rambling and possible incoherency of this message, I am
a bit tired.
Matthew

PS. How do you scope queries?

 

You're thinking about this in the wrong way, it seems. The server 
probably has register_globals Off, where previously he was programming 
with it being On. or vise-versa. They should be Off, and should be left 
off, but programming with them off needs some adjusting. Variables such 
as post and get data are now 'superglobals', and must use the 
appropriate arrays; $_GET[], and $_POST[]. There are things like 
extract(), but using them is not advised. as per your question about 
"scope queries", be more concrete :)

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


RE: [PHP] newbie question about scope

2003-11-12 Thread Jay Blanchard
[snip]
A client moved their site from a server (unknown details) to a
hosting
facility (php 4.3.2).  Now none of the scripts work.  I have guessed
that
they are coming from an earlier version of apache/php.
[/snip]

It is likely then that register_globals is set to OFF in the php.ini. In
earlier versions this directive was set to ON. It was a "security issue"
that was more about bad coding than a PHP vulnerability. If you passed a
form field with the name of userName it could be accessed by PHP in the
$userName variable, with RG off you would have to access it via
$_GET['userName'] or $_POST['userName'] dependent upon the processing
method of the form.

[snip]
Also, how bad is the _REQUEST scope I read that "it could not be
trusted"
[/snip]

Again, bad coding would present a danger here.

[snip]
PS. How do you scope queries?
[/snip]

I am not sure what you are asking here. Do you mean making a query
public or private?

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



[PHP] Re: newbie question about scope

2003-11-12 Thread pete M
things to check..
check the register_globals flag in php.ini - you can also set this using 
ini_set()

Check the short_open_tags are either on/off - again this chan be changes 
in ini_set()

pete

News.Comcast.Giganews.Com wrote:

I am an experienced web developer who is just getting into php.  I have had
a php project fall into my lap and wanted a little advice.  Here is the
scoop:
A client moved their site from a server (unknown details) to a hosting
facility (php 4.3.2).  Now none of the scripts work.  I have guessed that
they are coming from an earlier version of apache/php.  Anyway it appears
that whoever created the site in the first place did not believe in scoping
variables.  Now any variable that is not properly scoped will not be read by
the server.  I know I can simply scope all of the variables, but I was
hoping there may be an easier way.  Also, how bad is the _REQUEST scope I
read that "it could not be trusted", however the previous developer created
the app in such a way that several places a variable could be _GET or _POST.
I apologize for the rambling and possible incoherency of this message, I am
a bit tired.
Matthew

PS. How do you scope queries?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mssql_bind() couldn't process string parameter longer than 254 characters

2003-11-12 Thread Miroslav I.

Hi, people

- the first time in the list,
- subscribed only for few minutes and already have 7 messages :-) this is
promising!!



#The problem:
mssql_bind() (PHP Version 4.3.2-RC) couldn't pass string parameter longer
than 254 characters to the stored procedure (MSSQL2000 server)

##Is there a way to call stored procedure ( from PHP ) with long string
parameters?



###Additional:
- Warnings and PHP code lines related:
Warning: mssql_bind(): Unable to set parameter in
E:\Intranet\webtreb.fresh.co.yu\connections\insert_treb.php on line 59
< line 59: mssql_bind($kveri, "@item_treb1", $item_treb1, SQLVARCHAR, FALSE,
FALSE, 255); >

Warning: mssql_execute(): message: Procedure 'sp_tr_InsertTrebIDetails'
expects parameter '@item_treb1', which was not supplied. (severity 16) in
E:\Intranet\webtreb.fresh.co.yu\connections\insert_treb.php on line 70
Warning: mssql_execute(): stored procedure execution failed in
E:\Intranet\webtreb.fresh.co.yu\connections\insert_treb.php on line 70
< line 70: $result = mssql_execute($kveri); >

- PHP Manual (2003-09-06):
"There is a bug in MSSQL Client Libraries that avoid sending varchar
parameters for more than 255 characters to a stored procedure.Use
mssql_query instead."

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



RE: [PHP] mssql_bind() couldn't process string parameter longer than 254 characters

2003-11-12 Thread Jay Blanchard
[snip]
##Is there a way to call stored procedure ( from PHP ) with long string
parameters?

"There is a bug in MSSQL Client Libraries that avoid sending varchar
parameters for more than 255 characters to a stored procedure.Use
mssql_query instead."
[/snip]

You already answered your own question :) In this case it probably means
stroing the entire SP as PHP script and running it from there.

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



[PHP] Show total records based on criteria

2003-11-12 Thread Tim Winters
Hello,
 
Sorry for the probably newbie question.
 
Is there a way to show the number of records in a recordset based on a
specific criteria?
 
For example, if I create a record set of all male employees regardless
of eye color and then I want to create a table showing the totals of
people of each eye color.  Is there a way to do this with out creating
several different recordsets.
 
Thanks!!
 
 
 
Tim Winters
Creative Development Manager
Sampling Technologies Incorporated
 
1600 Bedford Highway, Suite 212
Bedford, Nova Scotia
B4A 1E8
www.samplingtechnologies.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Office: 902 450 5500
Cell: 902 430 8498
Fax:: 902 484 7115
 


RE: [PHP] Show total records based on criteria

2003-11-12 Thread Jay Blanchard
[snip]
For example, if I create a record set of all male employees regardless
of eye color and then I want to create a table showing the totals of
people of each eye color.  Is there a way to do this with out creating
several different recordsets.
[/snip]

Yes, you handle it in the query;

$sql = "SELECT COUNT(eyeColor) AS colorCount, eyeColor FROM theTable
WHERE sex = 'male' GROUP BY eyeColor ";

You can also do a cross-tab query;

$sql = "SELECT eyeColor, ";
$sql .= "SUM(IF(sex = 'male', 1, 0)) AS Guys, ";
$sql .= "SUM(IF(sex = 'female', 1, 0)) AS Gals ";
$sql .= "FROM theTable ";
$sql .= "GROUP BY eyeColor ";

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



[PHP] multiple table rows into an array, and creating a calendar

2003-11-12 Thread Dave G
PHP Gurus,
I have a database of events which happen on various dates. I've
set up a query to select all the dates within the current month. I've
got a calendar which shows one month at a time, as a table, on which to
display the relevant dates as links.
My problem is that I can't figure out how to compare the results
of the query to the dates on the calendar so that they display on the
right dates.
I thought I should put those date in an array and then on each
date, search that array for a matching date, and if it's found, then
display a link on that date. But my first obstacle was getting the
results of my query into an array.
I first thought I could just use mysql_fetch_array(), but I am
obviously mistaken. According to php.net, that will make an array out of
the columns in the currently selected row. But I want to make an array
out of *all* the rows I have. Each row has only one entry, the date.
I'm looking through all the mysql_* commands that are listed on
the left side of the page, and I don't see any commands that do that.
Surely this kind of action is common enough to merit having it's own
command...?
As I read further, I wonder if my plan is flawed. I thought
mysql_data_seek would search the array based on my criteria, and then
return true or false. But what it says on php.net is very confusing for
me, so I have to admit I'm not sure what it does at all.

I guess what I really am asking is, what is the most efficient
way for me to compare the dates on the calendar with the dates in my
database and display matches as links.
I mean, I could put my mysql_query command in the while loop
that renders the calendar, and search for matching dates that way. But
that means searching the whole database table roughly 30 times each time
the page is accessed, and that can't be right. I'm sure this is better
handled with arrays, but I can't quite figure out the logic and the
commands.
Can anyone help me out with this?

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



Re: [PHP] shell_exec with pipes

2003-11-12 Thread Mario Ohnewald
ok, i am running the script like this now:
 START -

$var=shell_exec("/home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh 
/tmp/pitstop.mpeg");
echo "--$var--";
 STOP -
Where echo returns nothing. I did a chmod 777 on the getfilelength.sh file.


When i run the file in shell i get this:
$ /home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh
/tmp/pitstop.mpeg
16


The Shell file looks like that:
if [ "$1" ];then
length="`mplayer -identify -frames 0 $1 2>/dev/null| grep ID_LENGTH
| cut -d \"=\" -f 2`"
echo $length





> On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote:
> 
> > > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> > > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
> >
> > $var=shell_exec("/usr/local/bin/mplayer -identify -frames 0
> > /tmp/pitstop.mpeg 2>/dev/null | grep ID_LENGTH | cut -d \"=\" -f 2");
> > echo "Output: $var";
> >
> > Still gives nothing back :/
> > Told you, its not that easy :P
> 
> Have you:
> 
> 1) Turned on full error reporting?
How do i turn that on?

> 2) Checked that (i) you're not running in safe_mode, or (ii) if you are,
> that 
> you are allowed to access those executables?
i am running in safe mode.

> 3) Confirmed that the left side of the pipe is working and giving the
> expected 
> output?
$var2=shell_exec("mplayer -identify -frames 0 /tmp/pitstop.mpeg | /bin/grep
ID_LENGTH");
gives nothing back.

Thats what i get in Shell:
-
$ mplayer -identify -frames 0 /tmp/pitstop.mpeg | grep ID_LENGTH
: No such file or directory
Can't open '/home/lansinplayer/.mplayer/codecs.conf': No such file or
directory
Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or
/dev/rtc should be readable by the user.)
Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such
file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file
or directory
Falling back on default (hardcoded) input config
vo: couldn't open the X11 display ()!
vo: couldn't open the X11 display ()!
VO XOverlay need a subdriver
vo: couldn't open the X11 display ()!
Can't open /dev/fb0: Permission denied
[fbdev2] Can't open /dev/fb0: Permission denied
audio_setup: Can't open audio device /dev/dsp: Permission denied
ID_LENGTH=16



> 4) Tried giving the full path to grep?
yes i did
> 
> If you're still having trouble with it you can try sticking the above into
> a 
> little shell script and shell_exec() the shell script instead.
See above.


Any further ideas?

Thank you, Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



[PHP] Re: Show total records based on criteria

2003-11-12 Thread pete M
Tim Winters wrote:

select EyeColor, count(eyeColor) from males
group by eyecolor
;-)


Hello,
 
Sorry for the probably newbie question.
 
Is there a way to show the number of records in a recordset based on a
specific criteria?
 
For example, if I create a record set of all male employees regardless
of eye color and then I want to create a table showing the totals of
people of each eye color.  Is there a way to do this with out creating
several different recordsets.
 
Thanks!!
 
 
 
Tim Winters
Creative Development Manager
Sampling Technologies Incorporated
 
1600 Bedford Highway, Suite 212
Bedford, Nova Scotia
B4A 1E8
www.samplingtechnologies.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Office: 902 450 5500
Cell: 902 430 8498
Fax:: 902 484 7115
 

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


RE: [PHP] Show total records based on criteria

2003-11-12 Thread Jay Blanchard
[snip]
Another newbie question but how do I get the info out of a query when I
do a group by? How is it presented to me?

Would you mind taking your example 1 step farther and show me how I
would echo, say, the total of blue eyed people?

$sql = "SELECT COUNT(eyeColor) AS colorCount, eyeColor FROM theTable
WHERE sex = 'male' GROUP BY eyeColor ";

$sql = "SELECT eyeColor, ";
$sql .= "SUM(IF(sex = 'male', 1, 0)) AS Guys, ";
$sql .= "SUM(IF(sex = 'female', 1, 0)) AS Gals ";
$sql .= "FROM theTable ";
$sql .= "GROUP BY eyeColor ";
[/snip]

Let's pretend we are using MySQL (and the AS in the query is very
important) and we are displaying in a web page, I'll show some error
checking etc.;

$sql = "SELECT COUNT(eyeColor) AS colorCount, eyeColor FROM theTable
WHERE sex = 'male' GROUP BY eyeColor ";
/*do the query and check for problems*/
if(!($db = mysql_query($sql, $connectionString))){
echo "MySQL Error: " . mysql_error() . "\n";
exit();
}

Assuming no errors I would then do this;

while($result = mysql_fetch_object($db)){
echo "We have " . $result->colorCount . "guys with " .
$result->eyeColor . "eyes!\n";
}

If you want blue eyes only you would handle that in the query;

SELECT COUNT(eyeColor) FROM theTable WHERE sex = 'male' AND eyeColor =
'blue'

And if your are returning one row ...

$result = mysql_fetch_object($db); // no while loop
echo "We have " . $result->colorCount . "guys with " . $result->eyeColor
. "eyes!\n";

Tim there are several excellent tutorials (Google for PHP tutorial) that
walk you through step by step. 

P.S. when replying to a response on the list make sure to reply to all
so that your message gets returned to the list in the event the original
respondent is not available to reply to your response. 

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



RE: [PHP] Show total records based on criteria

2003-11-12 Thread Jay Blanchard
[snip]
If you want blue eyes only you would handle that in the query;

SELECT COUNT(eyeColor) FROM theTable WHERE sex = 'male' AND eyeColor =
'blue'

And if your are returning one row ...

$result = mysql_fetch_object($db); // no while loop
echo "We have " . $result->colorCount . "guys with " . $result->eyeColor
. "eyes!\n";
[/snip]

Dang early morning typos --

SELECT COUNT(eyeColor) AS colorCount FROM theTable WHERE sex = 'male'
AND eyeColor =
'blue'

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



Re: [PHP] newbie question about scope

2003-11-12 Thread news.comcast.giganews.com

"Derek Ford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> news.comcast.giganews.com wrote:
>
> >I am an experienced web developer who is just getting into php.  I have
had
> >a php project fall into my lap and wanted a little advice.  Here is the
> >scoop:
> >
> >A client moved their site from a server (unknown details) to a
hosting
> >facility (php 4.3.2).  Now none of the scripts work.  I have guessed that
> >they are coming from an earlier version of apache/php.  Anyway it appears
> >that whoever created the site in the first place did not believe in
scoping
> >variables.  Now any variable that is not properly scoped will not be read
by
> >the server.  I know I can simply scope all of the variables, but I was
> >hoping there may be an easier way.  Also, how bad is the _REQUEST scope I
> >read that "it could not be trusted", however the previous developer
created
> >the app in such a way that several places a variable could be _GET or
_POST.
> >I apologize for the rambling and possible incoherency of this message, I
am
> >a bit tired.
> >
> >Matthew
> >
> >PS. How do you scope queries?
> >
> >
> >
> You're thinking about this in the wrong way, it seems. The server
> probably has register_globals Off, where previously he was programming
> with it being On. or vise-versa. They should be Off, and should be left
> off, but programming with them off needs some adjusting. Variables such
> as post and get data are now 'superglobals', and must use the
> appropriate arrays; $_GET[], and $_POST[]. There are things like
> extract(), but using them is not advised. as per your question about
> "scope queries", be more concrete :)

I agree that is the way it should be, but my client is looking for a quick
fix, not a good one.  In the end it is fortunate for my client that the
quick fix is not a viable one.  I agree that all variables should be scoped,
it is the right way to do things.  I think I have my query question figured
out.

Thanks

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



Re: [PHP] Re: Delete Temporary Internet Files

2003-11-12 Thread Mark

--- Kim Steinhaug <[EMAIL PROTECTED]> wrote:
> Hmm..
> 
> This shouldnt be a problem from what I know. Though it woldt be a
> perfect
> system,
> 
> all you would need to do, is have a script that does :
> 
> 1: Read the IE cache directory and puts all the entries into an
> array (all
> the files),

How do you propose to read the files from the client? You can read
any files you like (and have permission to) on the server, but you
can't read the client files with PHP.

> 2: unlink all the files in the array.
> 

Just as you can't read files on a client, you can't unlink a file on
a client with PHP either. unlink() works on files on the server, not
a client.

> This would in my opinion work nice, except that alot of the files
> you cant
> delete
> at a given time, just try doing it manually. But itll clean the
> most. I
> wouldnt recommend
> this way of doing it, but it should work.
> 
> As for other files on the windows system, just be sure that hey
> arnt write
> protected, as
> PHP cant unlink / delete them then.
> 
> Kim
> 
> "Joe Mack" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I am trying to use PHP to delete temporary internet files in IE6.
>  I would
> > also like to access other "Internet Options" functions.  Any
> assistance
> > would be appreciated.
> >
> > Thanks.
> >
> > Joe
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



[PHP] Somewhat-OT: Notation style

2003-11-12 Thread Chris Boget
What is the name of the notation that has variable names
prefixed with the first letter of the type of the variable?  eg.

int iVar;
float fVar;
string sVar;

thnx,
Chris

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



RE: [PHP] Somewhat-OT: Notation style

2003-11-12 Thread Jay Blanchard
[snip]
What is the name of the notation that has variable names
prefixed with the first letter of the type of the variable?  eg.
[/snip]

Hungarian notation

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



Re: [PHP] Somewhat-OT: Notation style

2003-11-12 Thread Chris Shiflett
--- Chris Boget <[EMAIL PROTECTED]> wrote:
> What is the name of the notation that has variable names
> prefixed with the first letter of the type of the variable?  eg.
> 
> int iVar;
> float fVar;
> string sVar;

I believe that's called Hungarian notation. I might be wrong, though.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] imagejpeg

2003-11-12 Thread Egil Berntsen
Thanks.
This is exactly what I needed. Never save the file, just put it into the db.

egil

- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 12, 2003 9:17 AM
Subject: Re: [PHP] imagejpeg


> On Wednesday 12 November 2003 00:34, Egil Berntsen wrote:
> > My site need to create some images on-the-fly(with user data) for every
> > user but I have some problem with the creating of the jpeg-image. I put
> > these images in my MySQL database for later use. This have to do
somthing
> > with write protection because this is not a problem when I'm working on
> > localhost. The problem comes on .com.
> >
> > I'm trying this:
> > $image = imagecreate(100,100);
> > {some drawing}
> > $fname="filename.jpg";
> > ImageJPEG($image, $fname);
> > {database}
> > ImageDestroy($image);
> > unlink($filename);
> >
> > And get this:
> > Warning: imagejpeg(): Unable to open 'filename.jpg' for writing in ...
>
> If you're going to be storing it in the DB then there's no need to write
to a
> file first. Use the output buffer controls (manual > Output Control
> Functions) to capture the output of imagejpeg($image) and insert into the
DB
> (after appropriate sanitation).
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> You have taken yourself too seriously.
> */

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



Re: [PHP] multiple table rows into an array, and creating a calendar

2003-11-12 Thread Burhan Khalid
Dave G wrote:
PHP Gurus,
Why hello young pedawan

I guess what I really am asking is, what is the most efficient
way for me to compare the dates on the calendar with the dates in my
database and display matches as links.
If you have an array of dates (events) -- and you want to create a 
calendar where the dates on the calendar are highlighted ... why don't 
you do an in_array() check for each date that you print.

if (in_array($current_cal_date, $array_of_event_dates))
{
   echo "".$current_cal_date."";
}
Hope this helps.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Delete Temporary Internet Files

2003-11-12 Thread Kim Steinhaug
The original question didnt consert the OS, or where the user was at.
Concerning cleaning the IE directory I would assume that he's installed
PHP and IIS / Apache on his local machine.

Using a webpage online on the internet to fix your local machine doesnt
sound logical to me, therefore I assume local innstallation on local
machine.

And when your on your local machine there are no problems accessing your
files,
even if they belong to the windows environment. Overwriting them can be
problematic at times, since processed may use the file.

Kim

"Mark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> --- Kim Steinhaug <[EMAIL PROTECTED]> wrote:
> > Hmm..
> >
> > This shouldnt be a problem from what I know. Though it woldt be a
> > perfect
> > system,
> >
> > all you would need to do, is have a script that does :
> >
> > 1: Read the IE cache directory and puts all the entries into an
> > array (all
> > the files),
>
> How do you propose to read the files from the client? You can read
> any files you like (and have permission to) on the server, but you
> can't read the client files with PHP.
>
> > 2: unlink all the files in the array.
> >
>
> Just as you can't read files on a client, you can't unlink a file on
> a client with PHP either. unlink() works on files on the server, not
> a client.
>
> > This would in my opinion work nice, except that alot of the files
> > you cant
> > delete
> > at a given time, just try doing it manually. But itll clean the
> > most. I
> > wouldnt recommend
> > this way of doing it, but it should work.
> >
> > As for other files on the windows system, just be sure that hey
> > arnt write
> > protected, as
> > PHP cant unlink / delete them then.
> >
> > Kim
> >
> > "Joe Mack" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I am trying to use PHP to delete temporary internet files in IE6.
> >  I would
> > > also like to access other "Internet Options" functions.  Any
> > assistance
> > > would be appreciated.
> > >
> > > Thanks.
> > >
> > > Joe
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> =
> Mark Weinstock
> [EMAIL PROTECTED]
> ***
> You can't demand something as a "right" unless you are willing to fight to
death to defend everyone else's right to the same thing.
> ***
>
> __
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree

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



[PHP] ignoring case

2003-11-12 Thread Adam Williams
Hi,

does anyone happen to know off hand the function that will ignore case for 
data inputted via text from a ?  I don't remember it off hand 
and can't find it in the function list on php.net.  Basically it changes 
the text in the string from a character to [a-Z] for each character.  I 
know it exists because i've used it before.  Any help?  Thanks

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



[PHP] New Orleans PHP Users Group

2003-11-12 Thread John Nichel
   With all the talk about local php user groups, I figured that, "When 
in Rome".  So if there are any interested South Louisiana / 
Mississippi people, let's set something up...off list of course.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] New Orleans PHP Users Group

2003-11-12 Thread Jay Blanchard
[snip]
With all the talk about local php user groups, I figured that, "When

in Rome".  So if there are any interested South Louisiana / 
Mississippi people, let's set something up...off list of course.
[/snip]

This makes me homesick! :( When I move back to New Orleans I am there!
GEAUX SAINTS! GEAUX LSU!

I'll see your Rome and raise you a "Central Texas (San Antonio area) PHP
Users Group" Off-list...

TIA!

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



Re: [PHP] ignoring case

2003-11-12 Thread Rolf Brusletto
Adam Williams wrote:

Hi,

does anyone happen to know off hand the function that will ignore case for 
data inputted via text from a ?  I don't remember it off hand 
and can't find it in the function list on php.net.  Basically it changes 
the text in the string from a character to [a-Z] for each character.  I 
know it exists because i've used it before.  Any help?  Thanks

 

Adam -

here ya go..

http://www.php.net/strtolower

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


Re: [PHP] ignoring case

2003-11-12 Thread Marek Kilimajer
It might be strtolower and strtoupper, but they do not make string case 
insensitive, functions can be CI, not strings.

Adam Williams wrote:

Hi,

does anyone happen to know off hand the function that will ignore case for 
data inputted via text from a ?  I don't remember it off hand 
and can't find it in the function list on php.net.  Basically it changes 
the text in the string from a character to [a-Z] for each character.  I 
know it exists because i've used it before.  Any help?  Thanks

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


Re: [PHP] Somewhat-OT: Notation style

2003-11-12 Thread Burhan Khalid
Chris Boget wrote:

What is the name of the notation that has variable names
prefixed with the first letter of the type of the variable?  eg.
int iVar;
float fVar;
string sVar;
That's Hungarian notation (named after a guy that worked at MS that came 
up with it, iirc).

The $VarNameLikeThis is called Camel Case

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ignoring case

2003-11-12 Thread Adam Williams
Hi,

I finally found it in my notes, it was sql_regcase()

Rolf Brusletto wrote:

Adam Williams wrote:

Hi,

does anyone happen to know off hand the function that will ignore case 
for data inputted via text from a ?  I don't remember it 
off hand and can't find it in the function list on php.net.  Basically 
it changes the text in the string from a character to [a-Z] for each 
character.  I know it exists because i've used it before.  Any help?  
Thanks

 

Adam -

here ya go..

http://www.php.net/strtolower

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


RE: [PHP] newbie question about scope

2003-11-12 Thread Jay Blanchard
[snip]
Unless I'm misunderstanding something, PHP does not implement
scoping (at least in the sense that many other programming languages
do) prior to PHP5.  
[/snip]

Actually it does implement scoping, see
http://us2.php.net/language.variables.scope

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



[PHP]

2003-11-12 Thread Alan Lord
Hi all,

can I put a function_name() in the  place holder?
I know I can use a file name, but it would be much better (for me) if I
could use a function name.

Thanks in advance

Al

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



RE: [PHP]

2003-11-12 Thread Jay Blanchard
[snip]
can I put a function_name() in the  place holder?
I know I can use a file name, but it would be much better (for me) if I
could use a function name.
[/snip]

Have you tried it?

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



Re: [PHP]

2003-11-12 Thread Chris Shiflett
--- Alan Lord <[EMAIL PROTECTED]> wrote:
> can I put a function_name() in the  place holder?

I think you can do this with JavaScript, yes.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] Need OSC guru for some overflow...

2003-11-12 Thread Brian V Bonini
I've got some overflow work that requires some modifications to the
functionality of OSC. Would prefer to work with someone who's already
VERY VERY familiar with OSC. Please contact me @
[EMAIL PROTECTED]com if interested.

Thanks!

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



RE: [PHP]

2003-11-12 Thread Pablo Gosse
On Wednesday, November 12, 2003 8:23 AM Alan and Chris wrote:

--- Alan ---
> can I put a function_name() in the  place holder?

--- Chris ---
> I think you can do this with JavaScript, yes.

What is it that you hope to achieve by using a function instead of a
url?  You could, as chris writes, use
action="Javascript:dosomething();", but that has almost an identical
effect as calling said function in the onsubmit event handler.

The only difference would be that if you use the onsubmit handler and
the function does not return false, the action parameter of the form
will be called after the function executes.

Cheers,
Pablo

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



Re: [PHP]

2003-11-12 Thread Marek Kilimajer
Alan Lord wrote:

Hi all,

can I put a function_name() in the  place holder?
I know I can use a file name, but it would be much better (for me) if I
could use a function name.
Thanks in advance

Al



script.php:

switch($_GET['action']) {
case 'edit':
edit();
break;

}

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


Re: [PHP] OOP clarification: Messages between objects

2003-11-12 Thread Robert Cummings
On Wed, 2003-11-12 at 04:31, Robert Ian Smit wrote:
> I am trying to implement a generic form handler that is capable of
> printing the form and checking the user input.
> 
> I want this application to be useful in the end, but I also use it
> to explore OOP in PHP.
> 
> The working code at the moment is able to add HTML input elements to
> the page. These fields are all objects that get added to the Form
> object. When the user submits, the Form object tells all elements to
> check their input and create error messages if needed.
> 
> So far so good. One of the intended applications is to store
> addresses submitted by visitors to our website. We have users from
> two countries, with two different zip-code systems.
> 
> I could ofcourse create a double check in the zipcode-object, but
> this would mean that it would be possible to submit a zipcode from
> the other country without any objection by the application.
> 
> I'd like the zipcode object to ask a question to find out what
> country we're dealing with and then apply the check of the input
> depending on the answer.
> 
> Although these questions are specific to my application, I guess my
> real question is more general. When you have a containerobject that
> stores different kinds of elements, how do you give the elements the
> ability to learn about their surroundings so they can alter their
> behaviour? 
> 
> I know have:
> 
> $foo = new Form();
> $foo->addToForm(new Element('country'));
> $foo->addToForm(new Element('zipcode'));
> $foo->processForm();
> 
> 
> I hope I made clear what it is I am trying to do. Hopefully I'll
> receive a few hints to help me on my way.

Give elements the ability to access their own form object. Then they can
request elements belonging to their own form for complex validation. For
instance:

function validateZip( &$element )
{
$form = $element->getForm();

$country = $form->getElement( 'country' );
if( $country->getValue() == 'Some country' )
{
// ZIP must meet format for "Some country".
}
else
if( $country->getValue() == 'Some other country' )
{
// ZIP must meet format for "Some other country".
}
else
{
// Default case.
}
}

HTH,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] testing a variable

2003-11-12 Thread Adam Williams
Hello,

I need to test a variable to see if it contains a value or not, and if 
not, do something.  My php is a little rusty, so which would be better?

if ( !$var )
{ echo "do something";}

or

if ( !isset($var )
{ echo "do something";}

or are both of those wrong, and if so, how hsoudl I check if a variable is 
false, null, doesn't contain a value, etc...

What I am doing is checking a field in an sql table, and if the field is 
null, empty, etc... then do something.  so what is the best way to check 
the field if its null, empty, etc...?

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



RE: [PHP] testing a variable

2003-11-12 Thread Jay Blanchard
[snip]
if ( !isset($var )
{ echo "do something";}
[/snip]

self answering questions, gotta' love 'em!

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



RE: [PHP]

2003-11-12 Thread Wouter van Vliet
> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
> Sent: woensdag 12 november 2003 17:23
> To: Alan Lord; [EMAIL PROTECTED]
> Subject: Re: [PHP] 
> 
> --- Alan Lord <[EMAIL PROTECTED]> wrote:
> > can I put a function_name() in the  place holder?

For once and for all .. NO, you cannot do that. The form is submitted to a
page, and this page will execute funtions.

What you might want to do is this (though I doubt if you want to do it cuz
it is pretty unsafe):

 

== execute.php ==


> 
> I think you can do this with JavaScript, yes.

No, Chris. For as far as I know you cannot even do this with JavaScript.
Though I've never tried it. What you can do is use the 'onSubmit' event like
this:



Where FunctionDeclaredInJavascript() is a function declared in JS (not in
PHP).  If it returns false the form will not be submitted, if it returns
true the form will .. Guesss what? :P

> 
> Chris
> 
> =
> My Blog
>  http://shiflett.org/
> HTTP Developer's Handbook
>  http://httphandbook.org/
> RAMP Training Courses
>  http://www.nyphp.org/ramp
> 
> --
> 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] testing a variable

2003-11-12 Thread CPT John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>

> I need to test a variable to see if it contains a value or not, and if 
> not, do something.
[snip]
> if ( !isset($var )
> { echo "do something";}

That's the correct way.

> What I am doing is checking a field in an sql table, and if the field is 
> null, empty, etc... then do something.  so what is the best way to check 
> the field if its null, empty, etc...?

The variable might be set, yet empty, though. So you may want to add

if(!isset($var) || empty($var))
{ echo "do something"; }

---John Holmes...

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



[PHP] Installing mcrypt

2003-11-12 Thread Mike At Spy

I am installing mcrypt on a linux server.  I first installed libmcrypt 2.5.7
and now am working on mcrypt 2.6.4.

When I do a ./configure for mcrypt 2.6.4, it gives me this error:

checking for libmcrypt - version >= 2.5.0...
*** 'libmcrypt-config --version' returned 2.5.7, but LIBMCRYPT (2.5.6)
*** was found! If libmcrypt-config was correct, then it is best
*** to remove the old version of LIBMCRYPT. You may also be able to fix the
error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If libmcrypt-config was wrong, set the environment variable
LIBMCRYPT_CONFIG
*** to point to the correct copy of libmcrypt-config, and remove the file
config.cache
*** before re-running configure
configure: error: *** libmcrypt was not found

There has only been one version of libmcrypt (new server), so I'm not sure
why it thinks there is a 2.5.6 version on it.

Where do I find the LD_LIBRARY_PATH enviroment variable to change it?  Or is
there another solution?

Thanks!

-Mike

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



Re: [PHP] Re: Delete Temporary Internet Files

2003-11-12 Thread Mark

--- Kim Steinhaug <[EMAIL PROTECTED]> wrote:
> The original question didnt consert the OS, or where the user was
> at.
> Concerning cleaning the IE directory I would assume that he's
> installed
> PHP and IIS / Apache on his local machine.
> 
> Using a webpage online on the internet to fix your local machine
> doesnt
> sound logical to me, therefore I assume local innstallation on
> local
> machine.
> 
> And when your on your local machine there are no problems accessing
> your
> files,
> even if they belong to the windows environment. Overwriting them
> can be
> problematic at times, since processed may use the file.

But why in the world would you want to edit other "Internet Options"
for a PC that is acting as a web server? I stand by my assumption
that the OP wanted to change the client machine's settings (and
delete the client temp files), and not the settings on the server. Of
course, I could be wrong. It happens daily.


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] testing a variable

2003-11-12 Thread R'twick Niceorgaw
Adam Williams said the following on 11/12/2003 11:37 AM>>
Hello,

I need to test a variable to see if it contains a value or not, and if 
not, do something.  My php is a little rusty, so which would be better?

if ( !$var )
{ echo "do something";}
or

if ( !isset($var )
{ echo "do something";}
or are both of those wrong, and if so, how hsoudl I check if a variable is 
false, null, doesn't contain a value, etc...

What I am doing is checking a field in an sql table, and if the field is 
null, empty, etc... then do something.  so what is the best way to check 
the field if its null, empty, etc...?

if (!isset($var) or empty($var) ) {
echo "do something";
}
HTH
R'twick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Installing mcrypt

2003-11-12 Thread John Nichel
Mike At Spy wrote:
I am installing mcrypt on a linux server.  I first installed libmcrypt 2.5.7
and now am working on mcrypt 2.6.4.
When I do a ./configure for mcrypt 2.6.4, it gives me this error:

checking for libmcrypt - version >= 2.5.0...
*** 'libmcrypt-config --version' returned 2.5.7, but LIBMCRYPT (2.5.6)
*** was found! If libmcrypt-config was correct, then it is best
*** to remove the old version of LIBMCRYPT. You may also be able to fix the
error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If libmcrypt-config was wrong, set the environment variable
LIBMCRYPT_CONFIG
*** to point to the correct copy of libmcrypt-config, and remove the file
config.cache
*** before re-running configure
configure: error: *** libmcrypt was not found
There has only been one version of libmcrypt (new server), so I'm not sure
why it thinks there is a 2.5.6 version on it.
Where do I find the LD_LIBRARY_PATH enviroment variable to change it?  Or is
there another solution?
I had a similiar problem recently when trying to install aspell from 
source.  Don't know if this will help you, but check to see if you have 
the RPM of libmcrypt installed too...that might be causing the conflict.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] multiple table rows into an array, and creating a calendar

2003-11-12 Thread Dave G
Burham

> why don't 
> you do an in_array() check for each date that you print.
> Hope this helps.

Yes, this helps a lot!
However, I'm still stuck on how to get my list of dates into the array.
I've been searching around on the Internet, and it seems that one has to
construct a for() loop in order to get the results of multiple rows into
an array. But that seems unnecessarily complicated. Is there no command
to take multiple rows and place them into an array?

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



[PHP] Explode a string

2003-11-12 Thread Erin
Any ideas how to do this,

I have a string

734088+3+734132+9+734138+80+781007+1+

I need to place the string into a multi-array like so

array[0][0] = 734088
array[0][1] = 3

array[1][0] = 734132
array[1][1] = 9

array[2][0] = 734138
array[2][1] = 80

etc...

Now ive tried everything i know any ideas?


Regards

R

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



RE: [PHP] help create community newbie guide to security

2003-11-12 Thread Chris W. Parker
Chris Shiflett 
on Monday, November 10, 2003 8:21 PM said:

> It would probably need to be either very short or very long.

Yes, I would prefer very long so as to be as complete as possible.

>> 2. The session id should not be stored on the client.
> 
> I'm not sure I agree with this. Can you elaborate? Though it can be
> argued that sending the session identifier is a security risk, it is
> the one that is necessary for state (and therefore session)
> management.

Elaborate? Well I was just thinking that this could somehow be used to
impersonate someone. How or why I'm not really sure. That's why I wrote
the email instead of hauling off to write an article (most of which
would be misinformed without having a better understanding).

>> 3. A unique identifier should be created for the user when the user
>> logs in. This unique identifier should not be based on the user's
>> name, password, id, or session id.
> 
> What is the difference between the session and unique identifiers?

Well I guess there isn't one now that you've asked that question.

My original thinking was that I wouldn't be using the session id as I
would the unique identifier because of point #2 (you shouldn't store the
session id on the client). But since you point out that storing the
session id is a necessary evil (if I understand you correctly) I see
that it would be ok to forget about generating another unique identifier
and just use the session id instead.

>> 6. The login page should be done over HTTPS. (Sounds like a good idea
>> but is this necessary? Is this killing a mouse with a jackhammer?)
> 
> It depends on the amount of risk that is acceptable. Requests for
> non-SSL URLs are sent in the clear and are vulnerable to things such
> as sniffing, man in the middle attacks, and other similar attacks.
> 
> Yahoo offers the user a choice between SSL and non-SSL logins, and
> they default to non-SSL. Some sites describe the choice as secure
> versus fast.

Well then let met ask this: Is an SSL login option something you
personally setup by default as part of your regular login routine or
would you only create one if the client requested/had a need for it?

>> 7. All input received via $_POST and/or $_GET should be thoroughly
>> filtered
> 
> I would say any data that originates from any external source should
> be treated as tainted data until it can be properly verified via data
> filtering.

Ok so then that means I forgot about $_COOKIE (which you mention a
little later in your email).

>> 10. Use htmlentities() on data that will be put through a SQL query
>> to prevent XSS attacks. http://php.net/htmlentities
> 
> This is a nice suggestion. While htmlentities() cannot be guaranteed
> to defend against all XSS vulnerabilities, I would bet that most XSS
> vulnerabilities are due to a complete lack of filtering logic.

In your article from php|arch (http://www.phparch.com/sample.php?mid=16)
the first of your 5 points in protecting against XSS is to use
htmlentities(), strip_tags(), and utf8_decode() when filtering your
data. Would using all three of these protect against everything? If not,
can you give an example of what data can be passed, put through those
filtering functions, and still cause problems? (For understanding sake.)

> Hope that helps.

Sure does, thanks.


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] testing a variable

2003-11-12 Thread Chris Shiflett
--- Adam Williams <[EMAIL PROTECTED]> wrote:
> I need to test a variable to see if it contains a value or not, and if 
> not, do something. My php is a little rusty, so which would be better?

This is a good page for understanding how things like isset(), is_null(),
and empty() work:

http://www.blueshoes.org/en/developer/php_cheat_sheet

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] index.php4 broken

2003-11-12 Thread Michael Seely
HI -- I just broke something simple and I'm stuck.
I've been using index.php3 as the start file in each directory for a long 
time.  I just set up a new site using php4 and the index.php4 pages are not 
displayed as the default page for the directory. I see the text version 
directory listing.
If I use the full url, i.e., something/index.php4 it looks OK as expected.

What changed

Thanks - Mike



_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Michael Seely   (408) 353-9008
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP]

2003-11-12 Thread Chris Shiflett
--- Wouter van Vliet <[EMAIL PROTECTED]> wrote:
> > I think you can do this with JavaScript, yes.
> 
> No, Chris. For as far as I know you cannot even do this with JavaScript.

You can. I just said, "I think," to be polite. I knew the answer. :-)

Of course, as someone else pointed out, this is a terrible idea. At most,
you would want to use the onsubmit attribute to call your function, so
that those who have JavaScript disabled can still submit the form.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] Explode a string

2003-11-12 Thread Jay Blanchard
[snip]
Any ideas how to do this,

I have a string

734088+3+734132+9+734138+80+781007+1+

I need to place the string into a multi-array like so

array[0][0] = 734088
array[0][1] = 3

etc...

Now ive tried everything i know any ideas?
[/snip]

start with explode 

$arrString = explode("+", $stringYouAreWorkingWith);

Then loop through it, placing the pairs into two-dimensional array you
mention above

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



RE: [PHP] Explode a string

2003-11-12 Thread Chris W. Parker
Erin 
on Wednesday, November 12, 2003 9:13 AM said:

> 734088+3+734132+9+734138+80+781007+1+
> 
> I need to place the string into a multi-array like so
> 
> array[0][0] = 734088
> array[0][1] = 3
[snip]
> Now ive tried everything i know any ideas?

Yes. You need to somehow differentiate between the different columns and
rows. What I suggest you do is change every other + to something else
like a ; and then split on that.

Without knowing any other way to do this I would use a regex to skip the
first + and change second one, repeating this until the end of the
string.

Then you can explode() on + and ;.


hth,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



RE: [PHP] Explode a string

2003-11-12 Thread Chris W. Parker
Chris W. Parker <>
on Wednesday, November 12, 2003 9:19 AM said:

> Without knowing any other way to do this I would use a regex to skip
> the first + and change second one, repeating this until the end of the
> string.

Considering Jay's answer for this question, do I always do things the
hard way or what??

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



RE: [PHP] index.php4 broken

2003-11-12 Thread Jay Blanchard
[snip]
HI -- I just broke something simple and I'm stuck.
I've been using index.php3 as the start file in each directory for a
long 
time.  I just set up a new site using php4 and the index.php4 pages are
not 
displayed as the default page for the directory. I see the text version 
directory listing.
If I use the full url, i.e., something/index.php4 it looks OK as
expected.

What changed
[/snip]

Nothingyet. Have a look at the directives in your
httpd.conf(assuming Apache here) for this section or something similar.

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#

DirectoryIndex index.html index.php index.php3


Add index.php4 at the eol

DirectoryIndex index.html index.php index.php3 index.php4

also make sure that you have

AddType application/x-httpd-php .php4


in the httpd.conf

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



RE: [PHP] Installing mcrypt

2003-11-12 Thread Mike R

> >
> > There has only been one version of libmcrypt (new server), so
> I'm not sure
> > why it thinks there is a 2.5.6 version on it.
> >
> > Where do I find the LD_LIBRARY_PATH enviroment variable to
> change it?  Or is
> > there another solution?
>
> I had a similiar problem recently when trying to install aspell from
> source.  Don't know if this will help you, but check to see if you have
> the RPM of libmcrypt installed too...that might be causing the conflict.
>

That was it. :)

Problem is, I'm getting a different error now:

*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set
your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found

Anyone know how to change the LD_LIBRARY_PATH variable?  Or where to,
actually.

:)

Thanks,

-Mike

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



RE: [PHP] Explode a string

2003-11-12 Thread Jay Blanchard
[snip]
Considering Jay's answer for this question, do I always do things the
hard way or what??
[/snip]

Young Grasshopper...there is more than one way to do things, a lot of
them are "right"some are just harder than others. 

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



Re: [PHP] index.php4 broken

2003-11-12 Thread John Nichel
Michael Seely wrote:
HI -- I just broke something simple and I'm stuck.
I've been using index.php3 as the start file in each directory for a 
long time.  I just set up a new site using php4 and the index.php4 pages 
are not displayed as the default page for the directory. I see the text 
version directory listing.
If I use the full url, i.e., something/index.php4 it looks OK as expected.

What changed

Thanks - Mike
Chances are, you need to modify your httpd.conf file to 'see' index.php4 
as a directory index file, and restart Apache.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Installing mcrypt

2003-11-12 Thread John Nichel
Mike R wrote:
That was it. :)

Problem is, I'm getting a different error now:

*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set
your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
Anyone know how to change the LD_LIBRARY_PATH variable?  Or where to,
actually.
You can put where-ever you installed libmcrypt into 
/etc/ld.so.conf...ie, if you used '--prefix=/usr/local' when configuring 
libmcrypt, put /usr/local into /etc/ld.so.conf, and run 'ldconfig'

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: index.php4 broken

2003-11-12 Thread pete M
Why not save the file as index.php

Michael Seely wrote:

HI -- I just broke something simple and I'm stuck.
I've been using index.php3 as the start file in each directory for a 
long time.  I just set up a new site using php4 and the index.php4 pages 
are not displayed as the default page for the directory. I see the text 
version directory listing.
If I use the full url, i.e., something/index.php4 it looks OK as expected.

What changed

Thanks - Mike



_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Michael Seely   (408) 353-9008
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Installing mcrypt

2003-11-12 Thread Mike R


> -Original Message-
> From: John Nichel [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 12, 2003 12:33 PM
> To: Mike R
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Installing mcrypt
> 
> 
> Mike R wrote:
> > 
> > That was it. :)
> > 
> > Problem is, I'm getting a different error now:
> > 
> > *** Could not run libmcrypt test program, checking why...
> > *** The test program compiled, but did not run. This usually means
> > *** that the run-time linker is not finding LIBMCRYPT or 
> finding the wrong
> > *** version of LIBMCRYPT. If it is not finding LIBMCRYPT, 
> you'll need to set
> > your
> > *** LD_LIBRARY_PATH environment variable, or edit 
> /etc/ld.so.conf to point
> > *** to the installed location  Also, make sure you have run 
> ldconfig if that
> > *** is required on your system
> > ***
> > *** If you have an old version installed, it is best to remove 
> it, although
> > *** you may also be able to get things to work by modifying 
> LD_LIBRARY_PATH
> > ***
> > configure: error: *** libmcrypt was not found
> > 
> > Anyone know how to change the LD_LIBRARY_PATH variable?  Or where to,
> > actually.
> 
> You can put where-ever you installed libmcrypt into 
> /etc/ld.so.conf...ie, if you used '--prefix=/usr/local' when configuring 
> libmcrypt, put /usr/local into /etc/ld.so.conf, and run 'ldconfig'


Did that.  Same error. :\

-Mike
 

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



[PHP] Help with Javascript

2003-11-12 Thread Payne
First thanks with the help I got yesterday with php and javascript 
problem, I have a problem with javascript and I need to know if anyone 
know of a javascript mailing like this, so some strange reason if I add 
the tag taget to this line...



Any of my browser give me an error, but it I remove it work, but it's 
lost due to frames.

I know this is a php question so if you can give me a javascript mailing 
that would be a BIG help.

Payne

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


Re: [PHP] Help with Javascript

2003-11-12 Thread Payne
Pablo,

Ok, I have it the page called top.php right now, are you that I need to 
place this in my index.html?

Payne

Pablo Gosse wrote:

Hi Payne.

The problem here is indeed the target attribute.  You say that if you
remove the target attribute it works, but is lost due to frames.
What exactly is it you're trying to do with the frames?  The solution
might be to embed the js function in the frame itself, and then access
it via href="Javascript:parent.targetframe.document.function();"
Hope that helps.

Pablo.

-Original Message-
From: Payne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 12, 2003 9:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Help with Javascript

First thanks with the help I got yesterday with php and javascript 
problem, I have a problem with javascript and I need to know if anyone 
know of a javascript mailing like this, so some strange reason if I add 
the tag taget to this line...



Any of my browser give me an error, but it I remove it work, but it's 
lost due to frames.

I know this is a php question so if you can give me a javascript mailing

that would be a BIG help.

Payne

 

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


Re: [PHP] Installing mcrypt

2003-11-12 Thread John Nichel
Mike R wrote:

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
>>
You can put where-ever you installed libmcrypt into 
/etc/ld.so.conf...ie, if you used '--prefix=/usr/local' when configuring 
libmcrypt, put /usr/local into /etc/ld.so.conf, and run 'ldconfig'


Did that.  Same error. :\

-Mike
You ran ldconfig after, right?  I'm afraid I can't help you more than 
that, as I'm not sure where to set the actual LD_LIBRARY_PATH...I mean, 
you can probably set it in /etc/profile, but I don't know if that's the 
proper place.  If you want to give it a try, edit /etc/profile, and add 
this

LD_LIBRARY_PATH=/path/to/ld:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
If that isn't it, or if you want to be sure, you may want to try a 
mailing list for your OS.  Sorry I couldn't be of more help.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] overriding string concatenation '.'

2003-11-12 Thread tirumal b
Hello All

 I have an ip addr in a variable. I use
'ssh'.$ipaddr.'command' in a php file

The dots in ipaddr variable are considered to be
string concatenations. can it take the literal meaning
in this case. Please let me know

Thank you

Tirumal

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] overriding string concatenation '.'

2003-11-12 Thread CPT John W. Holmes
From: "tirumal b" <[EMAIL PROTECTED]>

>  I have an ip addr in a variable. I use
> 'ssh'.$ipaddr.'command' in a php file
> 
> The dots in ipaddr variable are considered to be
> string concatenations. 

No they are not. Show some examples. 

---John Holmes...

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



[PHP] Why is this code not working?

2003-11-12 Thread Dave G
PHP Gurus,
I'm trying to put the results of a query into an array.
My code looks like this:
";
}
echo "The results of the array are - " . $workshops[0] . " and " .
$workshops[1];
?>
When I run this, the output to the screen says:
---
Array
Array
The results of the array are - Array and Array
---
If I change just this line (take the square brackets off the
$workshops array declaration):
$workshops = mysql_fetch_row($result);

Then my results are:
---
2003-11-17

The results of the Array are 2003-11-24 and
---
I understand that by not using square brackets to declare the
variable explicitly as an array, then it just stores the last value,
which is why the dates aren't echoing to the screen where they are
supposed to. That part makes sense. What I don't understand is why when
I try to put the results into a particular location in the array, it
gets stored as the word "Array". But if I just declare it as a regular
variable, then I get the date that I want.
I've been writing this out a million different ways to try and
figure out what's going on, I've searched Google, and I've read the
descriptions for the mysql_* commands on php.net. But everything I read
indicates it should work. In fact I got the for() loop from a tutorial
web site, so I'm pretty sure it's supposed to work. I can't see what's
wrong. Am I not declaring the array correctly? Is there some simple
error that I'm over looking? What's going on?

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



RE: [PHP] overriding string concatenation '.'

2003-11-12 Thread Chris W. Parker
CPT John W. Holmes 
on Wednesday, November 12, 2003 10:43 AM said:

>> The dots in ipaddr variable are considered to be
>> string concatenations.
> 
> No they are not. Show some examples.

What am I missing here? How is the dot operator not considered
concatenation?

$concatenatedString = 'a'.'concatenated'.'string';

tirumal,

Do you want do to this?

$string = "ssh.$ipaddr.command";

?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



RE: [PHP] Why is this code not working?

2003-11-12 Thread Jay Blanchard
[snip]
I'm trying to put the results of a query into an array.
Is there some simple error that I'm over looking? What's going on?
[/snip]

Have you tried mysql_fetch_array()?

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



RE: [PHP] overriding string concatenation '.'

2003-11-12 Thread Jay Blanchard
[snip]
> No they are not. Show some examples.

What am I missing here? How is the dot operator not considered
concatenation?

$concatenatedString = 'a'.'concatenated'.'string';
[/snip]

$ipaddr = "192.34.123.122";

. is not a concatenator, it is part of the string.

$myFileName = "barkLikeAdog.txt";

. is not a concatenator, it is part of the string.

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



[PHP] Calendar

2003-11-12 Thread Steve Marquez
Hi,

I am looking for a simple easy to edit php calendar program. Does anyone
know where I can find one?

Thanks for your help.

--

Steve Marquez
[EMAIL PROTECTED]

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



RE: [PHP] Calendar

2003-11-12 Thread Jay Blanchard
[snip]
I am looking for a simple easy to edit php calendar program. Does anyone
know where I can find one?
[/snip]

Several

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=PHP+calendar

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



RE: [PHP] Calendar

2003-11-12 Thread Pablo Gosse
On Wednesday, November 12, 2003 10:50 AM, Steve wrote:

> I am looking for a simple easy to edit php calendar program. Does
anyone
> know where I can find one?

Pear is always a good place to start:

http://pear.php.net/package/Calendar

Cheers,
Pablo

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



Re: [PHP] overriding string concatenation '.'

2003-11-12 Thread Chris Shiflett
--- tirumal b <[EMAIL PROTECTED]> wrote:
>  I have an ip addr in a variable. I use
> 'ssh'.$ipaddr.'command' in a php file
> 
> The dots in ipaddr variable are considered to be
> string concatenations.

That's wrong, which makes me think that you didn't bother trying this
before you asked your question.

If I am mistaken, please clarify.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



  1   2   3   >