[PHP] Regex Help

2002-12-19 Thread Jim
Could someone show me how to use preg_replace to change this:

test test test

into:

anotherword test anotherword

basically, I want to change a value only if it is not in an option
tag.

I also want to account for situations like :

test, something test test!

My thoughts were to do the replace if the word (test) was not
surrounded by quotes or surrounded by greater/less than symbols. I
just have no idea how to formulate that with regex.

Please help! Thanks.

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




Re: [PHP] Regex Help

2002-12-19 Thread Jim
I'm sorry, I accidentally left the slashes on my second example. My original
message should read:

Could someone show me how to use preg_replace to change this:

test test test

into:

anotherword test anotherword

Note that what I want to accomplish is to change 'test' into 'anotherword'
only if it is not within the option tag.

Thanks!


- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 12:42 PM
Subject: Re: [PHP] Regex Help


> addslashes()
>
> - Original Message -
> From: "Jim" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 19, 2002 11:26 AM
> Subject: [PHP] Regex Help
>
>
> Could someone show me how to use preg_replace to change this:
>
> test test test
>
> into:
>
> anotherword test anotherword
>
> basically, I want to change a value only if it is not in an option
> tag.
>
> I also want to account for situations like :
>
> test, something test test!
>
> My thoughts were to do the replace if the word (test) was not
> surrounded by quotes or surrounded by greater/less than symbols. I
> just have no idea how to formulate that with regex.
>
> Please help! Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


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




Re: [PHP] Regex Help

2002-12-19 Thread Jim
Thanks for helping. Unfortunately, that doesn't quite accomplish the task
either. The other example for my first post would be mangled with that.

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 1:09 PM
Subject: Re: [PHP] Regex Help


>  $q = "test test test";
> ereg("(.*)()(.*)",$q,$ar);
> $t = "anotherword".$ar[2]."anotherword";
> print $t;
> ?>
>
> outputs:
> anotherwordtestanotherword
>


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




Re: [PHP] Regex Help

2002-12-19 Thread Jim
Whoops, sorry post aborted prematurely.

What I was going say say was that:

test, something test test!

should become:

anotherword, something test anotherword!

Thanks again for helping!


- Original Message - 
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 1:24 PM
Subject: Re: [PHP] Regex Help


> Thanks for helping. Unfortunately, that doesn't quite accomplish the task
> either. The other example for my first post would be mangled with that.
> 
> - Original Message -
> From: "Rick Emery" <[EMAIL PROTECTED]>
> To: "Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, December 19, 2002 1:09 PM
> Subject: Re: [PHP] Regex Help
> 
> 
> >  > $q = "test test test";
> > ereg("(.*)()(.*)",$q,$ar);
> > $t = "anotherword".$ar[2]."anotherword";
> > print $t;
> > ?>
> >
> > outputs:
> > anotherwordtestanotherword
> >
> 

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




[PHP] Error handling with multiple file uploads and sql

2003-01-06 Thread Jim
Hi,

I have the following scenario:

A user can login to my website (so I know their ID) and create a new 'item
record' through a form. This item may have up to 10 images uploaded with it
(pictures of the item). The structure of my DB is a main 'Items' table
holding textual description/price/location information of the item and
another table 'Pictures' holding information on each image uploaded. My
problem is how to handle an error if something goes wrong i.e. sql insert
fails or the file copy() fails.

What I don't want to happen is for the 'Items' record to be created and then
1 or more files fail to upload. So I thought, I'll upload the files first,
but the problem with this is that in the 'Pictures' table I have to enter an
'ItemID' field obviously to link the pictures to the item, but the ID of the
item isn't known as it hasn't been created yet. Ahh!!

My next thought was to upload the files first, then insert the 'Items'
record, then insert the multiple 'Pictures' records.I figure if the
'Items' insert works, the likelihood is that the 'Pictures' inserts will
too.

How does this sound?

Thanks for any input.

Jim.


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




Re: [PHP] Error handling with multiple file uploads and sql

2003-01-06 Thread Jim
> Why not split it into 2 forms?  insert, then attach pictures to the
record.

Its just not user-friendly enough, I have thought about it though. I think
I'd rather risk the script hitting an error than compromise the
user-friendliness.after all, the chance of a file not saving is
miniscule as I can guarantee no other file will exist with that nameand
for the sql to fail would probably mean the DB server being offline which
would mean the user would never even get to the form in the first place.

> Otherwise, decide what's the key issue (imho the a record can exist
without
> pics, but not vice-versa), and focus on that first.

I see where your coming from but it can happen vice-versa. I assign the
image a name in the format "pic_.gif" so if
the users id is 12 and that user already has 12 images, the filename would
be pic12_13.gif. These names are then stored in the 'Pictures' table. This
is how the logic might go (assuming user id 12):

1. SELECT CurrentPictureNum FROM Users WHERE UserID = 12
-- CountPictureNum never gets decremented

2. loop $_FILES and count number of images (don't save yet)

3. UPDATE Users SET CountPictures = CountPictures + 
-- this guarantees no files in the future will overwrite
-- the ones which are about to be saved

4. loop $_FILES again but this time save them

5. INSERT INTO Items VALUES (..)
-- if it fails here, who cares, it just means images are
-- stored which don't need to exist, i can write a cleanup
-- script to deal with these though

6. loop over array of names of new images and INSERT INTO Pictures VALUES
()
-- this is the only dodgy bit, if we fail here the Items
-- record has been created but the script fails. I think
-- however its fair to assume though that if the first
-- insert worked, these will too.

Opinions?

Thanks,

Jim.


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




Re: [PHP] MySQL vs PostgreSQL

2003-01-06 Thread Jim
>> is MySQL good enough? I read it only supports table locking,
>> which is not very satisfying in such a multiuser environment
>> as the internet..

Read all of http://www.mysql.com/doc/en/ANSI_diff_Transactions.html

You'll find an explanation of what atomic operations are and how they
compare to true transactions.

Jim.



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




[PHP] Column size, user input and htmlspecialchars

2003-01-10 Thread Jim
Hi,

No problems with my code but instead I'd like some views on the best way of
doing the following:

When I read in a text field from a users HTML form, I will allow them a
maximum of say 50 characters. So, I define the corresponding field in MySQL
to be VARCHAR(50). The problem is that after I run it through
htmlspecialchars() the size could have increased considerably, if there were
for example 5 characters that got escaped, this would mean possibly an extra
25 characters to the original meaning it would be truncated considerably.
One option is to store the input without using htmlspecialchars, and then
when I display the information wrap the output in htmlspecialchars. I don't
like this though as I've got several text fields which will be hit very
often, it seems too much of a performance penalty. The other option is to
str_replace($text, '<', '') so this gets round people embedding Javascript
and other HTML but means non-malicious less-than characters would be lost,
however I would only need to use htmlspecialchars when outputting to an
input box, not just as plain text, so not so much a performance penalty as
the first option.

How do you guys go about resolving this situation?

Thanks for any input,

Jim.


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




[PHP] Help on preg_split

2003-03-26 Thread Jim
Hi!

Could someboy please help me with this simple task (at least I though it
would be simple):

I need to split a string with two dates in into two datestrings, and there
might be whatever between the dates, e.g.
$datestring = "010101a020202", or $dateting = "  010101+020202
"

Then I thought that
$date = preg_split("/[\D]+/",trim($datestring))
whould do the job, but it didn't.

Why? and how should it be?

Many thanks in advance!

br Jim


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



[PHP] Mod function

2002-01-18 Thread Jim

I am looking for a mod() function in PHP but unfortunately I am unable to find one. 
Please help...

 ( °> Jim-Christian Flatin
 //\\  Skien / Norway
/ \/ ) [EMAIL PROTECTED]
'-<<  http://niteshift.d2g.com



Re: [PHP] Why is imageTTFtext function useless?(again)

2002-04-26 Thread Jim

Your problem doesn't have anything to do with PHP. The error says 
that libgd doesn't offer freetype support, so you need to get a more 
current version of gd.

Regards,

Jim Heffner




>No idea, check your config.log and see why it is failing.
>
>On Thu, 25 Apr 2002, zhaoxd wrote:
>
>>
>>  Whatever I tried ,it is also useless,why?
>>
>>  This time I compile it with freetype-1.3.1.when I used the test 
>>code , it also said  "libgd was not built with FreeType font 
>>support in /usr/local/apache/htdocs/test.php on line 14".
>>
>>  Would you mind tell me how you do this? I just wanna support 
>>FreeType font in my gd so as to use gd function like ImageTTFText 
>>,etc.
>>
>>  Thank you
>> 
>>zhaoxd
>>
>>  > It works fine.  Spell Header() right, or remove the header altogether so
>>  > you can see the error message.  I predict you will see a message telling
>>  > you it couldn't open the font file.
>>  >
>>  > -Rasmus
>>  >
>>  > On Thu, 25 Apr 2002, zhaoxd wrote:
>>  >
>>  > > hello,all:
>>  > >
>>  > > I have already installed gd-1.8.4 in php-4.1.2 with some 
>>libraries,such as libpng 
>>-1.2.0,freetype-1.3,zlib-1.1.4,freetype2,in my apache server which 
>>version is 1.3.24,and "phpinfo()" display php can support such 
>>soft,as follow:
>>  > > GD Support---enabled
>>  > > GD Version---1.6.2 or higher
>>  > > FreeType Support-enabled
>>  > > FreeType Linkage-with freetype
>>  > > JPG Support--enabled
>>  > > PNG Support--enabled
>>  > > WBMP Support-enabled
>>  > >
>>  > > But when I used the function related with ttf,like 
>>ImageTTFText or ImageTTFBox,I found it useless,in other words,no 
>>pictures were displayed in my IE.
>>  > > I don't understand why,is gd-1.8.4 can not support these functions?
>>  > >
>>  > > ps:my test code
>>  > > >  > > //define the type of inputting picture;
>>  > > Heder("content-type:image/png");
>>  > > //create picture
>>  > > $pic=imagecreate(240,30);
>>  > > //define color
>>  > > $black=imagecolorallocate($pic,0,0,0);
>>  > > $white=imagecolorallocate($pic,255,255,255);
>>  > > //define font copied from windows2000
>>  > > $font="fonts/simhei.ttf";
>>  > > //define characters to output
>>  > > $str = 
>>chr(0xE8).chr(0xB5).chr(0x9B).chr(0xE8).chr(0xBF).chr(0xAA).chr(0xE7).chr(0xBD).chr(0
>>  > > x91)." www.ccidnet.com";
>>  > > //write ttf in picture
>>  > > imageTTFText($pic,20,0,10,20,$white,$font,$str);
>>  > > //create png picture
>>  > > imagepng($pic);
>>  > > //release the memory occupied by the picture
>>  > > imagedestroy($pic);
>>  > > ?>
>>  > >
>>  > > Can anybody give a reply?
>>  > >
>>  > > Thank you
>>  > > 
>>zhaoxd
>>  > >
>>  > >
>>  >
>>  >
>>  > --
>>  > PHP General Mailing List (http://www.php.net/)
>>  > To unsubscribe, visit: http://www.php.net/unsub.php
>>  >
>>  >
>>  >
>>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Issues displaying data from database & organizing by category

2002-03-15 Thread Jim

I'm new to PHP so bare with me please.  I'm collect data fine from mySQL
into an accociative array. I can display it fine.  Here's the issue:

** Looks like this:
GALLERY 1
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
GALLERY 3
  Item Name Item Desc

** Should look like this
GALLERY 1
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
  Item Name Item Desc
GALLERY 3
  Item Name Item Desc

I have 2 tables: tblGalleries and tblItems. tblItems has a column
(itmGalley_ID) that corresponds to the gallery it belongs to in
tblGalleries (galID).  I've got my SQL set right (I've tested with mysql
command line).  But I can't get it to display the Gallery (galName),
every item within that gallery, and the next Gallery name going down
with its items and so on.

I've tweaked the while statement, tried foreach loops, reorganizng that
arrys but to no avail.

Bit of my code:

 
  





  
  
Item Name
Item Desc
  
  



  


Simple issue I'm sure but frustrating..Thanks for the help..


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




[PHP] run php in commandline

2001-10-31 Thread JIM

hi all,
i want to know how i can feed a parameter into a php script in commandline?
eg.
php getdata.php apple orange

so, i want to get use of "apple" and "orange"...
any help pls!

jim




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




[PHP] run php in commandline

2001-10-31 Thread JIM

hi all,
i want to know how i can feed a parameter into a php script in commandline?
eg.
php getdata.php apple orange

so, i want to get use of "apple" and "orange"...
any help pls!

jim





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




[PHP] fto_connect() failed??

2001-11-01 Thread JIM

hi all,
i was developing in redhat 7.2. with php/4.0.4pl1. iwas able to use
ftp_connect().
but, in a freebsd with php/4.0.6, it returns error that "call to undefined
function"...
anyone can help?
thanks.
im





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




Re: [PHP] ereg help

2001-12-03 Thread Jim

This is a good starter about PHP and regular expressions.

http://www.phpbuilder.com/columns/dario19990616.php3


>- Original Message -
>From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001 6:35 PM
>Subject: [PHP] ereg help
>
>
>>  I'm not new for php, but have no experience working with ereg functions.
>My
>>  problem is the following:
>>
>>  i have string.. for example
>>  $s="id {name,title,nick} [http://www.php.net]";;
>>  i want to break it in several parts:
>>  $p[0]="id";
>>  $p[1][0] ="name";
>>  $p[1][1] ="title";
>>  $p[1][2] ="nick";
>>  $p[2]="http://www.php.net";;
>>
>>  The part in [] is not neccessary, count of {} elements is not less than 1
>>  I can do it with string fucntions, but it seemes to me it's better to use
>>  regular functions.
>>
>>  Could anybody help me to solve this problem and advise resource for
>studying
>>  regular expresions?
>>
>>  Zliy Pes, http://zliypes.com.ua
>>
>>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] RealMedia

2001-12-03 Thread Jim

This must be the first output of your script.

header ("Content-type: audio/x-pn-realaudio");

and then your output should be in .ram file output.

Is this what you are asking?


>Hi guys,
>
>I want to write a script that inputs a file variable then it sends 
>out a RealMedia header so that it sends the file location to 
>RealPlayer.
>
>EG:
>
>If I click on http://www.randumian.co.uk/getsample.php?file=1234.rm, 
>it should send the headers so that the computer thinks its a .rpm 
>file then send me to http://www.randumian.co.uk/realaudio/1234.rm.
>
>Can anybody advise me on what to do please?
>
>Randum Ian
>DJ / Producer / Web Designer
>[EMAIL PROTECTED] - 07903 067339
>Webmaster: http://www.randumian.co.uk
>Webmaster: http://www.danceportal.co.uk


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] problem with ImageCreateJPEG ...

2001-12-03 Thread Jim


It is difficult to know where your problem is without more information.

It would appear that your jpeg file is not valid. Try another .jpg file.

Post the problem code, too.






>Hello all,
>anyone can help me 
>
>in line command to configure php :
>'./configure' '--with-mysql'
>
>'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'
>
>'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'
>
>'--with-png-dir=/usr/src/packages/SOURCES/libpng/'
>
>'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'
>
>'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'
>
>in result of phpinfo() :
> gd
>
>  GD Support
>  enabled
>
>  GD Version
>  1.6.2
>or higher
>  JPG Support
>  enabled
>
>  PNG Support
>  enabled
>
>  WBMP Support
>  enabled
>
>
>
> zlib
>
>  ZLib Support
>
>enabled
>  'zlib:' fopen wrapper
>
>enabled
>  Compiled Version
>
>1.1.3
>  Linked Version
>
>1.1.3
>
>
>,but when use ImageCreateFromJPEG:
>
>Warning:  imagecreatefromjpeg: .../testout.jpg' is not a valid
>JPEG file in ../a.php on line 4
>
>Warning:  Supplied argument is not a valid Image resource in
>../a.php on line 14 =>> ImageJPEG()
>
>what is my problem????
>
>--
>Best Regards
>Miguel Joaquim Rodrigues Loureiro
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Session_start() issue??

2001-12-03 Thread Jim


If you redirect using the full (http://foo.bar/rex...) URL, it may be 
restarting your session. Try using relative URLs.


>Hi all,
>Has anyone seen this.  I have a login form (login.htm) which calls a login
>handler (check_login.php).  If the login is sucessfull the check_login.php
>will set a couple session variables, then redirect the user to a menu page. 
>The problem I am seeing is that when I call session_start() from the menu
>page, I get a new session reference rather than a reference to the session
>I started in the check_login.php.  Is there a setting in the php.ini I
>should change?
>
>Any thoughts would be greatly appreciated.
>
>Chris
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Session_start() issue??

2001-12-03 Thread Jim


Also read about session management at http://php.net/session


>Hi all,
>Has anyone seen this.  I have a login form (login.htm) which calls a login
>handler (check_login.php).  If the login is sucessfull the check_login.php
>will set a couple session variables, then redirect the user to a menu page. 
>The problem I am seeing is that when I call session_start() from the menu
>page, I get a new session reference rather than a reference to the session
>I started in the check_login.php.  Is there a setting in the php.ini I
>should change?
>
>Any thoughts would be greatly appreciated.
>
>Chris
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




[PHP] Duplicating a mySQL row

2001-12-03 Thread Jim


What's the best way to duplicate a mysql row with PHP and MYSQL?

-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




[PHP] Re: Duplicating a mySQL row

2001-12-03 Thread Jim


It appears that this is forbidden ...

 From mysql.com:

The target table of the INSERT statement cannot appear in the FROM 
clause of the SELECT part of the query because it's forbidden in ANSI 
SQL to SELECT from the same table into which you are inserting. (The 
problem is that the SELECT possibly would find records that were 
inserted earlier during the same run. When using sub-select clauses, 
the situation could easily be very confusing!)



>   I don't know if it is the best but here's an idea:
>
>INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1;
>
>--
>
>Julio Nobrega
>
>Don't eat the yellow snow.
>
>
>"Jim" <[EMAIL PROTECTED]> wrote in message
>news:p0510100fb8318736de56@[192.168.1.17]...
>>
>>  What's the best way to duplicate a mysql row with PHP and MYSQL?
>>
>>  --
>>  Jim Musil
>>  -
>>  Multimedia Programmer
>>  Nettmedia
>>  -
>>  212-629-0004
>>  [EMAIL PROTECTED]
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]


Re: [PHP] Uploading to Apache server from VB

2001-12-03 Thread Jim


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

I've done this successfully both with PHP and VB/ASP. I think PHP is 
the easiest, but there are several things that could go wrong.

There is usually a 2MB limit to the file size and the safe mode 
setting also affects the outcome.

On the HTML side, you must include ENCTYPE=multipart/form-data in 
your  tag.

Once the file is uploaded (you can verify through phpinfo() command) 
you have to move it someplace. This can be tricky depending on how 
your server is set up. As a security, some servers do not allow 
scripts to save files.

One solution is to have your script open an ftp socket and put the 
file in the right place. This way, the script has the ftp password 
which should be kept secret from the user.


>Hello,
>
>I have a VB program which can download files from a web-site. The webserver
>is running Apache where we use PHP scripting. That is all working OK.
>
>Now I want to let certain people upload data from their PC's. I don't want
>to use FTP, because I don't want to hand out password's (also not in the
>code we are distributing). Anonymous FTP is not possible.
>
>I can upload files to the site from a browser, but I would to make it (very)
>easy for people to upload their data: a number of them are not very familiar
>with computers.
>
>I have seen (www.google.com) references to uploading from VB to IIS servers,
>but how about to Apache/PHP? I've tried some examples with the MicroSoft
>Internet Control and "executing" the POST command, but the file would not
>be uploaded (the PHP script did not get it anyway).
>
>Should it be possible?
>If so, can somebody point in the right direction/example?
>If not, could somebody please explain why not?
>
>Thanks in advance for your help,
>
>henk sandkuyl
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




RE: [PHP] Multidimensional array construction

2001-12-03 Thread Jim

This might be interesting ...

The function extract() allows you to extract all values from an array 
and prefix them with a specified string. What I didn't know until 
just a second ago was that you can supply a function as a string, so 
...

$my_array = array("a","b","c","d",array("a","b","c","d"));

$i = 1;

extract($my_array,EXTR_PREFIX_ALL,"SOMEVAL".$i++);

print "";

print $SOMEVAL_1;
print $SOMEVAL_2;
print $SOMEVAL_3;
print $SOMEVAL_4;
print $SOMEVAL_5;

print "";

... will produce:

a
b
c
d
[Array]

Which is cool. Not quite what you wanted, but maybe you could run with it.

Jim



>
>-Original Message-
>From: Darren Gamble [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, December 04, 2001 10:37 AM
>To: PHP List
>Subject: [PHP] Multidimensional array construction
>
>
>Here's a question for the list:
>
>I have a two-dimensional array; essentially a list of arrays.  Each element
>(an array) can have any number of elements.  As a small example:
>
>(
>   ( "foo" , "bar" , "red" , "apple" ),
>   ( "foo" , "bar" , "red" , "car"),
>   ( "foo" , "green" )
>)
>
>I would like to traverse this array and place all of the data into another
>multidimensional array.  The following statements illustrate how I'd like to
>do this from the example:
>
>$myarray["foo"]["bar"]["red"]["apple"] = $some_value1;
>$myarray["foo"]["bar"]["red"]["car"]   = $some_value2;
>$myarray["foo"]["green"]   = $some_value3;
>
>Is there any way to easily do this in PHP?  I could "cheat" and use eval(),
>but there is probably a better way.  I have thought of using each() or
>references, but nothing has come to mind so far.
>
>Any ideas?  Should I just use eval() ?
>
>
>Darren Gamble
>Planner, Regional Services
>Shaw Cablesystems GP
>630 - 3rd Avenue SW
>Calgary, Alberta, Canada
>T2P 4L4
>(403) 781-4948
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




RE: [PHP] Multidimensional array construction

2001-12-03 Thread Jim


oops. That's not correct. I wish it was though! ;)


>This might be interesting ...
>
>The function extract() allows you to extract all values from an 
>array and prefix them with a specified string. What I didn't know 
>until just a second ago was that you can supply a function as a 
>string, so ...
>
>$my_array = array("a","b","c","d",array("a","b","c","d"));
>
>$i = 1;
>
>extract($my_array,EXTR_PREFIX_ALL,"SOMEVAL".$i++);
>
>print "";
>
>print $SOMEVAL_1;
>print $SOMEVAL_2;
>print $SOMEVAL_3;
>print $SOMEVAL_4;
>print $SOMEVAL_5;
>
>print "";
>
>... will produce:
>
>a
>b
>c
>d
>[Array]
>
>Which is cool. Not quite what you wanted, but maybe you could run with it.
>
>Jim
>
>
>>
>>-Original Message-
>>From: Darren Gamble [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, December 04, 2001 10:37 AM
>>To: PHP List
>>Subject: [PHP] Multidimensional array construction
>>
>>
>>Here's a question for the list:
>>
>>I have a two-dimensional array; essentially a list of arrays.  Each element
>>(an array) can have any number of elements.  As a small example:
>>
>>(
>>   ( "foo" , "bar" , "red" , "apple" ),
>>   ( "foo" , "bar" , "red" , "car"),
>>   ( "foo" , "green" )
>>)
>>
>>I would like to traverse this array and place all of the data into another
>>multidimensional array.  The following statements illustrate how I'd like to
>>do this from the example:
>>
>>$myarray["foo"]["bar"]["red"]["apple"] = $some_value1;
>>$myarray["foo"]["bar"]["red"]["car"]   = $some_value2;
>>$myarray["foo"]["green"]   = $some_value3;
>>
>>Is there any way to easily do this in PHP?  I could "cheat" and use eval(),
>>but there is probably a better way.  I have thought of using each() or
>>references, but nothing has come to mind so far.
>>
>>Any ideas?  Should I just use eval() ?
>>
>>
>>Darren Gamble
>>Planner, Regional Services
>>Shaw Cablesystems GP
>>630 - 3rd Avenue SW
>>Calgary, Alberta, Canada
>>T2P 4L4
>>(403) 781-4948
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>--
>Jim Musil
>-
>Multimedia Programmer
>Nettmedia
>-
>212-629-0004
>[EMAIL PROTECTED]
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Dynamically created dropdowns

2001-12-04 Thread Jim

But, you can use PHP to dynamically create your .js file that your 
HTML file calls. Load each of your options and sub options into js 
arrays and write a js function that swaps out the pull down options 
on the onChange event of the previous pull down. Depending on the 
number of options you have, this may be an okay solution. At least 
with this method, your javascript will have up to date data.




>You can certainly do what you want in straight PHP if you include a form
>submission after selecting the manufacturer. There is probably a way of
>doing it in JavaScript without a form submission, but not one that will
>read data from a MySQL database on a remote machine. JavaScript can't do
>that.
>
>Michael
>
>On Tue, 4 Dec 2001, Michael Egan wrote:
>
>>  Hope this isn't an inappropriate message to send to this list. I suspect
>>  the response will largely concern JavaScript.
>>
>>  Is there a way of altering the contents of one drop down menu according
>>  to the item selected in another?
>>
>>  I'm creating a page allowing users to identify the make and model of
>>  computers received by our charity for refurbishment. Ideally I'd like to
>>  allow them to select a manufacturer from a drop down menu and for a
>>  separate drop down menu to then be populated by the models produced by
>>  that manufacturer.
>>
>>  I have two separate tables in a MySQL database, one for manufacturers
>>  and one for models with the latter containing a field for the
>>  manufacturer ID.
>>
>>  Is this possible?
>>
>>  Michael Egan
>>
>>
>
>--
>
>Michael Hall
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>http://openlearningcommunity.org
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] sizeof($array) with a twist

2001-12-04 Thread Jim


array_count_values() does something like this. It groups together
values and tells you how many times they occur in an array...

example


$array = array(
array("foo","bar","rex"),
array("foo","bar","zip"),
array("foo","bar","zoo"),
array("foo","bar","rex"));

/* put all elements into one array */

foreach($array as $val) { $temp_array[] = $val[2];}

/* count values. see php.net/array_count_values */

$count = array_count_values($temp_array);

print"";
print_r($count);
print"";


this produces ...

Array
(
 [rex] => 2
 [zip] => 1
 [zoo] => 1
)




>I'd like to count the number of rows in a 2 dimensional array that
>have the same data in their fifth field. Is there a PHP function
>that does this? Sizeof() appears to lack condition parameters...
>
>...Rene
>
>---
>René Fournier
>[EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] ASP to PHP ...

2001-12-04 Thread Jim


This really depends how complicated your ASP system is. Presumably, 
your current system has many components that make it work correctly 
with the server and MS Access. The hardest part will be getting PHP 
to function as expected in that environment.

The actual code is easy to translate, but you'll probably end up 
rewriting everything from scratch to take advantage of PHP's 
strengths. Just don't forget your semicolons!

PHP can link up well with MS Access, but there aren't a lot of 
example scripts out there to work with. Little things can drive you 
nuts -- like trying to find the unique id of your last db insert.

>I have been asked to convert an ASP/MS Access system to PHP. I would be
>interested in hearing the thoughts of anyone with exp. of  this. Thanks.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Extract data

2001-12-04 Thread Jim


The pipe "|" is a regex special character that allows you to specify
multiple options (as in "1|0" will find 1 or 0. Your code will work
if you escape the pipe as such...

25: list(q1,q2,q3,q4,q5)= split ("\|", $answer, 5);

But, it won't work unless you put the $ in front of your variables in
your list constructor

Jim

>Content-type: text/plain;
>Content-encoding: base64
>
>Hello guys
>
>I'm making poll script that stores  data like this:
>
>0|0|0|0|0
>
>
>
>
>But i'm getting this error all the time:
>
>Warning: unexpected regex error (14) in c:\program files\apache
>group\apache\htdocs\eztatic\poll.php on line 25
>
>25: list(q1,q2,q3,q4,q5)= split ("|", $answer, 5);
>
>
>Could any help
>
>Thank you very much in advance
>
>
>
>-
>Hot Mobiil - helinad, logod ja piltsõnumid!
>http://www.hot.ee
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] header("Location:blah...") - passing variables

2001-12-04 Thread Jim


There are many different ways to do this ...

1. Have the same PHP script that validates generate the login page. 
This way the script always has the correct data and you don't need to 
pass anything.

2. Header("Location: login.php?err=$err&user=$user&pass=$pass");
This will work, but the bad password will be visible in the query string.

3. Start a session at the login page and register the variables you 
need to use on the login page.

Jim




>Hi,
>
>I wonder if someone could tell me whether or not the following is
>possible?
>
>I have an HTML form which passes a username and password to a PHP script
>for validation. If either is not valid, I would like it to return to the
>previous page - carrying with it a variable plus the submitted form
>information...
>
>=-=-=-=-=-=-=-=-=
>if (strlen ($password1) <4 ) {
>$err = "Password must be more than 4 characters long";
>header("Location:http://somelocation.php";);
>// ^-- at the location, the $err and form variables will be available
>
>exit;
>}
>=-=-=-=-=-=-=-=-=
>
>Is it possible to this without using an HTML form?
>
>Thanks very much in advance.
>
>- Best regards,
>
>Lee
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Extract all fields of a table to vars of same name

2001-12-04 Thread Jim


I do this ...

$query = mysql_query("SELECT * FROM foo");
$data = mysql_fetch_assoc($query);
extract($data);

if you need all the rows from the query, do ...

$query = mysql_query("SELECT * FROM foo");
while($data = mysql_fetch_assoc($query) {

extract($data);

}


Jim

>Someone came with a very clever solution to simplify the extraction of all
>fields when doing aselect * from table
>
>it's a command that passes all values from the fields on the table 
>to variables
>of the same name than the field on that table.  No need to program 
>it manually,
>creates all variables with same names as the table fields.
>
>Could someone tell me how to do this?
>
>Alfredo
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] session in https

2001-12-04 Thread Jim


Unless you have an unstated purpose for serializing/unserializing, 
it's not necessary because PHP automatically serializes and 
unserializes your session variables.

Can you see the correct values if you insert the phpinfo() command?

If you can that should give you a clue as to how to reference them, 
if you can't then you aren't setting them correctly.

>I am trying to set some sessions variables in an https (SSL):
>session_start();
>...
>$row = $results[0];
>session_register("myses");
>if(session_is_registered("myses")){
>$myses=array("id"=>$row["user_id"],"username"=>$row["username"],"password"=>
>$row["password"]);
>$myses=serialize($myses);
>}
>
>the to go to another php script in where I want to call my vars i use:
>Please continue
>
>in the delivery.php I want to call the session vars:
>session_start();
>...
>$myses=unserialize($myses);
>echo "Session ID: " .$PHPSESSID .NL;
>echo "ID..." .$myses["id"] . NL;
>echo "username..." .$myses["username"] . NL;
>
>I receive blanks ... although the session is set in the /temp directory. It
>has a value in it but I don't have permission to read the value of my sess.
>
>By the way... I use php4.06
>
>Please help
>
>THX
>
>Luc
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] How to resize a jpeg?

2001-12-04 Thread Jim


The algorithm for imagecopyresized() that comes with PHP isn't very 
good. Read up on it in the user comments here:

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

There, a user has supplied a better function...


>Hi,
>
>after getting gd to work (thanx folks!) I am having some probs with the
>commands.
>
>The simple resize of a jpeg cant be that hard?!
>
>I have a 600x400 px jpeg and want to make a 80 x 60 out of it.
>
>Do I have to use imagecopyresized? And how. The result looks bad right now.
>
>Thanx,
>
>Andy
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] How to resize a jpeg?

2001-12-04 Thread Jim


Since you have GD and libjpeg installed now, you can perform 
transformations from the shell and hence, from php through the exec() 
command. Such as ...

exec("djpeg -scale 1/8 test.jpg | cjpeg -outfile test_thumb.jpg");

Here's a link to the man page for djpeg and cjpeg...

http://nodevice.com/sections/ManIndex/man0253.html

You may find better results adjusting these settings.

Be aware that exec() , if used improperly, can be a security hole if 
you use a user supplied variable for your exec argument.

>Hi,
>
>after getting gd to work (thanx folks!) I am having some probs with the
>commands.
>
>The simple resize of a jpeg cant be that hard?!
>
>I have a 600x400 px jpeg and want to make a 80 x 60 out of it.
>
>Do I have to use imagecopyresized? And how. The result looks bad right now.
>
>Thanx,
>
>Andy
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Column name not liked by PHP/ODBC and Access

2001-12-04 Thread Jim


I've searched high and low for _good_ PHP/MSACCESS info, but the fact 
is not that many people use it.

What I've found very helpful is to use MS ACCESS' SQL builder to test 
out my queries. Fairly reliably, if it works there, it'll work in PHP.

Jim



>On Tuesday 04 December 2001 22:47, Andrew Hill wrote:
>>  mweb,
>>
>>  Just a guess - is Note a reserved word?  you might want to quote/escape it.
>
>Excellent idea. Actually, putting Note between double quotes gives:
>INSERT INTO Red (ID, Nome, Nickname, Username, password, pict, "Note",
>admin, playlist, email, ruolo, web) VALUES (NULL , "mweb", "webfm",
>"webfm1", "12321", "0", "", "on", "on", "e2e2e", "222e", "www.ni.it");
>
>
>Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] '' is not a
>valid name. Make sure that it does not include invalid characters or
>punctuation and that it is not
>too long., SQL state 37000 in SQLExecDirect in
>C:\domini\musicboom.net\cng_red.php on line 71
>Error(no cursor odbc_exec)
>
>   How else could I escape Note, and what this last message means?
>
>In general do you know about *detailed* tutorial for MS access via odbc?
>
>   TIA,
>   mweb
>
>P.S.: special thanks to Andrew Hill who is always very fast and patient in his
>answers
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Column name not liked by PHP/ODBC and Access

2001-12-04 Thread Jim

You could just rename the column in the db.

Putting quotes around Note is not the solution because the quotes are 
causing the invalid name error. I don't see that Note is a reserved 
word anywhere.

Access is quite picky about what data you send it. For instance, if a 
field is set to require some input, then it will error out if you 
don't supply any.

Jim

>On Tuesday 04 December 2001 23:25, Jim wrote:
>>  I've searched high and low for _good_ PHP/MSACCESS info, but the fact
>>  is not that many people use it.
>
>I know. It's not my choice, believe me.. :-((
>
>>  What I've found very helpful is to use MS ACCESS' SQL builder to test
>>  out my queries. Fairly reliably, if it works there, it'll work in PHP.
>
>Fine, but I guess it won't run on my Linux PC, will it? I'll search the web
>for examples of its usage, anyway. Any pointer is appreciated.
>
>
>   Thanks,
>   mweb
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] delete array item and resort

2001-12-05 Thread Jim

$array = array("a","b","c");

print_r($array);

unset($array[1]);

print_r($array);

$array = array_values($array);

print_r($array);

--

produces

Array ( [0] => a [1] => b [2] => c )
Array ( [0] => a [2] => c )
Array ( [0] => a [1] => c )

Jim

>what is the easiest way to delete an array element and then resort the array
>so the elements receive the correct numbering.
>
>I was thinking something like this:
>
>$itemArray = array("red","blue","yellow");
>delete("$itemArray[1]");
>
>so key 0 is still "red" but key 2 is still yellow but is remembered to
>become key 1.
>
>Hopefully that makes sense, get rid of one item in the middle and the rest
>of the array moves up one position.
>Thanks,
>» Michael Krisher
>   [EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] possible to override session.auto_start in php.ini

2001-12-05 Thread Jim


How about another ISP?


>I've read the manual notes for ini_set, so I have a feeling the answer to my
>question is no, but I'd like to make sure.
>
>I have no control over my ISP's php.ini file, but the fact that they have
>session.auto_start set to 1 in php.ini is causing me problems.
>
>Is there any way to override this?  The manual says that session.auto_start
>isn't one of the settings that can be manipulated by ini_set, so I'm looking
>for alternative methods. 
>
>Thansk.
>
>--kurt
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] How do I pass variables from a PHP script to an HTMLdocument?

2001-12-05 Thread Jim


Why don't you try sessions? They make this sort of thing easy by 
letting you store all the data in $form and making it available on 
subsequent requests to this or other scripts.

http://php.net/sessions

Jim

>Hi,
>
>I currently have a form that calls a PHP script when submit is 
>pressed.  Within the PHP script, I wish to call a custom 
>confirmation screen.  I do so by issuing the following command:
>
>Header("Location: " . $form["redirect"]);
>
>Now, I wanted my form variables passed from the PHP script to my 
>HTML document so I wrote a function within the form that adds the 
>variable names and values to the URL by urlencoing them like such:
>
>$output = "?";
>$output .= urlencode($key) . "=" . urlencode(stripslashes($val)) . "&";
>
>returning the above in a variable $vars, I call my redirect as such:
>
>
>Header("Location: " . $form["redirect"] . $vars);
>
>If I am not mistaken, this is synonymous with an HTTP GET?
>
>Here is my problem; the above fails with a large form, i.e., a form 
>containing many fields.  A bit of investigation has determined that 
>there is a 1Kb limit on the total size of a request (URL+params) and 
>I have one form that must be exceeding the limit.
>
>Question: Is there a way to emulate my above scheme via an HTTP POST 
>as POST has no limit?  Alternatively, is there another way to pass 
>variables from a PHP script to a HTML form where I won't run into 
>this limit?
>
>Thanks,
>Don


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] What is causing duplicate keys?

2001-12-05 Thread Jim


You should specify the column names to prevent this from happening.

Such as ...

INSERT INTO rcensioni (col1,col2,etc) VALUES ('value','value','etc...')

Just make sure you don't specify the column that is autonumbering.

Jim

>Hello,
>
>Always struggling on my php-odbc-MS access project, I managed to successfully
>add a record to a table.
>
>Now, no matter what I write in the first field (random numbers, AUTO,
>AUTO_INCREMENT...)
>
>I get this:
>
>Insert Into recensioni VALUES (300, 'riee', 'reworew', 'wer', 2001,'IT', 2.5,
>'dond to it, 'rew', 'uno',1, 'Caro', 3, 'stuff',
>20011205201040, 'writeurl, 1, '5/12/2001 20.10.40', '1', '1','enter keyword')
>
>Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The changes you
>requested to the table were not successful because they would create duplicate
>values in the index, primary key, or relationship. Change the data in the
>field or fields that contain duplicate data, remove the index, or redefine
>the index to permit
>duplicate entries and try again., SQL state 23000 in SQLExecDirect in
>C:\domini\mnet\inser_rec.php on line 109
>Error in odbc_exec( no cursor returned )
>
>How can I find out what I am duplicating? The first field is the unique key,
>but what should I send to Access to tell it just auto increment and go?
>If I put 0 or NULL it complains.
>Also, Andrew Hill siggested the use of odbc_tables and odbc_columns to get
>info about the structure of each column which I don't know in detail because 
>the DB was written by the guy who quit, not me)
>What is the exact syntax of those instructions? I have tried to apply the
>manual, but without success on the second one.
>
>   TIA,
>   mweb
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




Re: [PHP] Is php safe for e-commerce applications?

2001-12-05 Thread Jim


Would sprintf() handle your needs?

This seems to work correctly...

$val = sprintf("%.0f",(10*(8.20-0.20)));

produces a string $val equal to 80.

Is this too geeky?

Jimtronic


>What a scary day, and it just gets worse
>
>1. A user finds their account balance is displayed incorrectly on 
>one of my live e-commerce sites.
>
>2. I discover that "floor()" intermittently gives the wrong answer i.e.
>
>print floor(10*(8.20 - 0.20));
>Answer : 79
>
>print floor(10*(8.10 - 0.10));
>Answer : 80
>
>(php 4.0.6 and 4.0.4.pl1 under Linux 2.2.19.)
>
>3. I find this is a known "feature" with no intention of ever being fixed. See
>http://bugs.php.net/bug.php?id=6220
>
>print floor( (0.7 + 0.1) * 10);
>Answer : 7
>
>
>4. I check the php documentation that was added because of that bug
>(http://www.php.net/manual/en/language.types.float.php) and discover :-
>
>   "never trust floating number results to the last digit and never 
>compare floating point numbers
>for equality."
>
>5. I realise that the "last digit" might also be the first so that 
>means never trust anything except
>integers!
>
>6. The truth really sinks in... It seems I simply cannot use php for 
>e-commerce applications unless
>I convert all money to integers e.g. $4.32 must be handled as 432 
>cents, or all arithmetic
>operations and comparisons have to be converted to use bc functions. 
>Instead of :
>
>  if ($cost == 10.00)
>you must write
>  if (bcomp($cost,10.00,2)) == 0)
>etc.,etc.
>
>7. The horror unfolds...  php is just as full of geeko-trash as 
>C/Perl/Java and the rest of them! I
>will have to spend the rest of my life worrying about 
>types/casts/floating point precision and all
>that garbage even when I'm just adding up dollars and cents! I can't 
>even escape to Italy and work
>in Lira, they're switching to  euros with decimal places too! I 
>should have stayed with Java, it may
>be rubbish but at least it's obviously rubbish!
>
>
>Please someone, tell me I'm wrong!
>
>Tell me that 0.1 + 0.7  can be 0.8 and not almost 0.8! 
>Tell me I don't have to check the last three years of work!
>Tell me php isn't just for kids waiting to graduate/degradate to Java!
>Tell me the techno-geeks haven't won!
>
>Hell..
>
>
>George
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




[PHP] require_once

2010-10-18 Thread jim
 I'm having a problem including files using Zend Framework. I have in a 
controller file this


require_once "models/Member.php"; and it doesn't work ,nor does

require_once "../models/Member.php";

Anyone know what's going on with this?

Jim W.



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



Re: [PHP] require_once

2010-10-19 Thread jim
 I am following an example. Also, doesn't that require the class name 
to be something like models_members?


Jim

On 10/19/2010 09:40 AM, chris h wrote:


 I'm having a problem including files using Zend Framework. I have
in a controller file this


Jim why not use the Zend autoloader?


Chris.




[PHP] Can't find .php3 files

2008-01-08 Thread Jim
I'm sure this is a FAQ but I can't seem to come up with the right search 
keys to dig it out. 

I'm trying to help a friend migrate his application to php 5 from 
another system.  The problem seems to be that he references files 
(require, include, etc) that have a .php3 extension, however there are 
no files in those locations with the .php3.  There are files with .php 
extensions.  It's running on a system that has php 4 on it.


So I'm sure either php or Apache is rewriting the files somehow, but I 
don't know how.


Can someone please point me to the appropriate documentation or give me 
a hint as to what is going on here?


Thanks,
Jim.

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



Re: [PHP] Can't find .php3 files

2008-01-08 Thread Jim

Chris wrote:


I'm trying to help a friend migrate his application to php 5 from 
another system.  The problem seems to be that he references files 
(require, include, etc) that have a .php3 extension, however there 
are no files in those locations with the .php3.  There are files with 
.php extensions.  It's running on a system that has php 4 on it.


If you can ssh in to the server, go to the base folder of the app and:

grep -nri 'php3' *

and make sure there are no references in the code to php3 files.

Else try the same in windows search or using your editor, see if it 
has a 'find in files' type option.


So I'm sure either php or Apache is rewriting the files somehow, but 
I don't know how.


Check for a .htaccess file.

See if apache is set up to handle php3 files, look for something like 
this in the config:


AddType application/x-httpd-php .php3


If this is causing a fatal error, your logs should also tell you where 
to start looking. The apache2 error logs are pretty good, eg:


[date] [error] [client ipaddr] PHP Warning: 
include(../includes/db.php): failed to open stream: No such file or 
directory in /path/to/file.php



I think you misunderstood.  I have lots of file with things like

require "admin.php3"

But there is no admin.php3 anywhere.  There is however a file admin.php.
Since this works on the old server then something on that system is 
translating a request for a .php3 file to .php I'm guessing. Apache or 
php but I don't know which.


The old server is a Linux system, while the new one is a bsd system (OS X).

Both systems have the
AddType application/x-httpd-php .php3
Line in their configuration. 


Thanks,
Jim.

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



Re: [PHP] Can't find .php3 files

2008-01-08 Thread Jim

Chris wrote:



I think you misunderstood.  I have lots of file with things like

require "admin.php3"

But there is no admin.php3 anywhere.  There is however a file admin.php.
Since this works on the old server then something on that system is 
translating a request for a .php3 file to .php I'm guessing. Apache 
or php but I don't know which.


It will be apache.

It will have the handler I mentioned before:

AddType application/x-httpd-php .php3

Add that in (with an appropriate comment) to your new config and 
restart apache.


Voila!


Look at my last email.  I said

Both systems have the
AddType application/x-httpd-php .php3
Line in their configuration.
And the new one has been restarted more than once.  In fact that line 
was in there from the start, I didn't add it.

I'll have to look to see what config file it's in to be sure it's included.

Thanks,
Jim.

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



Re: [PHP] Can't find .php3 files

2008-01-09 Thread Jim

Ford, Mike wrote:

Chris wrote:
  

I think you misunderstood.  I have lots of file with things like

require "admin.php3"

But there is no admin.php3 anywhere.  There is however a file
admin.php. Since this works on the old server then something on
that system is translating a request for a .php3 file to .php I'm
guessing. Apache or php but I don't know which.
  

It will be apache.



If the line quoted above is exactly as it appears in the PHP script, then it 
will definitely *not* be Apache. A require with just a filename like that goes 
straight to the file system, with nary even a hint of a thought  of involving 
Apache.  So the admin.php3 file must exist *somewhere* in the file system.

As someone else suggested, I think your best bet is to examine the include_path 
setting in php.ini (via a phpinfo() script if necessary).

Cheers!

Mike

  

Hi, Mike,

The include is more like
require "../admin/admin.php3" 
I don't know exactly how Apache performs its magic so I wasn't sure that 
the request for an include file would even pass through Apache's hands.  
In my limited world, an include wouldn't have to involve Apache, just 
the file systems.


We did look at the php.ini file in /etc and it was pretty much 
innocuous.  Looked like a default from when the system was installed.  
I'll have a closer look today.


Thanks.
Jim

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



Re: [PHP] Can't find .php3 files

2008-01-09 Thread Jim

Ford, Mike wrote:

On 09 January 2008 12:18, Anup Shukla wrote:

  

Jim wrote:


Hi, Mike,

The include is more like
require "../admin/admin.php3" I don't know exactly how Apache
performs its magic so I wasn't sure that the request for an include
file would even pass through Apache's hands.  In my limited world,
an include wouldn't have to involve Apache, just the file systems.

  

The admin.php3 seems to be 2 levels above the current dir.

What about

print realpath("../admin/admin.php3")

in the same script?



That's quite a good suggestion.

Just to be clear about the other point, an include or require is purely file 
system based, *unless* you give it a full URL beginning with a protocol name 
such as http:// or ftp:// (which, as a general rule, is somewhat 
disrecommended!).

  

Thank you, that confirmed what I suspected.

Jim.

Cheers!

Mike


  


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



Re: [PHP] PHP Testing

2003-01-02 Thread Jim Lucas
Well, I have been chaning different settings the past few days and noticed
that my messages had not been posted to the board.  Finally got it going.

But here is my question, now that my email IS working.

can you override the engine setting in the virtual host block

I am running
  Apache 1.3.26 & PHP 4.2.2

ie:

in the global area of the httpd.conf file I put
  php_admin_value engine Off

and then do the following for my VirtualHost blocks


  DocumentRoot  /some/path/public_html
  php_admin_value engine On



When I do this.  PHP doesn't parse the files.

It just prints the php code in the sent page.

Is this possible, can it be done,  and if so, how?

Jim


- Original Message -
From: "Paul Marinas" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 02, 2003 4:33 PM
Subject: Re: [PHP] PHP Testing


> :)
>
> Paul Marinas
> Technical Support
> RDS Craiova
>
>
> Phone:  +402-51-410-194
> Mobile: +407-22-451-439
> Fax:+402-51-416-579
> www.rdsnet.ro
> .
>
> Privileged/Confidential Information may be contained in this message. If
you
> are not the addressee indicated in this
> message (or responsible for delivery of the message to such person), you
may
> not copy or deliver this message to
> anyone. In such a case, you should destroy this message and kindly notify
> the sender by reply e-mail.
>
> On Thu, 2 Jan 2003, Jim Lucas wrote:
>
> > checking return emails..
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




[PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jim MacCormaic
Hi all. I'm new here, currently implementing my first PHP/MySQL website 
on an iMac running Mac OS X v.10.2.3.

All has been going really well until just now while I was adding 
records to the MySQL database. I have a table which includes an 
auto-incremented field which is set as the Primary key. I was happily 
entering information and then suddenly got a warning of an error in my 
MySQL query, telling me that I had a 'duplicate entry "255" for key 1'.

I've checked the relevant table in PHPMyAdmin and, sure enough, under 
Row Statistic in the Structure option it gives a value of 255 for the 
Next Autoindex even though that value was already assigned in the 
previous record. I feel as if I've hit a brick wall on this one. I ran 
Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations 
and all reported 'OK'. I'm using a PHP form to insert the records and 
have code included to print out the MySQL query and to report errors 
(hence the warning which I received). The field in question is of type 
tinyint(4), unsigned, not NULL and, as stated, is the Primary key and 
set to auto-increment.

Have I hit some sort of limit by reaching an id of 255? If so, can I 
fix this? Any help would be appreciated, as my database has to all 
intents and purposes lost its functionality once I cannot add further 
records.

Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jim MacCormaic
On Friday, January 3, 2003, at 08:59  am, Leif K-Brooks wrote:


The limit to tinyint is 255... use int.


On Friday, January 3, 2003, at 09:02  am, Jasper Bryant-Greene wrote:


Change the field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED 
TINYINT only has a range of 0 thru 255.

Thanks so much guys. I've made the change, tried again, and all is 
well. I opted for SMALLINT because its range is more than adequate for 
my needs. Whew! Relief!

Sorry for not thinking of going first to the source. Having read your 
posts I went back to the MYSQL manual and checked out Column Types. In 
my defence all I can say is that I'll remember it better this way ;-)


Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] Windows PHP vs Linux PHP

2003-01-15 Thread Jim Lucas
it has to do with declaring all php variables before using them in the
script.

$var='';

then do something with the variable.

Jim
- Original Message -
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 9:52 AM
Subject: [PHP] Windows PHP vs Linux PHP


> Hi,
>
> I asked previously about the differences between the two and the concensus
> was any differences are in the operating systems themselves and not with
> PHP. Knowing this, how do I get rid of these errors that keep coming up in
> Windows, that don't in Linux. One specific one is  "Notice: Undefined
> variable: add in E:\IIS Webs\address.php on line 3"
>
> Someone said to turn on register_globals which I have. Another suggestion
> was to put a @ sign in from of all variables. This is a real pain. Anyone
> have any other suggestions, or is this basically it?
>
> Also, is there anything else that anyone can think of that I may have to
> look forward to using PHP under Windows?
>
> TIA
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] $HTTP_GET_VARS

2003-01-17 Thread Jim Lucas
checkout the most recent version of the help documents from php.net.  it
will tell you.

something to do with $_GET,  i think...

Jim
- Original Message -
From: "Mike Tuller" <[EMAIL PROTECTED]>
To: "php mailing list" <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 2:05 PM
Subject: [PHP] $HTTP_GET_VARS


> I am following an example in a book and have run into a problem with a
> script that I am trying to run under PHP 4.3.0. What I have is a page
> that you click on an id number that is from a listing in a database,
> and it is supposed to take you to a page to edit that item. I have the
> id sent in the url (http://127.0.0.1/asset/editasset.php?id=3) and the
> book says to use $HTTP_GET_VARS to take that id and display the record
> for editing on a separate page. When I use $HTTP_GET_VARS nothing is
> returned, and I am thinking that I can't use $HTTP_GET_VARS in PHP
> 4.3.0, so what do I need to use?
>
> Thanks,
> Mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Loop inside a table

2003-01-20 Thread Jim Lucas
instead of doing that your should do this

$message = "



title goes here


";

for ($x = 0; $x < $num_rows; $x++)
{
$message .= "some stuff";
}

$message .= "
";

you were also missing your last double quote.

Jim

- Original Message -
From: "Cesar Aracena" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 9:37 AM
Subject: [PHP] Loop inside a table


Hi all,

I always make for loops inside tables so I usually don't have problems
with it, but this case is a little different. I'm making a mail program
for my client to receive a mail each time a customer places an order in
his site.

Inside the mail program, I declaring a value called $message where an
HTML form is being created dynamically, depending on the products
selected by the customer or visitor.

The problem is that PHP apparently won't let me do a for loop inside
this variable. I have something like this:

$message = "



title goes here


".
for ($x = 0; $x < $num_rows; $x++)
{
//several lines made dynamically
}
."

;

and the error goes like: unexpected T_FOR in line xxx (where my for loop
is). I've never tried this in the past, so I assumed it had to be done
normally but I see I was mistaken. Anyone did this before? What's the
problem here?

Thanks in advance,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




--
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] Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Jim Lucas
I would add the modification time of the file in question with

filetime($filename);

that way you will be sure to get a unique argurment.

Jim

- Original Message -
From: <[EMAIL PROTECTED]>
To: "Chris Shiflett" <[EMAIL PROTECTED]>
Cc: "Phil Powell" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 10:48 AM
Subject: Re: [PHP] Cannot show reuploaded image file on page unless manual
refresh


>
>  Aha! Something I can chime in on. I happened across the same scenario a
> few months back. The list helped me then so I'll give back.
>
>  Call the image using a random identifier.
>
> $rand = rand(1000, );
>
> echo "http://someurl.com/image.jpg?$rand";;
>
> Since the browser will more than likely not have the image file identified
> by the random number it must request it again from the server. Works
> great where I need it!
>
> Ed
>
> On Mon, 20 Jan 2003, Chris Shiflett wrote:
>
> > --- Phil Powell <[EMAIL PROTECTED]> wrote:
> > > I am using the following header() functions to force
> > > view.php to not cache:
> > >
> > > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> > > header("Last-Modified: " . gmdate("D, d M Y H:i:s") .
> > > " GMT");
> > > header("Cache-Control: no-store, no-cache,
> > > must-revalidate");
> > > header("Cache-Control: post-check=0, pre-check=0",
> > > false);
> > > header("Pragma: no-cache");
> >
> > :-)
> >
> > I think you killed it.
> >
> > > However, when a user reuploads a file in manage.php, it
> > > does a form post onto manage.php and reuploads the file
> > > (which I verified works).  However, when redirected via
> > > header() to view.php, they still see their OLD image
> > > file, NOT the new one!  Unless I manually refresh the
> > > page, they never see it, until they manually refresh the
> > > page, then the new image file appears!
> >
> > Right.
> >
> > I think you are forgetting that the image is not really
> > part of the PHP resource. Meaning, this is the series of
> > events for a PHP script that refernces a single image
> > called bar.jpg using the  tag:
> >
> > 1. HTTP request sent for foo.php (Web client -> Web server)
> > 2. HTTP response sent that includes the output of foo.php
> >(Web server -> Web client)
> > 3. Web client (browser) notices  tag referenced in
> >the HTML.
> > 4. HTTP request sent for bar.jpg (Web client -> Web server)
> > 5. HTTP response sent that includes bar.jpg
> >
> > So, the headers that you are setting only matter for the
> > resource returned in step 2. Meaning, the HTML output of
> > foo.php is not cached. The image, since it is returned by
> > the Web server and not your PHP script, is cached.
> >
> > Chris
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Re: Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Jim Lucas
i think you missunderstood what I said.

in the image tag that you create to display the image, you could do this



that would make the URL different when each page time the image was
replaced.

I would use filetime() because it would not cause extra downloads if the
file wasn't different.

if someone looked at the file 2 seconds apart and it didn't change, it was
waisted time and bandwidth down loading the file again.

Jim


- Original Message -
From: "Philip Hallstrom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 4:11 PM
Subject: [PHP] Re: Cannot show reuploaded image file on page unless manual
refresh


> I wonder if appending time() would be better... granular to a second and
> you save the filesystem lookup effort??
>
> On Mon, 20 Jan 2003, Jim Lucas wrote:
>
> > I would add the modification time of the file in question with
> >
> > filetime($filename);
> >
> > that way you will be sure to get a unique argurment.
> >
> > Jim
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: "Chris Shiflett" <[EMAIL PROTECTED]>
> > Cc: "Phil Powell" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Monday, January 20, 2003 10:48 AM
> > Subject: Re:  Cannot show reuploaded image file on page unless manual
> > refresh
> >
> >
> > >
> > >  Aha! Something I can chime in on. I happened across the same scenario
a
> > > few months back. The list helped me then so I'll give back.
> > >
> > >  Call the image using a random identifier.
> > >
> > > $rand = rand(1000, );
> > >
> > > echo "http://someurl.com/image.jpg?$rand";;
> > >
> > > Since the browser will more than likely not have the image file
identified
> > > by the random number it must request it again from the server. Works
> > > great where I need it!
> > >
> > > Ed
> > >
> > > On Mon, 20 Jan 2003, Chris Shiflett wrote:
> > >
> > > > --- Phil Powell <[EMAIL PROTECTED]> wrote:
> > > > > I am using the following header() functions to force
> > > > > view.php to not cache:
> > > > >
> > > > > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> > > > > header("Last-Modified: " . gmdate("D, d M Y H:i:s") .
> > > > > " GMT");
> > > > > header("Cache-Control: no-store, no-cache,
> > > > > must-revalidate");
> > > > > header("Cache-Control: post-check=0, pre-check=0",
> > > > > false);
> > > > > header("Pragma: no-cache");
> > > >
> > > > :-)
> > > >
> > > > I think you killed it.
> > > >
> > > > > However, when a user reuploads a file in manage.php, it
> > > > > does a form post onto manage.php and reuploads the file
> > > > > (which I verified works).  However, when redirected via
> > > > > header() to view.php, they still see their OLD image
> > > > > file, NOT the new one!  Unless I manually refresh the
> > > > > page, they never see it, until they manually refresh the
> > > > > page, then the new image file appears!
> > > >
> > > > Right.
> > > >
> > > > I think you are forgetting that the image is not really
> > > > part of the PHP resource. Meaning, this is the series of
> > > > events for a PHP script that refernces a single image
> > > > called bar.jpg using the  tag:
> > > >
> > > > 1. HTTP request sent for foo.php (Web client -> Web server)
> > > > 2. HTTP response sent that includes the output of foo.php
> > > >(Web server -> Web client)
> > > > 3. Web client (browser) notices  tag referenced in
> > > >the HTML.
> > > > 4. HTTP request sent for bar.jpg (Web client -> Web server)
> > > > 5. HTTP response sent that includes bar.jpg
> > > >
> > > > So, the headers that you are setting only matter for the
> > > > resource returned in step 2. Meaning, the HTML output of
> > > > foo.php is not cached. The image, since it is returned by
> > > > the Web server and not your PHP script, is cached.
> > > >
> > > > Chris
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] pop-up problem

2003-01-20 Thread Jim Lucas
I have found that with the popup stopper that I have installed on my
machine, Pop-up Stopper from Panic Ware, that I can't even start up a new
instance of IE without it killing the new window.  I have netscape 4,6,7 and
mozilla installed on my machine and it won't allow me to start up more then
one copy of netscape or mozilla at a time.

Jim
- Original Message -
From: "Step Schwarz" <[EMAIL PROTECTED]>
To: "Mark McCulligh" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 4:07 PM
Subject: Re: [PHP] pop-up problem


> on 1/20/03 4:47 PM, Mark McCulligh at [EMAIL PROTECTED] wrote:
>
> > What does IE do?
>
> Hi Mark,
>
> IE, as far as I know, doesn't have any built-in pop-up killer.
>
> Pop-up killers generally only block pop-ups that either weren't requested
by
> the visitor -- that is, no link was clicked -- or that reside on a
different
> server than the page opening the pop-up.  I imagine your help system
should
> be fine unless your visitors have JavaScript disabled (pop-ups won't work
> without JavaScript) or there's an error in you JavaScript that's
preventing
> the pop-up from working on one browser or another.
>
> Hope this helps,
> -Step
>
>
> --
> 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] DOWNLOAD

2003-01-21 Thread Jim Lucas
People often for get about a little problem that happens with the




I found a bug when developing a download script a year or so ago.

You can't have the 'attachment;' part in IE.  It did some funky stuff

and netscape 4 would die without it.

Jim

- Original Message -
From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
To: "'Shaun van den Berg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 1:44 AM
Subject: RE: [PHP] DOWNLOAD


> Create a script that reads the contents of a file after sending headers
> eg:
>
> header("Content-type: text/plain");
> header("Content-Disposition: attachment; filename=downloaded.txt");
> readfile("downloaded.txt");
> exit();
>
> The downloaded.txt can be any file subject to sending the correct
> headers and IE
> and other browsers will pop up a download (save) window.
>
> See your mime.types file for headers for each file type.
>
>
> Timothy Hitchens (HiTCHO)
> Open Source Consulting
> e-mail: [EMAIL PROTECTED]
>
> > -Original Message-
> > From: Shaun van den Berg [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, 21 January 2003 4:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] DOWNLOAD
> >
> >
> > Hi ,
> >
> > Im not sure if this can be done in PHP , i know PHP has
> > upload features ! Does it have download features , wat i mean
> > is the following : i want a link - click here to download -
> > when you click on it , the download dialog box must appear -
> > how do i do this ?
> >
> > Thanks
> > Shaun van den Berg
> >
> > --
> > Novtel Consulting
> > Tel: +27 21 9822373
> > Fax: +27 21 9815846
> > Please visit our website:
> > www.novtel.co.za
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>





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




Re: [PHP] Detecting posts from outside site

2003-01-21 Thread Jim Lucas
what about checking the checking the remote ip address?

Jim
- Original Message - 
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 10:45 AM
Subject: Re: [PHP] Detecting posts from outside site


> --- [EMAIL PROTECTED] wrote:
> > If it's bulletproof, then I figured this could help
> > some of you out. If not, I welcome comments (I'm a
> > little bit hesitant of calling things 'bulletproof').
> 
> It's not bulletproof. :-)
> 
> > if((count($_POST) > 0) &&
> > (!stristr($_SERVER["HTTP_REFERER"],
> > $http_referer))) {
> > unset($_POST);
> > $evil = "postedfromoutsidepage";
> > }
> 
> If this page is located at http://www.example.org/foo.php,
> and you are trying to ensure that the data is being posted
> from http://www.example.org/bar.php consider the following:
> 
> 
> # telnet www.example.org 80
> Trying 192.0.34.166...
> Connected to www.example.org (192.0.34.166).
> Escape character is '^]'.
> POST /foobar.php HTTP/1.1
> Host: www.example.org
> Referer: http://www.example.org/bar.php
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 26
> 
> varname=any_value_i_choose
> 
> 
> Someone can use this method to bypass your Referer header
> check and post any data they choose.
> 
> Chris
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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




[PHP] Quick Question about Template Parsers

2003-01-22 Thread Jim Lucas
In general, how do most template parsers work?

do they read the file into a variable and do something 
to the effect of preg_replace() to element that is found?

and if so, could you replace the step of reading the file 
into a variable with getting the template data out of a database?

WARNING... more questions to come...

Jim



Re: [PHP] Select value for driopdown box

2003-01-22 Thread Jim Lucas
function DrawOptions($options, $active='')
{
  $str = '';
  foreach($options AS $key=>$value)
  {
$sel = ($active==$key?" SELECTED":"");
$str .= "".$value."\n";
  }
  return($str);
}

Try this





array needs to be a key-value pair that has the value that you are looking
for as the key and if it matches it will make that key - value assoc the
selected one.

that should work for you

- Original Message -
From: "Ben C." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 10:14 AM
Subject: [PHP] Select value for driopdown box


> I am using the query below to edit a record. I want to edit the field
which has a list of states in a dropdown box.   I want to have the state
that is in the selected field shown as the selected state.  How would I do
this?
>
>
> Query
> -
>  $sql = "SELECT *
> FROM $table_name
> WHERE buyerid = \"$buyerid\"
> ";
>
> $result = @mysql_query($sql,$connection) or die(mysql_error());
>
>
> while ($row = mysql_fetch_array($result)) {
>  $buyerid = $row['buyerid'];
>  $state = $row['state'];
>
> $option_block .= "$state";
> }
>
> $display_block = "
>
> 
> $option_block
> 
> ?>
>
> 
> State
> 
> 
>
> 
>
>
> --
> 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] Reading Directory in reverse

2003-01-22 Thread Jim Lucas
is it on a unix system?

if so, do an ls on the system and you will see that the files are listed in
that order.

it is the order in which they were copied to the directory.

try going through a loop before you run your main loop, create an array()
then sort that with some sorting functions and you'll have it.

Jim
- Original Message -
From: "Bob Irwin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 3:03 PM
Subject: [PHP] Reading Directory in reverse


> Hi Guys,
>
> Does anyone happen to know why the below code reads the directory in
reverse
> alphabetical order?  Not a major problem - easy enough to whack it in an
> array and sort it, but annoying nonetheless.
>
>
> $default_dir = "../screenshots";
>
> if (!($dp = opendir($default_dir))) die("cannot open $default_dir");
> while($file = readdir($dp))
> if($file != '.' && $file != '..') echo" href='opendir.php?opendir=$file'>$file";
> closedir($dp);
>
> Best Regards
> Bob Irwin
> Server Admin & Web Programmer
> Planet Netcom
>
>
> --
> 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] a simple getenv question....

2003-01-22 Thread Jim Lucas
just copied your code and it worked fine for me.

system: Apache 1.3.26
PHP 4.2.2

I would look into apache 2.0 and the env vars that are available from it.


- Original Message -
From: "Bruce Douglas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 3:57 PM
Subject: [PHP] a simple getenv question


> Hi...
>
> A simple question... In the following code:
>
> 
> $ip = getenv("REMOTE_ADDR");
>
> echo " ip = ".$ip;
>
> echo " ip = " . getenv("REMOTE_ADDR");
>
> echo " ip = " . getenv('REMOTE_ADDR');
>
> echo " ip = ". $REMOTE_ADDR; <--
>
> ?>
>
> I can only seem to get the last line to display the correct value. It's as
> if I can't seem to get/return any of the SERVER environment variables
using
> the getenv() function
>
> I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.
>
> I've checked through the PHP.INI file, but couldn't seem to find why this
> might be occuring. Any help/assistance would be appreciated.
>
> thanks
>
> bruce
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] total file size

2003-01-23 Thread Jim Lucas
yes, it is possible, but not with php.

Jim

- Original Message - 
From: "Victor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 8:10 PM
Subject: [PHP] total file size


> Is there a way to find out total upload file size from a file uploaded
> though an html form? I figure if I know the total size, then I can just
> consistently poke at the file being uploaded and math a progress bar for
> the file being uploaded, of course, this all hangs upon the ability of
> getting the total file size BEFORE it is uploaded. It IS possible I have
> seen it done with JSP; anybody can help me with this? Thanks
> 
> - Vic
> 
> __ 
> Post your free ad now! http://personals.yahoo.ca
> 
> -- 
> 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] why is mv copying ??

2003-01-24 Thread Jim Lucas
I am guessing that apache isn't the owner of the file.  therefor it can't
delete it from it original position.

mv in unix basically copies the file pointer from one place and to another
place.

then deletes the original pointer.  if you don't have permission to delete
the file from its original point, then you can't do an mv command
successfully.

Check your permissions on the original file, find out if apache is the
owner.  that will tell you if you can delete the file.

Jim

- Original Message -
From: "Christian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 5:01 PM
Subject: [PHP] why is mv copying ??


> Hi all,
>
> Any idea why when I execute 'mv' in a php script
> the file is copied not moved?
>
> Apache is a member of the group which owns the file
> and has wrx permissions.
>
> Thanx,
> Christian
>
>
> --
> 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] help me

2003-01-24 Thread Jim Lucas
the only difference to structure is this line is in the first file and not
the second.

fw_menu_2.addMenuItem("STANDARD
PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");

diff is a wonderful tool!!!

Enjoy

Jim

- Original Message -
From: "Amit Gupta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 9:21 PM
Subject: [PHP] help me



Hi,

How are you?

My friends following are two javascript files for pop-up menus. menu2.js is
working satisfactorily while menu.js is not working. I tried lot to trace
the loophole but all in vain. kindly compare the two files and help me.

menu2.js
function fwLoadMenus() {

if (window.fw_menu_0) return;

window.fw_menu_1_1 = new
Menu("DIRECTORY",130,17,"Arial",10,"#003300","#cc","#cc9966","#00");

fw_menu_1_1.addMenuItem("HEADQUATER","location='http://www.bis.org.in/dir/hq
.htm'");

fw_menu_1_1.fontWeight="bold";

fw_menu_1_1.hideOnMouseOut=true;

window.fw_menu_1 = new
Menu("root",213,17,"Helvetica",10,"#003300","#cc","#cc9966","#00");

fw_menu_1.addMenuItem(fw_menu_1_1);

fw_menu_1.fontWeight="bold";

fw_menu_1.hideOnMouseOut=true;


window.fw_menu_2 = new
Menu("root",208,0,"sans-serif",10,"#003300","#cc","#cc9966","#00");

fw_menu_2.addMenuItem("STANDARD
PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");

fw_menu_2.fontWeight="bold";

fw_menu_2.hideOnMouseOut=true;


window.fw_menu_3 = new
Menu("root",208,17,"Helvetica",10,"#003300","#cc","#cc9966","#00");

fw_menu_3.addMenuItem("STANDARD
PROMOTION","location='http://www.bis.org.in/sf/sfp2.htm'");

fw_menu_3.fontWeight="bold";

fw_menu_3.hideOnMouseOut=true;


fw_menu_3.writeMenus();}

menu.js
function fwLoadMenus() {

if (window.fw_menu_0) return;

window.fw_menu_1 = new Menu("root",213,17,"Verdana, Arial, Helvetica,
sans-serif",11,"#003300","#cc","#cc9966","#00");

window.fw_menu_1_1 = new Menu("",213,17,"Verdana, Arial, Helvetica,
sans-serif",11,"#003300","#cc","#cc9966","#00");

fw_menu_1_1.addMenuItem("u","location='http://www.bi2s.org.in/other/iscd.htm
'");

fw_menu_1_1.fontWeight="bold";

fw_menu_1_1.hideOnMouseOut=true;

fw_menu_1.addMenuItem(fw_menu_1_1);

fw_menu_1.fontWeight="bold";

fw_menu_1.hideOnMouseOut=true;

window.fw_menu_2 = new
Menu("root",208,17,"Helvetica",10,"#003300","#cc","#cc9966","#00");

fw_menu_2.fontWeight="bold";

fw_menu_2.hideOnMouseOut=true;

window.fw_menu_3 = new Menu("root",213,17,"Verdana, Arial, Helvetica,
sans-serif",11,"#003300","#cc","#cc9966","#00");

fw_menu_3.addMenuItem("","location='
http://www.bi3s.org.in/other/iscd.htm'");

fw_menu_3.fontWeight="bold";

fw_menu_3.hideOnMouseOut=true;

fw_menu_3.writeMenus();

}


Keep smiling. It cost nothing but gives everything.

Yours

Amit Gupta





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




[PHP] Using MySQL user variables in PHP

2003-01-26 Thread Jim MacCormaic
I'm currently developing a PHP/MySQL project, one aspect of which 
involves displaying a default set from the database which picks out all 
records for whichever individual is associated with the most recent 
date. I know this is a very general description, but I don't think it's 
necessary to burden list members with further detail, nor to pass on 
details of my table structures.

Suffice it to say that I successfully achieved my goal with MySQL from 
the command line, but I'm not sure how to write this functionality into 
my PHP code.

In MySQL, the following sequence of commands works the magic:

	SELECT @most_recent:=MAX(date)
		FROM presenters;

	SELECT @recent_presenter:=presenter
		FROM presenters
		WHERE date = @most_recent;

	SELECT p.date, p.theme, p.presenter,
		c.itemNo, c.composer, c.composition, c.note
		FROM presenters p, compositions c
		WHERE p.date = c.date AND p.presenter = @recent_presenter
		ORDER BY p.date DESC;

So how do I transfer all this to PHP?

I've tried a number of approaches:

1.	$presenterQuery = "
		SELECT @most_recent:=MAX(date) from presenters;
		SELECT @recent_presenter:=presenter
			FROM presenters WHERE date=@most_recent;
		SELECT date_format(p.date, '%d/%m/%y') AS readable_date, p.theme, 
p.presenter,
			c.itemNo, c.composer, c.composition, c.note
			FROM presenters p, compositions c
			WHERE p.date = c.date AND p.presenter = @recent_presenter
			ORDER BY p.date DESC";

2.	$tempQuery1 = "
		SELECT @most_recent:=MAX(date) from presenters";
	$tempQuery2 = "
		SELECT @recent_presenter:=presenter FROM presenters WHERE 
date=@most_recent;
	$presenterQuery = "
		SELECT date_format(p.date, '%d/%m/%y') AS readable_date, p.theme, 
p.presenter,
		c.itemNo, c.composer, c.composition, c.note
		FROM presenters p, compositions c
		WHERE p.date = c.date AND p.presenter = @recent_presenter
		ORDER BY p.date DESC";

3.	$tempQuery1 = "
		SELECT @most_recent:=MAX(date) from presenters";
		$tempQuery1Result = mysql_db_query($database, $tempQuery1, 
$connection) or die ( mysql_error() );	
	$tempQuery2 = "
		SELECT @recent_presenter:=presenter FROM presenters WHERE date = 
\"$tempQuery1Result\"";
		$tempQuery2Result = mysql_db_query($database, $tempQuery2, 
$connection) or die ( mysql_error() );
	$presenterQuery = "
		SELECT date_format(p.date, '%d/%m/%y') AS readable_date, p.theme, 
p.presenter,
		c.itemNo, c.composer, c.composition, c.note
		FROM presenters p, compositions c
		WHERE p.date = c.date AND p.presenter = \"$tempQuery2Result\"
		ORDER BY p.date DESC";

All of these options are followed by

	$presenterResult = mysql_db_query($database, $presenterQuery, 
$connection) or die ( mysql_error() );

All queries indicate that they have been successfully executed when I 
add relevant debug code, but it seems that rather than substitute the 
variable values, either a variable literal (e.g. @recent_presenter) or 
a value like Resource ID#2 is being used instead.

Is it possible to do what I desire. If so, where am I going wrong?

Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] Using MySQL user variables in PHP

2003-01-26 Thread Jim MacCormaic
On Sunday, January 26, 2003, at 06:26  pm, Jason Wong wrote:


You're not doing anything with $tempQuery1 & $tempQuery2 this is 
complete
nonsense ;-)

Bowing obsequiously, suitably chastened, I read on . . .


This is getting closer. Unfortunately you haven't been reading the 
manual.
mysql_query() returns a "resource ID". See examples in manual for 
details on
how to properly query and return results from a db.

Knuckles recovering from another knock, I read further . . .


Couldn't the above be condensed to:

  SELECT presenter FROM presenters ORDER BY date DESC LIMIT 1;


Much neater indeed. Elegant, even.


Which means you can get by with 2 queries:

  $query = "SELECT presenter FROM presenters ORDER BY date DESC LIMIT 
1";
  $result = mysql_query($query);
  $row = mysql_fetch_assoc($result);
  $presenter = $row['presenter'];

You can now use $presenter in your last query

All code untested, handle with care.

Code successfully incorporated and working as intended. Thanks for the 
help.


Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Jim Lucas
then run extract($_REQUEST);  just above where you want to use the var1
var2...  and it will place all the key => value pairs into the local scope.

Jim
- Original Message -
From: "Noah" <[EMAIL PROTECTED]>
To: "Philip Olson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 5:55 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


> I don't want to use $_REQUEST['my_passed_variable'] at all.
>
> Right now when I do an sql insert on my local machine I have to use the
> following syntax:
>
> INSERT into tablename (field name list)
> VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])
>
> I just want to use $var1, $var2, $var3
>
> --Noah
>
> - Original Message -
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "CF High" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 29, 2003 2:23 PM
> Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
> 2k Setup
>
>
> >
> > One too many $'s in your code, use:
> >
> > $_REQUEST['my_passed_variable']
> >
> > This is how all arrays work, autoglobals are the same.
> > See also:
> >
> > http://www.php.net/variables.external
> > http://www.php.net/variables.predefined
> >
> > Regards,
> > Philip
> >
> > On Wed, 29 Jan 2003, CF High wrote:
> >
> > > Hey all.
> > >
> > > This driving me nuts:
> > >
> > > I've got Apache, MySql, and Windows 2000 running on my local
> machine.
> > > In order to get passed php variables evaluated, whether via a url
query
> > > string, or through a form post, I have to use this syntax:
> > >
> > > $_REQUEST[$my_passed_variable]
> > >
> > > I have no such problem with our hosting company servers; i.e. I can
> access
> > > query_string and form posted variables as $my_passed_variable.
> > >
> > > What is going on here? Is there something in php.ini that needs to be
> > > adjusted?
> > >
> > > Any help whatsoever here is much appreciated,
> > >
> > > --Noah
> > >
> > > --
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread Jim Lucas
why would it matter if he does it just above the place that he is going to
use them?

doesn't matter if he is in a function or not.  the $_REQUEST var will always
be available.

if he calls a function then he would have to do it just inside the function
or pass it to the function.

Jim
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 2:59 PM
Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win
2k Setup


> On Thursday 30 January 2003 09:55, Noah wrote:
> > I don't want to use $_REQUEST['my_passed_variable'] at all.
> >
> > Right now when I do an sql insert on my local machine I have to use the
> > following syntax:
> >
> > INSERT into tablename (field name list)
> > VALUES ($_REQUEST['var1'],  $_REQUEST['var2'], $_REQUEST['var3'])
> >
> > I just want to use $var1, $var2, $var3
>
> Are you trying to use these inside a function? If so, look up variable
scope
> in the manual.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Most people have a mind that's open by appointment only.
> */
>
>
> --
> 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] Backticks and echo

2003-02-19 Thread Jim Lucas
you could always to a preg_replace() and replace the backticks with their
&#xxx; equal.

Jim
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 19, 2003 4:27 AM
Subject: [PHP] Backticks and echo


> Hello everyone
>
> I reread the manual again on the topic of backticks and from that I have
> security / usabilitiy issue.
>
> Here is the issue:
>
> When I check formdata from a simple form I use regular expression to make
> sure the input confirms to certain guidlines before including them into my
> scripts.
> Basically this means excluding special character like the above mentioned
> backticks. Well so far so good.
> When the input is wrong I'd like to redisplay the wrong input and ask the
> user to correct these.
> Now here comes the issue as far as I understand the manual the text
> inbetween backticks is executed and the output is included in place. This
> happens when I echo the text out. So if I don't allow backticks in my
> input field and I want to redisplay that input I execute the code right?
> Meaning I can'T redisplay the text as the user inputed it. When I use
> escapeshellcmd  to prevent any execution I redisplay the input differently
> than the users input. This will confuse most users and is not as wished
> from a usability standpoint.
> So have I missunderstood the way backticks work or is this an unresolvable
> issue?
>
> Any help greatly appreciated
>
> Stefan



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




Re: [PHP] Cannot find php.ini

2003-02-21 Thread Jim Lucas
the default location for the php.ini file (if installed with the RPM's) is
/etc/php.ini

Jim
- Original Message -
From: "Kevin Paz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 11:03 AM
Subject: [PHP] Cannot find php.ini


>
> I've taken over a redhat server with apache/php4.1.  I need to enable
> register_argc_argv but I can't find the php.ini file (I've searched the
> entire system).
>
> Would creating a new php.ini file with only register_argc_argv line work?
> Where's the default location for php.ini?
>
>
> Thanks in advance,
>
> Kevin
>
>
>
> --
> 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] What do these errors mean?

2003-02-21 Thread Jim Lucas
in the first line of the code you are refering to $_GET[option]

option in this case is being seen as a constant.

if you were to put single or double quotes it would work.

the second notice means that in the $_GET array, there isn't a key called
option

it would probably work better if you did this.

if(empty($_GET['option'])) {
  your code here
}


- Original Message -
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 11:01 AM
Subject: [PHP] What do these errors mean?


> Hi,
>
> I was looking through php.ini and noticed that show_error was set to Off.
I
> turned it On, and now I see these errors on one of my pages:
> Notice: Use of undefined constant option - assumed 'option' in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Notice: Undefined index: option in
> /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37
>
> Here's line 37-42:
> if ($_GET[option] == "") {
>  print "Add Credit Card";
>  print "
>  Credit Card Number:  name=cc>
>  ";
> }
>
> What's wrong with that?
>
> Thanks,
> Tyler
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



[PHP] Problem with php and ldap...

2003-02-24 Thread Jim Greene

Hello,
I am having a problem with using LDAP and PHP...  The two seperate
scripts work fine, but when I try to combine them in anyway It does not
complete...  The scripts are below..
ldap_add.php


ldap-search.php



You should be able to get the idea of what I am trying to do...  I have
tried taking the needed pices of each script and combining them, but
when I do I get an error about somehting in the info array not being
correct..  Wierd thing is that it works fine when they are seperate.. 
Any help is greatly appreciated.. Thanks...
Jim G


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



[PHP] Removing URL Variables

2003-02-24 Thread Jim Pringle
I've noticed some sites that have variables in the link
(template.php?tpl=fold), but when the page is displayed, the variable is not
visable in URL in the address window.

How do you do this?

thanks



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



[PHP] ldap modify + add problem

2003-02-26 Thread Jim Greene
Hello,
	I seem to be having a problem with doing an ldap_add and a modify in 
the same script. I assumed if I did an unbind after my modify I should 
be fine but it seems to not work still. Below is the script. Thanks



// LDAP variables
$ldaphost = "ldap.server";  // your ldap servers
$ldapport = 389; // your ldap server's port number
$ldaprdn  = "cn=Directory Manager"; // ldap rdn or dn
$ldappass = "test123";  // associated password
$dn2="uid=default, ou=Users, dc=megalink, dc=net";
// Connecting to LDAP
$ldapconn = ldap_connect( $ldaphost, $ldapport )
or die("Could not connect to LDAP server.");
// connect to ldap server

if ($ldapconn) {

// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...\n";
$result=ldap_search($ldapconn,"ou=Users,dc=megalink,dc=net", "u
id=default");
$info = ldap_get_entries($ldapconn, $result);
$defaultUid = $info[0]["uidnumber"][0];
//print $defaultUid;
//print $info[0]["uidnumber"][0];
$newUid=$defaultUid+1;
print "$newUid\n";
$newinfo["uidNumber"]=$newUid;
ldap_modify($ldapconn,$dn2,$newinfo);
echo "LDAP Modify successful...\n";
ldap_unbind($ldapconn);
} else {
echo "LDAP bind failed...";
}
}

//require_once ("ldap-search-uid.php");
$dn="cn=Directory Manager";
$bindPassword = "test123";
$mySalt = substr(
ereg_replace("[^a-zA-Z0-9./]","",
crypt(rand(1000,), rand(10,99))),
2, 2);
$password = crypt("l8rd00dZ","$mySalt");
$info["loginShell"]="/bin/false";
$info["uidNumber"]="1002";
$info["gidNumber"]="100";
$info["objectClass"][0]="posixAccount";
$info["objectClass"][1]="top";
$info["uid"]="test2";
$info["gecos"]="test";
$info["cn"]="test2";
$info["homeDirectory"]="/home/test1";
$info["userPassword"]="{crypt}test123";
if (($ldap = ldap_connect("ldap.server","389"))) {
echo "Bind Good...\n";
}
else {
echo "Connection Failed...\n";
}
if (($res = @ldap_bind($ldap, $dn, $bindPassword))) {
ldap_add($ldap, "uid=test2, ou=Users, dc=megalink, dc=net", $info);
echo "User Added...\n";
}
else {
echo "Addition Failed...\n";
}
?>
Jim G

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


[PHP] Problem wit doing ldap_add and modify in same script

2003-02-26 Thread Jim Greene
Strange problem: Taking the 2 halfs of the scripts (the section to update uidNumber 
and the one to add the user) and combining them causes
an error:
Fatal error: ldap_add() [http://www.php.net/function.ldap-add]: Unknown attribute in 
the data in /home/jwgreene/ldap-add.php on line 68

Yes doing them as 2 seperate scripts works fine. I did read something about not being 
able to do a modify, and add in the same statment, so I do a ldap_unbind after the 
completion
of the first. Still does the same thing. Any help would be appreciated.. Thanks




Jim G


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



[PHP] sort mixed array

2003-02-27 Thread Jim Long
Hi,

I have an array with an html link as key and different $vars as val:

$list = array ( 
'http://someplace.com/";>some place' => $vendor1_total,
'http://anotherplace.com/";>another place' => $vendor2__total,
[snip] etc..

some vals are numeric and some vals are "n/a"
asort works to sort the array as a string, however, I need to sort the
numeric vals numeric, then have the n/a's go away or be output at the
bottom of the sort.

Please be clear and gentle.. I'm not schooled in php, just a tinkerer
trying to make this mess work.

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



[PHP] restating plea for help with sort

2003-02-27 Thread Jim Long
Hi,

I have an array with an html link as key and different $vars as val:

$list = array ( 
'http://someplace.com/";>some place' => $vendor1_total,
'http://anotherplace.com/";>another place' => $vendor2__total,
[snip] etc..

some vals are numeric and some vals are "n/a"
asort works to sort the array as a string, however, I need to sort the
numeric vals numeric, then have the n/a's go away or be output at the
bottom of the sort.

Please be clear and gentle.. I'm not schooled in php, just a tinkerer
trying to make this mess work.

Thanks In Advance,

Jim Long

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



[PHP] help with arrays

2003-02-27 Thread Jim Long
Hi,

Origninal Post:

> I have an array with an html link as key and different $vars as val:
> 
> $list = array ( 
> 'http://someplace.com/";>some place' => $vendor1_total,
> 'http://anotherplace.com/";>another place' => $vendor2__total,
> [snip] etc..
> 
> some vals are numeric and some vals are "n/a"
> asort works to sort the array as a string, however, I need to sort the
> numeric vals numeric, then have the n/a's go away or be output at the
> bottom of the sort.

Kevin Stone wrote: (THANKS)

> In order to sort the non "n/a" values you're going
> to have to build a separate array and perhaps this will simplfy the problem.
> So instead of what I suggested earlier.. loop the array and start TWO new
> arrays within the loop.  One array for "n/a" values and one for non-"n/a"
> values.  After the values are sorted to their separate arrays do
> asort($nonnavals); then concatonate the two arrays together using
> array_merge(), putting the "n/a" array second.


I can't fiqure out how to set up arrays inside the while loop.

Using this:

while (list ($key, $val) = each ($orderd_list)) {
if ($val == 'n/a'){
$no_plan_list = array ($key => $val);// need an array here for "n/a" 
}else{
$plan_list = array  ($key => $val);// need an array here for numeric 
vals
}
}


Thanks In Advance,
Jim Long

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



[PHP] separating value="n/a" from array

2003-02-27 Thread Jim Long
Hi,

Thanks to those who have helped me.

Jason Lange Wrote:
> Try this code (tested):
> 
> <-- Begin Code -->
> foreach ($list as $key => $value) {
>  // If elements value is a numeral add to numeric_array
>  if (is_numeric($value)) {
>  $numeric_array[$key] = $value;
>  // If value is not a numeral (presumably 'n/a') add to na_array
>  } else {
>  $na_array [$key] = $value;
>  }
> }
> 
> // Re-combine arrays placing all "other" values at the end
> $final_array = array_merge($numeric_array, $na_array);
> <-- End Code -->

This works.. THANKS!  HOWEVER:

I think PHP is seeing a comma, in a large number and think that it IS
NOT NUMERIC, because when I test a large number it put it in the $na_array

Do I need to add something to this code to stip the commas?

THANKS IN ADAVANCE AGAIN,
Jim Long


Kevin Stone wrote:
> To append my own answer.  In order to sort the non "n/a" values you're going
> to have to build a separate array and perhaps this will simplfy the problem.
> So instead of what I suggested below.. loop the array and start TWO new
> arrays within the loop.  One array for "n/a" values and one for non-"n/a"
> values.  After the values are sorted to their separate arrays do
> asort($nonnavals); then concatonate the two arrays together using
> array_merge(), putting the "n/a" array second.
> 
> - Kevin
> 
> - Original Message -
> From: "Kevin Stone" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 12:04 PM
> Subject: Re: [PHP] restating plea for help with sort
> 
> 
> 
>>Hmm well upon first glance looks like all you need to do is loop that
> 
> array
> 
>>and start a new array within the loop.  An If/Else construct checks If the
>>value is "n/a" then append to the back of the new array Else prepend to
> 
> the
> 
>>front of the new array.You append the values manually or use
>>array_push() and array_unshift().  Search the manual for more information.
>>Hope that helps.
>>- Kevin
>>
>>- Original Message -
>>From: "Jim Long" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Thursday, February 27, 2003 11:35 AM
>>Subject: [PHP] restating plea for help with sort
>>
>>
>>
>>>Hi,
>>>
>>>I have an array with an html link as key and different $vars as val:
>>>
>>>$list = array (
>>>'http://someplace.com/";>some place' => $vendor1_total,
>>>'http://anotherplace.com/";>another place' =>
> 
> $vendor2__total,
> 
>>>[snip] etc..
>>>
>>>some vals are numeric and some vals are "n/a"
>>>asort works to sort the array as a string, however, I need to sort the
>>>numeric vals numeric, then have the n/a's go away or be output at the
>>>bottom of the sort.
>>>
>>>Please be clear and gentle.. I'm not schooled in php, just a tinkerer
>>>trying to make this mess work.
>>>
>>>Thanks In Advance,
>>>
>>>Jim Long

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



[PHP] PHP SORT_NUMERIC

2003-02-27 Thread Jim Long
Hi,

I've got to sort the $numeric_arry

This doesn't seem to work:
sort ($numeric_array, SORT_NUMERIC);
I think its sorting $key

asort ($numeric_array, SORT_NUMERIC);
sorts as a string


THANKS AGAIN IN ADVANCE,
Jim Long

JanetVal Wrote:
> Well, as long as you know exactly what you are looking for, you can use 
> 
> >  if ($value != "n/a")) {
> 
> Janet


Jason Lange Wrote:
> Try this code (tested):
> 
> <-- Begin Code -->
> foreach ($list as $key => $value) {
>  // If elements value is a numeral add to numeric_array
>  if (is_numeric($value)) {
>  $numeric_array[$key] = $value;
>  // If value is not a numeral (presumably 'n/a') add to na_array
>  } else {
>  $na_array [$key] = $value;
>  }
> }
> 
> // Re-combine arrays placing all "other" values at the end
> $final_array = array_merge($numeric_array, $na_array);
> <-- End Code -->


Original Question:
>>>I have an array with an html link as key and different $vars as val:
>>>
>>>$list = array (
>>>'http://someplace.com/";>some place' => $vendor1_total,
>>>'http://anotherplace.com/";>another place' =>
> 
> $vendor2__total,
> 
>>>[snip] etc..
>>>
>>>some vals are numeric and some vals are "n/a"
>>>asort works to sort the array as a string, however, I need to sort the
>>>numeric vals numeric, then have the n/a's go away or be output at the
>>>bottom of the sort.

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



[PHP] SORT_NUMERIC

2003-02-28 Thread Jim Long
Hi,

Does anyone know how to make the flag "sort_numeric" work? 
Will it work with asort?  

asort ($numeric_array, SORT_NUMERIC);
I've tried this but it looks like it's having problems with the comma in
big numbers. 
I'm not absolutely sure, but it looks like it's ignoring everything
after a comma when it sorts.

TIA,
Jim Long

BTW: asort is the one I need as I must maintain the keys

JanetVal Wrote:

> sort() sorts by value but assigns new keys as numbers.
> asort() sorts by value, but keeps the same keys
> ksort() sorts by key.

THANKS !
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Jim Long Network - Web Design  |
| http://jimlong.net/web |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Jim Long - Rep: Manhattan Dance Orchestra  |
| http://manhattandanceorchestra.com |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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



[PHP] strip comma from $value

2003-02-28 Thread Jim Long
Hi,

I've figured out the way to solve my problem is to get rid of the commas
before I sort.

Trying to use this:

//strip the commas---
foreach ($numeric_array as $key => $value) {
if (stristr($value, ",")){
//test to see if it worked
echo("comma striped"); 
}
}

-- 

It passed the test but,
I'm doing something wrong because the commas are still there.

TIA,
Jim Long

Jim Long Wrote:
> Does anyone know how to make the flag "sort_numeric" work? 
> Will it work with asort?  
> 
> asort ($numeric_array, SORT_NUMERIC);
> I've tried this but it looks like it's having problems with the comma in
> big numbers. 
> I'm not absolutely sure, but it looks like it's ignoring everything
> after a comma when it sorts.
> 


> 
> BTW: asort is the one I need as I must maintain the keys
> 
> JanetVal Wrote:
> 
> > sort() sorts by value but assigns new keys as numbers.
> > asort() sorts by value, but keeps the same keys
> > ksort() sorts by key.
> 
> THANKS !

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



[PHP] re: strip comma from $value

2003-02-28 Thread Jim Long
Hi,

Trying this:

//strip the commas from numeric array so it can sort properly---

foreach ($numeric_array as $key => $value) {
if (ereg_replace ("," , "", $value)){
echo("comma striped");
}
}

Does the same thing as before, echo's comma stripped, but does not
actually remove the commas

THANKS.. any other ideas?
Jim Long
--

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



[PHP] re: strip comma from $value

2003-02-28 Thread Jim Long
Hi,

Thanks to those who are helping me.

Matt,

Same result, echo's sucess, but commas are still out put in the $numeric_array.

Jim Long

Matt Wrote:

> foreach($numeric_array as $key => $value ) {
> if(strstr($value,","))
> {
> $value = ereg_replace(",","",$value);
> echo "comma stripped";
> }
> }

Hugh Wrote:

> 
> try ereg_replace(",","",$value);


Orignal post:

> Hi,
>
> I've figured out the way to solve my problem is to get rid of the commas
> before I sort.
>
> Trying to use this:
>
> //strip the commas---
> foreach ($numeric_array as $key => $value) {
> if (stristr($value, ",")){
> //test to see if it worked
> echo("comma striped");
> }
> }
>
> --
>
> It passed the test but,
> I'm doing something wrong because the commas are still there.
>
> TIA,
> Jim Long
>
> Jim Long Wrote:
> > Does anyone know how to make the flag "sort_numeric" work?
> > Will it work with asort?
> >
> > asort ($numeric_array, SORT_NUMERIC);
> > I've tried this but it looks like it's having problems with the comma in
> > big numbers.
> > I'm not absolutely sure, but it looks like it's ignoring everything
> > after a comma when it sorts.
> >
>
>
> >
> > BTW: asort is the one I need as I must maintain the keys
> >
> > JanetVal Wrote:
> >
> > > sort() sorts by value but assigns new keys as numbers.
> > > asort() sorts by value, but keeps the same keys
> > > ksort() sorts by key.
> >
> > THANKS !

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



[PHP] re: sort comma from $value

2003-02-28 Thread Jim Long
Hi,

Figured it out.

I needed to reset my output array $numeric_array.

//strip the commas from numeric array so it can sort properly---

foreach($numeric_array as $key => $value ) {
if(strstr($value,","))
{
$value = ereg_replace(",","", "$value");
  $numeric_array[$key] = $value; //<reset the output array
echo "comma stripped";
}
}

Thanks again for all your help,

Jim Long

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



Re: [PHP] deciperhing oop

2003-03-03 Thread Jim Lucas
the second argument in the mysql_select_db call in not in scope.

you should be using $this->db instead of $db

Jim
- Original Message -
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 2:52 PM
Subject: [PHP] deciperhing oop


> Can someone who is used to using php oop help me figure out why this
fails?
> I know there are probably a thousand classes already designed to do this
and
> probably 100 times more efficient, but this is how I learn.  From what
I've
> read this should work but there is obviously something I'm missing.
>
> Quick problem description:
> Trying to set up class to connect to mysql db.  Already used a procedural
> test successfully connecting to db.  Error is displayed as...
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link
> resource in /var/www/html/oop.php on line 67
> Database Selection to main failed.
>
> Code:
>
> Class dbConnect
> {
> var $machine;
> var $port;
> var $user;
> var $password;
> var $query;
> var $result;
> var $dbase;
> var $db;
> var $sel;
>
> function dbConnect($machine,$port,$user,$password)
> {
> $this->machine = $machine;
> $this->port = $port;
> $this->user = $user;
> $this->password = $password;
>
> $db = mysql_pconnect ("$machine","$user","$password")
> if (!$db)
> {
> die ("Initial connection to DB failed.")
> }
> $this->db = $db;
> }
> function setDbase($dbase)
> {
> $this->dbase = $dbase;
>
> $sel = mysql_select_db("$dbase",$db);
> if(!$db)
> {
> die ("Database Selection to $dbase failed.");
> }
> }
> }
>
> $dbn = new dbConnect("localhost","3306","bob","hjhyt4kl5");
>
> $dbn->setDbase("main");
>
>
>
>
>
>
> So why can't I use $db?  Isn't the statement $this->db=$db making it
> available to the setDbase function?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
> --
> 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] File Download

2003-03-06 Thread Jim Lucas
have the file download in a popup window.

after the down load the window will be gone.

Then you don't have to worry about the refreshing of the main window.

Jim
- Original Message -
From: "David Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 06, 2003 8:30 AM
Subject: [PHP] File Download


> Hello
>
> I have a script that after login gives the user access to one directory.
The
> directory depends on their login.
>
> After login a list of files is displayed with a check box in front of each
file.
> Under the list of files there are several buttons, Copy, Delete, Rename,
Upload, and
> Download.  When you check a box, and select a a button, lets say copy, you
are given
> a new window to enter the new name.  Once entered and you select continue
the a copy
> is made and the list of files is refreshed, displaying also the new file.
All the
> buttons function this way except the download which is where I have
problems.
>
> I a file management class I have a function for each operation.  The code
for the
> download function is as follows:
>
>  function downloadFile($filename)
> {
> $result = "";
> if(file_exists($this->_memberDir . "/" . $filename))
> {
> header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=$filename");
>  header("Pragma: no-cache");
> if (!readfile($this->_memberDir . "/" . $filename))
> $result = $filename . " successfully downloaded";
> }
> else
> {
> $result = "Download Failed for " . $filename . ", does not exist";
> }
> return $result;
> }
>
>
> When this function runs, I get the download box that allows the user to
select where
> they want to save there file and a file gets saved.  After this code
returns the
> $result should be printed at the top of the browser window and the list of
files
> displayed again.  What happens is the results and the list of files, the
html code
> for the next screen, is appended to the end of the file that was
downloaded.  I can
> put an exit() inplace of return and I get the correct file size downloaded
but I
> still don't get my screen refreshed.  I would think that I should be able
to put
> another header statement after the download to indicate the no more data
goes into
> the file but is to be displayed by the browser.  I can't figure out how to
get this
> to work.
>
> Thanks
>
> David Miller
>
>
>
> --
> 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] javascript

2003-03-07 Thread Jim Lucas
Plus, what if their was a textarea that you can't reload from the process
page
because the amount of data was greater then the max limit of the GET
protocol?

Then you would loose all that data.


- Original Message -
From: "David Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 7:40 AM
Subject: Re: [PHP] javascript


You might be checking it 6 or 8 times if the user can't get all the fields
filled in
correctly.  Creates a lot of traffic that isn't necessary between server and
client.
If javascript isn't enabled, there isn't a choice but if it is then the
client side
can prompt the 6 or 8 times until the user gets it correct.

Cranky Kong wrote:
> Yes but if the fields are well filled, you will check all 2 times, the
first
> time on the client side to know that the fields are filled.
> And a second time on server side to check the data before inserting them
in
> a DB for examples...
> So why make 2 tests, if only one is good.
>
> The reloading of the page is very fast.
>
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> If the user is disabled, the user will be bothered to wait till the page
> reloads, sure there MUST be server side check
>
> Cranky Kong wrote:
>
>
>>And what are you doing if the javascript is not enabled in the browser of
>>the client ???
>>There will be no verification and the user can enter what he want in the
>>field of your form
>>And it's a bit dangerous for your DB if your insert data in a DB...
>>
>>
>>"Marek Kilimajer" <[EMAIL PROTECTED]> a écrit dans le message de news:
>>[EMAIL PROTECTED]
>>
>>
>>
>>>Not bothering the user to wait till the next page loads
>>>
>>>Liam Gibbs wrote:
>>>
>>>
>>>
>>>
>If you want to validate form data before sending it, javascript is the
>choise.
>
>
>
>

Yeah, before sending it. Just wondering what the advantage is in


>>
>>validating
>>
>>
>>
before sending.






>>
>>
>>
>>
>>
>
>


--
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] Dollar signs in values

2003-03-07 Thread Jim Lucas
How are you including the file in question?

Jim
- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Thursday, March 06, 2003 9:58 PM
Subject: [PHP] Dollar signs in values


How is it I can properly get PHP to represent dollar signs when putting it
into HTML?

I know that dollar signs denote the beginning of a variable, like $reference
or $ftpstream or whatever. However, I have a text file that contains (or can
contain) values with $ in them. When I open the file and grab those values,
then stick them onto my HTML page, they get unpredictable results. Is there
a way I can escape them or such?




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



Re: [PHP] MySQL Alias and PHP

2003-03-07 Thread Jim Lucas
Then the information in the DB is the same.

Jim
- Original Message - 
From: "Charles Kline" <[EMAIL PROTECTED]>
To: "Rich Gray" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 10:03 AM
Subject: Re: [PHP] MySQL Alias and PHP


Thanks for the help. Almost there. Here is what I have:

SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP  BY x.id LIMIT 0 , 30

The problem is that $array[area_a] and $array[area_b] display the same 
info.





On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:

>> Hi all,
>>
>> I have this query:
>>
>> SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
>> WHERE x.area_1 = a.id
>> AND x.area_2 = b.id
>>
>> I am using PEAR DB to get my results as an ASSOC ARRAY. How do I echo
>> the values for a.id and b.id?
>>
>> Thnks
>> Charles
>>
>
> I presume you mean area_name...
>
> Try this -> SELECT a.area_name as area_a, b.area_name as area_b FROM 
> tbl_1
> x, tbl_2 a, tbl_2 b
> Then you can refer to the columns as $array['area_a'] and 
> $array['area_b']
>
> HTH
> Rich
>


-- 
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] Min and max of array

2003-03-07 Thread Jim Lucas
make a copy of the original array and sort that, when you find it correct
key, use that to refer to the correct value in the original array.

Jim
- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 11:24 AM
Subject: Re: [PHP] Min and max of array


> >you can sort it and get the values.
>
> I would, but I need the array in the same order. I can't sort it.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



Re: [PHP] header function

2003-03-07 Thread Jim Lucas
if you put this at the very to of the page, I am guessing
then that you haven't ran session_start()  ??

if you are trying to access a value stored in a session variable, you need
to initialize the session first, then access the variable.

Jim
- Original Message -
From: "Barry Gould" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 3:35 PM
Subject: [PHP] header function


> I am having a hard time with the header("Location:") function inside an
> include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27).
>
> At the VERY TOP of my php page, I have:
> 
>
> logincheck.php contains exactly:
>  // login check
> if(!isset($_SESSION["agent_id"]))
> {
> header("Location:/");
> header("Connection: close");
> exit;
> }
> ?>
>
> However, if this "agent_id" is not set, I just get a blank page with html
> open and close tags.
>
> I'm SURE there are no spaces or blank lines before these lines.
>
> It works fine if I put the code in the main page instead of using the
> virtual include.
>
> Output buffering is set to 4096 in php.ini.
>
> Any suggestions would be appreciated.
>
> Thanks,
> Barry
>
>
> --
> 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] $PHPSESSID

2003-03-08 Thread Jim Lucas
I think it might have something to do with --enable-trans-sid

read up on that

Jim
- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 8:45 PM
Subject: [PHP] $PHPSESSID


First of all, thanks all who helped with the min and max functions (that
works) and the dollar sign bit (which also works). Kudos. Couldn't have done
it without y'all!

Here's the newest brain teaser: I have cookies disabled (well, I have IE set
to the highest security mode, where it disables cookies). I understand that
with cookies enabled, $PHPSESSID will return nothing when it works. However,
it will return a value when cookies are disabled and the page is refreshed
after a cookie is attempted. I'm still getting nothing either way. Anybody
know why?




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



Re: [PHP] file_exists() question

2003-03-08 Thread Jim Lucas
what does $annrow[id] return?

I HAVE found that I have to refer to a file when using file_exists() from /

so
file_exists("/path/to/me/cherpdocs/filename.doc")

for it to work right.

Jim
- Original Message - 
From: "Charles Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 08, 2003 1:10 PM
Subject: [PHP] file_exists() question


> Can anyone tell me why this code does not return true when the file in 
> the directory cherpdocs/ with the file (which I see as being there) 
> does exist?
> 
> if(file_exists('cherpdocs/$annrow[id].doc')){
>  echo "Funding 
> details paper";
>   }
> 
> This is a path relative to the file calling it, should it be otherwise?
> 
> Thanks
> Charles
> 
> 
> -- 
> 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] Array - Newbie question

2003-03-08 Thread Jim Lucas
You need to have this

$EricCodesArray = array (
 "CO" => array("Description",
   "Input Name",
   "Select Name",
   "Option Name",
   "Option Selected"),
 "AN" => array("ERIC Number",
   "EricAN",
   "SelAN",
   "AN",
   "AN «Annotation»"),
 "TI" => array("Title",
   "EricTI",
   "SelTI",
       "BT",
   "BT «Book Title»")
 );

you must place the 5 elements in a sub array

Jim

- Original Message -
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 08, 2003 4:47 PM
Subject: [PHP] Array - Newbie question


> New at this, somewhat:
>
>  #http://www.php.net/manual/en/ref.array.php
> $EricCodesArray = array (
> "CO" => "Description", "Input Name", "Select Name", "Option Name",
"Option Selected",
> "AN" => "ERIC Number", "EricAN", "SelAN", "AN", "AN «Annotation»",
> "TI" => "Title", "EricTI", "SelTI", "BT", "BT «Book Title»"
> );
>
> echo $EricCodesArray=>TI[2]; //should display "SelTi"
>
> ?>
>
> I want to display "SelTi". How to code for it? I know I should know this.
> EricCodesArray where TI = [2]
>
> ? :)
> John
>
>
> --
> 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] ob_start -- output buffer problem

2003-03-10 Thread Jim Lucas
because the flush happens after everything is done, including the fputs
thingy.

you have to call ob_get_contents() or something like that.

I always to this

ob_start();

do something

$data = ob_get_contents();
ob_end_clean();

then I work with the $data later.

but if you don't use the ob_get_contents(); or ob_end_clean();  then PHP
waits until everything is done, and then flushes.

Jim
- Original Message -
From: "Alex Lance" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 09, 2003 2:22 AM
Subject: [PHP] ob_start -- output buffer problem


>
> Hi all,
>
> to quote from http://www.php.net/manual/en/function.ob-start.php
>
> > void ob_start ( [string output_callback])
> >
> > An optional output_callback function may be specified. This function
> > takes a string as a parameter and should return a string. The function
> > will be called when  ob_end_flush() is called, or when the output
> > buffer is flushed to the browser at the end of the request.
>
> My callback function does not get called unless I manually call
> ob_end_flush().
>
> I'm not interested in calling ob_end_flush() at all,  I want my callback
> function to be called "when the output buffer is flushed to the browser
> at the end of the request" so the question is why isn't this happening?
>
> here's my example:
>
> 
> $x = new test();
>
> echo "hey";
>
> // IF next line is uncommented so it manually flushes
> // then the finish method WILL get called. But I need
> // get around calling anything at the *end* of a script.
>
> //ob_end_flush();
>
>
> class test {
>
> var $msg_file = "cooked_html/error_log2";
>
> function test() {
> ob_start(array(&$this, "finish"));
> $this->msg("got to initialize");
> }
>
> function finish($page) {
> $this->msg("GOT TO FINISH!!!");
> return $page;
> }
>
> function msg ($msg) {
> $msg = "\n" . exec("date") ." ::: ". $msg;
> $fp = fopen($this->msg_file, "a") or die ("cannot open
".$this->msg_file);
> fputs ($fp, $msg, strlen($msg)) or die ("cannot write to
".$this->msg_file);
> fclose($fp);
> }
>
> }
>
> ?>
>
>
> But if ob_end_flush() IS called then the error log WILL have the "GOT TO
> FINISH" message.
>
> Any ideas on why the output is not being flushed automatically?
> thanks
> Alex
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



Re: [PHP] php-general as REPLY TO

2003-07-01 Thread Jim Lucas
You could signup with a company like yahoo.com or hotmail or bend.com and
you could then have a web based email service.

You ALWAYS have choices...  :)

Jim Lucas
- Original Message -
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>
To: "'Derick Rethans'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 3:08 AM
Subject: RE: [PHP] php-general as REPLY TO


> > -Original Message-
> > From: Derick Rethans [mailto:[EMAIL PROTECTED]
> > Sent: 30 June 2003 22:47
> >
> > On Mon, 30 Jun 2003, Doug Essinger-Hileman wrote:
> >
> > > Having said this, I suspect that you and I will continue to
> > disagree,
> > > which is perfectly okay. If this list changes the default I will be
> > > happy. If it doesn't, I will learn to adjust. One request I make is
> > > that folk, including you, Derick, refrain from sending
> > replies to my
> > > email to both the list *and* my personal inbox. There's no need to
> > > waste the bandwidth.
> >
> > You'll have to learn to adjust then I guess. And do those 2k really
> > matter? Come on...  Just get a good mailer that defaults to
> > "Reply-All"
> > (like, mutt, pine, pcpine)
>
> Some of us don't have the choice -- we work in a corporate or
institutional environment where the decision is made centrally.  (Hence M$
Outlook 98 here!!!)
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



Re: [PHP] Using INCLUDES in SAFE MODE

2003-07-02 Thread Jim Lucas
if you are on a linux system, you could always symlink the folders into the
public_html dir.

Jim Lucas
- Original Message -
From: "MIKE YRABEDRA" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 5:36 AM
Subject: [PHP] Using INCLUDES in SAFE MODE


>
>
> I currently have all my users in safe-mode to prevent them from running
> shell commands via php.
>
> I would still like for them to be able to access certain folders (i.e.
PEAR,
> basic_functions, etc..) that reside out of their root.
>
> Since safe_mode prevents this, is there a way in the domain's config, to
> allow access to *specific* directories when in safe_mode?
>
>
> TIA
>
>
>
> ++
> Mike Yrabedra (President)
> 323 Incorporated
> Home of MacDock, MacAgent and MacSurfshop
> ++
> W: http://www.323inc.com/
> P: 770.382.1195
> F: 734.448.5164
> E: [EMAIL PROTECTED]
> I: ichatmacdock
> ++
> "Whatever you do, work at it with all your heart,
> as working for the Lord, not for men."
> ~Colossians 3:23 <{{{><
> ++
>
>
>
> --
> 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



  1   2   3   4   5   6   7   8   9   10   >