Re: [PHP] passing checkbox info

2002-08-20 Thread Jaski

1)Name value pairs of check boxes which are checked will be 
returned.
2)To figure out which check box is returning "yes" you can use the 
keys of the cbox[] array which is returned. That is if your query 
returns 10 rows .. and user checks checkbox 1,3 and 5 out of those 
.. then $cbox[0], $cbox[2],$cbox[4] .. will have values "yes".

3)Then you can use $checked = array_keys($cbox) .. and $checked 
will be an array having all the keys of returned cbox array. ie 
(0,2,4) in the above case.

HTH
Jaski

On Wed, 21 Aug 2002 Brian & Shannon Windsor wrote :
>I'm trying to use checkboxes to be able to delete information 
> from my
>database.  It's just not working right.  I can't get the checkbox 
>form to
>pass a variable that makes any sense to me, and I looked into the 
>check box
>function, and it made less sense.  The value passed back from the 
>check
>boxes are always "yes", but there is nothing to tell which box 
>passed it
>back.  Maybe I don't know enough about the check boxes in 
>general.  Any help
>is appreciated.
>
>I'm displaying the checkboxes as I display the data from the 
>database. Can I
>tie in the checkboxes to one of the fields that i could then use 
>to delete
>that entry?
>
>Thanks,
>
>Brian
>
>while ($row = mysql_fetch_row($result))
>{
>  echo "\n";
>   {
>?>
>
>
>   echo "";
>echo "height='50'
>border='0'>";
>   echo "";
>echo $row[1];
>   echo "";
>echo $row[2];
>   echo "";
>echo $row[3];
>   echo "";
>echo $row[4];
>   echo "";
>echo $row[5];
>   echo "";
>echo $row[6];
>   echo "";
>echo $row[7];
>   echo "";
>echo $row[8];
>   echo "\n";
>   }
>
>  echo "\n";
>
>}
>
>echo "";
>
>?>
>
>
>
>--
>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 IDEs

2002-08-21 Thread Jaski

Even I would be very interested to know what every one out there 
uses for these. I use PhpMyAdmin for creating tables. Textpad for 
coding.

Jaski

On Wed, 21 Aug 2002 Michael Egan wrote :
>I know similar threads have come up on this in the past but I 
>suspect it's a constantly changing picture.
>
>I recently saw a favourable review of Zend Studio 2.5 but 
>wondered, out of curiosity, what sort of tools people use to 
>develop PHP scripts and MySQL databases, tables and queries.
>
>Up until now, in an attempt to try and get to grips with these 
>packages, I've been using a variety of text editors from VI to 
>Kwrite.  But I'm wondering whether it might speed up development 
>times if I start to use one of the tools out there for working 
>with PHP and MySQL.
>
>Any thoughts?
>
>Michael Egan
>
>--
>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] file uploads problem

2002-09-23 Thread Jaski

Hi,
(Linux RH 7.1, Apache/1.3.22, PHP 4.0.6).

I am trying to write a script to send emails. It needs to support 
attachments. The point where I am stuck is after the file to be 
attached gets uploaded to /tmp as /tmp/tempfilename thorough an 
HTTP POST form.

I am not able to open that file directly .. follwing error shows 
up.

Warning: fopen("/tmp/phpOaILXx","rb") - Operation not
permitted in
/var/www/vhosts/mydomain/httpsdocs/lib/email.inc.php
on line 254


I tried to copy this file using
move_uploaded_file($userfile, "/place/to/put/uploaded/file");

and here a strange thing happened. The file was successfully 
copied BUT it had permissions like -rw-- which I interpret as 
only accessible to root. I tried copy() function instead and it 
failed.


I think I have tried every thing I could think of .. so please 
HELP :)

jaski

NP. I am subscribed to the digest version so kindly cc any replies 
to me as well. Thanks.

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




Re: Re: [PHP] file uploads problem

2002-09-23 Thread Jaski

Thanks .. but I think you are saying exactly what I wrote  I was 
doing .. except that you have used exec("cp $file $path") while I 
tried PHP's copy() function .. I don't think that will make a 
difference...though will give that a try any way.

Forgot to mention in my previous mail that the directory where I 
am trying to copy the uploaded file from /tmp is in 777 mode 
already.


Jaski

On Tue, 24 Sep 2002 Oscar F wrote :
>Try:
>
>$upload = "/path/to/copy/";
>$upload_path = "$upload/$file_filename";
>if (is_uploaded_file($file)) {
>Exec("cp $filename $upload_path");
>}
>
>Then you have the file at /path/to/copy/, and you can 
>do whatever you want with it. (I'm assuming the file field of the 
>form is called "file", and that /path/to/copy/ has permissions 
>set so that PHP can write to it, 777 will work for sure, but I'm 
>not 100% positive which one would be best due to security and 
>stuff.).
>
>HTH. Oscar.-
>
>Jaski wrote:
>
>>Hi,
>>(Linux RH 7.1, Apache/1.3.22, PHP 4.0.6).
>>
>>I am trying to write a script to send emails. It needs to 
>>support attachments. The point where I am stuck is after the 
>>file to be attached gets uploaded to /tmp as /tmp/tempfilename 
>>thorough an HTTP POST form.
>>
>>I am not able to open that file directly .. follwing error shows 
>>up.
>>
>>Warning: fopen("/tmp/phpOaILXx","rb") - Operation not
>>permitted in
>>/var/www/vhosts/mydomain/httpsdocs/lib/email.inc.php
>>on line 254
>>
>>
>>I tried to copy this file using
>>move_uploaded_file($userfile, "/place/to/put/uploaded/file");
>>
>>and here a strange thing happened. The file was successfully 
>>copied BUT it had permissions like -rw-- which I interpret 
>>as only accessible to root. I tried copy() function instead and 
>>it failed.
>>
>>
>>I think I have tried every thing I could think of .. so please 
>>HELP :)
>>
>>jaski
>>
>>NP. I am subscribed to the digest version so kindly cc any 
>>replies to me as well. Thanks.
>>
>
>


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




Re: Re: [PHP] file uploads problem

2002-09-24 Thread Jaski

No Edwin .. I can't do any thing to that file .. not even from my 
ftp client .. can't download can't change permissions ..

The server is managed by rackspace .. I doubt they would do some 
thing like running apache as root which I "hear" is a v foolish 
thing to do  (frankly I don't know how to figure it out myself 
..if that is the case .. phpinfo() did not say any thing on 
that.)

A brief restatement of problem

File uploaded via HTTP POST to /tmp  OK

After this I tried the following three things and none worked.

a) fopen("/tmp/temp_file_name","rb")  FAILED (Operation not 
permitted)
b) copy($tempfile, "/place/to/put/uploaded/file") FAILED
c) move_uploaded_file($userfile, "/place/to/put/uploaded/file") 
DID COPY BUT file had -rw permissions, and could not open 
this file either... so back to square 1

The directory in "/place/to/put/uploaded/file is mode 777 .


Still fighting it out.
Regards
Jaski



On Tue, 24 Sep 2002 @ Edwin wrote :
>Just a comment...
>
>On Tuesday, September 24, 2002 1:39 PM
>Jaski wrote:
>
> > I tried to copy this file using
> > move_uploaded_file($userfile, 
>"/place/to/put/uploaded/file");
> >
> > and here a strange thing happened. The file was successfully
> > copied BUT it had permissions like -rw-- which I interpret 
>as
> > only accessible to root. I tried copy() function instead and 
>it
> > failed.
> >
>
>...having that "permission" doesn't necessarily mean that it's 
>only
>accessible to root--unless of course you're running Apache as 
>root, which I
>doubt you'd do.
>
>Anyway, if the file was successfully copied why not just try to 
>open it
>there?
>
>- E


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




Re: Re: Re: [PHP] file uploads problem

2002-09-24 Thread Jaski

Thanks Edwin .. this one was Bang On. It was exactly what you said 
.. and now it works .. thanks a lot.

Jaski

On Tue, 24 Sep 2002 @ Edwin wrote :
>Jaski,
>
>On Tuesday, September 24, 2002 5:07 PM
>Jaski wrote:
> > No Edwin .. I can't do any thing to that file .. not even from 
>my
> > ftp client .. can't download can't change permissions ..
> >
>
>I think you won't be able to do anything with the file IF you use 
>your ftp
>client. The reason is because *you* don't own the file so you 
>can't read it
>nor change it's permissions. Your *script(s)* owns the file so 
>most probably
>if you use another script to read and change the permissions, the 
>script
>would be able to do it. In other words, use your php script to 
>read and
>change the permissions. Perhaps, you'd like to play with these 
>functions and
>see what's happening...
>
>   http://www.php.net/manual/en/function.is-readable.php
>   http://www.php.net/manual/en/function.fileperms.php
>   http://www.php.net/manual/en/function.chown.php
>
>Of course, there's a lot more others under
>
>   http://www.php.net/manual/en/ref.filesystem.php
>
>HTH,
>
>- E


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