php-general Digest 23 Nov 2003 03:02:09 -0000 Issue 2431

Topics (messages 170668 through 170696):

An Application Server in PHP
        170668 by: Luca Mariano

Textfields dont fully populate
        170669 by: PAUL FERRIE
        170670 by: Bas
        170671 by: PAUL FERRIE
        170674 by: Bas
        170675 by: PAUL FERRIE

Re: looking for some software (helpdesk, intranet)
        170672 by: Patrick

Re: Java and PHP
        170673 by: Raditha Dissanayake

Form with browse for file to upload "ftp"
        170676 by: PAUL FERRIE
        170677 by: Nathan Taylor
        170678 by: Nathan Taylor
        170679 by: Nathan Taylor
        170683 by: PAUL FERRIE
        170684 by: Bronislav Klučka
        170685 by: PAUL FERRIE
        170686 by: Eugene Lee
        170687 by: Martin Hudec
        170688 by: John Nichel
        170689 by: PAUL FERRIE
        170694 by: Nathan Taylor

Php ignores if statement
        170680 by: Pieter
        170681 by: RT
        170682 by: John Nichel
        170691 by: Chris Shiflett

SQLITE
        170690 by: Bronislav Klučka
        170692 by: Chris Shiflett

Re: [PHP-DB] Re: [PHP] SQLITE
        170693 by: Bronislav Klučka

Certificate failure for (IMAP)
        170695 by: QT

$_GET String Edit
        170696 by: Jed R. Brubaker

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
Hi guys,
some times ago I started a project called PHPlet with this purpose:
implement an application server where phplet can be deployed. phplet are
just like Java servlets, they have init(), destroy() and service() methods;
they run into the phplet container, from which they receive an
HttpPhpletRequest and send an HttpPhpletResponse.
API for all these class are similar to java one.
I've developed a lot of modules yet, the daemon works both in sigle process
(win32, Linux) & multiprocess mode (on Linux).
The project can be found here: http://phplet.sourceforge.net .
I'm writing here to have some feedback from PHP lovers; what do you think
about this idea?

--- End Message ---
--- Begin Message ---
Hello again guys

   This week i have been on here and  made a few posts regarding a small
admin site app
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

Most of it is now working thank god, but still have have problems fully
populating the textfields when i go to edit a record.
Only one of the fields fully populates with the data returned from the
$query
If i view the source file via the broswer(right click / view source) i can
see that the data has been sent ok
<input type='text' name='format' size=25 maxlength=25 value=cd format>
But all i see is "cd"
Anyone

cheers

Paul

--- End Message ---
--- Begin Message ---
"Paul Ferrie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello again guys
>
>    This week i have been on here and  made a few posts regarding a small
> admin site app
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
>
> Most of it is now working thank god, but still have have problems fully
> populating the textfields when i go to edit a record.
> Only one of the fields fully populates with the data returned from the
> $query
> If i view the source file via the broswer(right click / view source) i can
> see that the data has been sent ok
> <input type='text' name='format' size=25 maxlength=25 value=cd format>
> But all i see is "cd"
> Anyone
>
> cheers
>
> Paul

Try to do it in double quotes(the query-data)
In an echo statement, there you must escape the double quotes.

--- End Message ---
--- Begin Message ---
Sorry m8 i am a total newbie to php+html,
I dont get these problems with PHP+Flash

Here is the code i am using to return the edit page with the data.

$result = mysql_query("SELECT * FROM $tablename WHERE id= $id")or
die("<br>ther was an error<br>
                   tablename:= $tablename<br>
                   row id:= $id");


if ($myrow = mysql_fetch_array($result)) {
  echo "<form method='post' action='edit3.php?tablename=$tablename'>\n";
  do {
    printf("<input type='hidden' name='id' value=%s>
 Artist <br><input type='text' name='artist' size=25 maxlength=25
value=%s><br>
 Title <br><input type='text' name='title' size=25 maxlength=25
value=%s><br>
 Picture <br><input type='text' name='picture' size=25 maxlength=25
value=%s><br>
 Review  <br><textarea name='review' cols=30 rows=5>%s</textarea><br>
 Label<br><input type='text' name='label' size=25 maxlength=25 value=%s><br>
 Format <br><input type='text' name='format' size=25 maxlength=25
value=%s><br>
 Price <br><input type='text' name='price' size=10 maxlength=8 value=%s><br>
 Rating <br><input type='text' name='rating' size=10 maxlength=8
value=%s><br>\n",
 $myrow["id"],
 $artist=$myrow["artist"],
 $title=$myrow["title"],
 $picture=$myrow["picture"],
 $review=$myrow["review"],
 $lable=$myrow["label"],
 $format=$myrow["format"],
 $price=$myrow["price"],
 $rating=$myrow["rating"]);
  } while ($myrow = mysql_fetch_array($result));
 echo "<br><input type='submit' value='Submit' name='submit'>";
echo "<input type='reset' value='Reset' name='reset'></form>\n";
}

Cheers

Paul

"Bas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Paul Ferrie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hello again guys
> >
> >    This week i have been on here and  made a few posts regarding a small
> > admin site app
> > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >
> > Most of it is now working thank god, but still have have problems fully
> > populating the textfields when i go to edit a record.
> > Only one of the fields fully populates with the data returned from the
> > $query
> > If i view the source file via the broswer(right click / view source) i
can
> > see that the data has been sent ok
> > <input type='text' name='format' size=25 maxlength=25 value=cd format>
> > But all i see is "cd"
> > Anyone
> >
> > cheers
> >
> > Paul
>
> Try to do it in double quotes(the query-data)
> In an echo statement, there you must escape the double quotes.

--- End Message ---
--- Begin Message ---
Just change your code to:

$result = mysql_query("SELECT * FROM $tablename WHERE id= $id")or
die("<br>ther was an error<br>
                   tablename:= $tablename<br>
                   row id:= $id");


if ($myrow = mysql_fetch_array($result)) {
  echo "<form method='post' action='edit3.php?tablename=$tablename'>\n";
  do {
    printf("<input type='hidden' name='id' value=%s>
 Artist <br><input type='text' name='artist' size=25 maxlength=25
value='%s'><br>
 Title <br><input type='text' name='title' size=25 maxlength=25
value='%s'><br>
 Picture <br><input type='text' name='picture' size=25 maxlength=25
value='%s'><br>
 Review  <br><textarea name='review' cols=30 rows=5>%s</textarea><br>
 Label<br><input type='text' name='label' size=25 maxlength=25
value='%s'><br>
 Format <br><input type='text' name='format' size=25 maxlength=25
value='%s'><br>
 Price <br><input type='text' name='price' size=10 maxlength=8
value='%s'><br>
 Rating <br><input type='text' name='rating' size=10 maxlength=8
value='%s'><br>\n",
 $myrow["id"],
 $artist=$myrow["artist"],
 $title=$myrow["title"],
 $picture=$myrow["picture"],
 $review=$myrow["review"],
 $lable=$myrow["label"],
 $format=$myrow["format"],
 $price=$myrow["price"],
 $rating=$myrow["rating"]);
  } while ($myrow = mysql_fetch_array($result));
 echo "<br><input type='submit' value='Submit' name='submit'>";
echo "<input type='reset' value='Reset' name='reset'></form>\n";
}

I have not tested this, but it should work(it was a html-problem)

--- End Message ---
--- Begin Message ---
Thank you Bas, i cant believe that once again it has been down to simple
syntx
cheers


"Bas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

b1.pair.com...
> Just change your code to:
>
> $result = mysql_query("SELECT * FROM $tablename WHERE id= $id")or
> die("<br>ther was an error<br>
>                    tablename:= $tablename<br>
>                    row id:= $id");
>
>
> if ($myrow = mysql_fetch_array($result)) {
>   echo "<form method='post' action='edit3.php?tablename=$tablename'>\n";
>   do {
>     printf("<input type='hidden' name='id' value=%s>
>  Artist <br><input type='text' name='artist' size=25 maxlength=25
> value='%s'><br>
>  Title <br><input type='text' name='title' size=25 maxlength=25
> value='%s'><br>
>  Picture <br><input type='text' name='picture' size=25 maxlength=25
> value='%s'><br>
>  Review  <br><textarea name='review' cols=30 rows=5>%s</textarea><br>
>  Label<br><input type='text' name='label' size=25 maxlength=25
> value='%s'><br>
>  Format <br><input type='text' name='format' size=25 maxlength=25
> value='%s'><br>
>  Price <br><input type='text' name='price' size=10 maxlength=8
> value='%s'><br>
>  Rating <br><input type='text' name='rating' size=10 maxlength=8
> value='%s'><br>\n",
>  $myrow["id"],
>  $artist=$myrow["artist"],
>  $title=$myrow["title"],
>  $picture=$myrow["picture"],
>  $review=$myrow["review"],
>  $lable=$myrow["label"],
>  $format=$myrow["format"],
>  $price=$myrow["price"],
>  $rating=$myrow["rating"]);
>   } while ($myrow = mysql_fetch_array($result));
>  echo "<br><input type='submit' value='Submit' name='submit'>";
> echo "<input type='reset' value='Reset' name='reset'></form>\n";
> }
>
> I have not tested this, but it should work(it was a html-problem)

--- End Message ---
--- Begin Message --- At 03:49 PM 11/21/2003 -0800, Chris W. Parker wrote:
I'm looking for some helpdesk software and some intranet software with a
MySQL backend.

I use OneOrZero's helpdesk software for a couple of sites. Here's the website: http://helpdesk.oneorzero.com/


It's not perfect, but it's free. Plus their forums have a number of hacks you can add in!

-Patrick






Patrick Schneider [EMAIL PROTECTED]

Technical Support Specialist, RMS
Treasurer, Midwest Animation Promotion Society Board of Directors
External Operations Section Chief, ACEN 2k4
Director of Registration, ACEN 2k4

--- End Message ---
--- Begin Message --- hi

The same way that you invoke any other system binary with backticks, exec etc like this:

`java javasystem -scenario`;


NOTE: using java objects directly in PHP is a different kettle of fish altogether, there are some interesting articles on that topic on many web sites including phpbuilder.


all the best

Fredrik wrote:

Hi

I want to start a java system from a php script, anybody who know how i can
do that.

Something like this:

if(isset($trigger)){
   java javasystem -scenario;
}

Is this possible and how can i do it.


-Fred






--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

--- End Message ---
--- Begin Message ---
Getting bit of a regular on here :)

I am hoping that someone can point me to a script that allows me to attach a
file to be uploaded to a set dir.
I have already got the form built, except for a browse file option.
The form is part of this admin area
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
Instead of having a textfield displaying a url of the image and the admin
having to upload it sepratly i thought that i could get the admin to upload
the image via the form.  keeps it altogether.

I wouldnt know were to begin adding this to the form.  i am pretty sure
there a pre-built script that can do this.  Can someone point me to one.  i
had a quick look but came up with very little.

Cheers
Paul

--- End Message ---
--- Begin Message ---
There is nothing special to be done with the form itself for it to support file 
uploading aside from supply a browse field:

<input type="file" name="file">

As for uploading it, here's some untested code:

 if(!empty($_FILES['file']['tmp_name'])) {
     $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name']));
     $destination = 'path/to/where/you/want/the/file/saved/'.$name;
     if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
      echo 'Successful';
     } else {
      echo 'Failed';
     }
  }
  ----- Original Message ----- 
  From: PAUL FERRIE 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 22, 2003 2:04 PM
  Subject: [PHP] Form with browse for file to upload "ftp"


  Getting bit of a regular on here :)

  I am hoping that someone can point me to a script that allows me to attach a
  file to be uploaded to a set dir.
  I have already got the form built, except for a browse file option.
  The form is part of this admin area
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
  Instead of having a textfield displaying a url of the image and the admin
  having to upload it sepratly i thought that i could get the admin to upload
  the image via the form.  keeps it altogether.

  I wouldnt know were to begin adding this to the form.  i am pretty sure
  there a pre-built script that can do this.  Can someone point me to one.  i
  had a quick look but came up with very little.

  Cheers
  Paul

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


--- End Message ---
--- Begin Message ---
There is nothing special to be done with the form itself for it to support file 
uploading aside from supply a browse field:

<input type="file" name="file">

As for uploading it, here's some untested code:

 if(!empty($_FILES['file']['tmp_name'])) {
     $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name']));
     $destination = 'path/to/where/you/want/the/file/saved/'.$name;
     if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
      echo 'Successful';
     } else {
      echo 'Failed';
     }
  }
  ----- Original Message ----- 
  From: PAUL FERRIE 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 22, 2003 2:04 PM
  Subject: [PHP] Form with browse for file to upload "ftp"


  Getting bit of a regular on here :)

  I am hoping that someone can point me to a script that allows me to attach a
  file to be uploaded to a set dir.
  I have already got the form built, except for a browse file option.
  The form is part of this admin area
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
  Instead of having a textfield displaying a url of the image and the admin
  having to upload it sepratly i thought that i could get the admin to upload
  the image via the form.  keeps it altogether.

  I wouldnt know were to begin adding this to the form.  i am pretty sure
  there a pre-built script that can do this.  Can someone point me to one.  i
  had a quick look but came up with very little.

  Cheers
  Paul

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


--- End Message ---
--- Begin Message ---
Oh and also, don't forget to set: enctype="multipart/form-data" in the <form> tag.

Nathan
  ----- Original Message ----- 
  From: Nathan Taylor 
  To: PAUL FERRIE ; [EMAIL PROTECTED] 
  Sent: Saturday, November 22, 2003 2:20 PM
  Subject: Re: [PHP] Form with browse for file to upload "ftp"


  There is nothing special to be done with the form itself for it to support file 
uploading aside from supply a browse field:

  <input type="file" name="file">

  As for uploading it, here's some untested code:

   if(!empty($_FILES['file']['tmp_name'])) {
       $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name']));
       $destination = 'path/to/where/you/want/the/file/saved/'.$name;
       if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
        echo 'Successful';
       } else {
        echo 'Failed';
       }
    }
    ----- Original Message ----- 
    From: PAUL FERRIE 
    To: [EMAIL PROTECTED] 
    Sent: Saturday, November 22, 2003 2:04 PM
    Subject: [PHP] Form with browse for file to upload "ftp"


    Getting bit of a regular on here :)

    I am hoping that someone can point me to a script that allows me to attach a
    file to be uploaded to a set dir.
    I have already got the form built, except for a browse file option.
    The form is part of this admin area
    http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
    Instead of having a textfield displaying a url of the image and the admin
    having to upload it sepratly i thought that i could get the admin to upload
    the image via the form.  keeps it altogether.

    I wouldnt know were to begin adding this to the form.  i am pretty sure
    there a pre-built script that can do this.  Can someone point me to one.  i
    had a quick look but came up with very little.

    Cheers
    Paul

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


--- End Message ---
--- Begin Message ---
I am getting this error once i run the script

Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
Permission denied in /blah/blah
Do i need to set the chmod of the img folder?

Cheers
Paul


"Nathan Taylor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
There is nothing special to be done with the form itself for it to support
file uploading aside from supply a browse field:

<input type="file" name="file">

As for uploading it, here's some untested code:

 if(!empty($_FILES['file']['tmp_name'])) {
     $name = strtolower(eregi_replace('#| |\?|!', '',
$_FILES['file']['name']));
     $destination = 'path/to/where/you/want/the/file/saved/'.$name;
     if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
      echo 'Successful';
     } else {
      echo 'Failed';
     }
  }
  ----- Original Message -----
  From: PAUL FERRIE
  To: [EMAIL PROTECTED]
  Sent: Saturday, November 22, 2003 2:04 PM
  Subject: [PHP] Form with browse for file to upload "ftp"


  Getting bit of a regular on here :)

  I am hoping that someone can point me to a script that allows me to attach
a
  file to be uploaded to a set dir.
  I have already got the form built, except for a browse file option.
  The form is part of this admin area
  http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
  Instead of having a textfield displaying a url of the image and the admin
  having to upload it sepratly i thought that i could get the admin to
upload
  the image via the form.  keeps it altogether.

  I wouldnt know were to begin adding this to the form.  i am pretty sure
  there a pre-built script that can do this.  Can someone point me to one.
i
  had a quick look but came up with very little.

  Cheers
  Paul

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

--- End Message ---
--- Begin Message ---
User executing the script (www-data or nobody or some other user) has to
vave the permission to wotk with this directory.



Brona


> I am getting this error once i run the script
>
> Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
> Permission denied in /blah/blah
> Do i need to set the chmod of the img folder?
>
> Cheers
> Paul
>
>
> "Nathan Taylor" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> There is nothing special to be done with the form itself for it to support
> file uploading aside from supply a browse field:
>
> <input type="file" name="file">
>
> As for uploading it, here's some untested code:
>
>  if(!empty($_FILES['file']['tmp_name'])) {
>      $name = strtolower(eregi_replace('#| |\?|!', '',
> $_FILES['file']['name']));
>      $destination = 'path/to/where/you/want/the/file/saved/'.$name;
>      if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
>       echo 'Successful';
>      } else {
>       echo 'Failed';
>      }
>   }
>   ----- Original Message -----
>   From: PAUL FERRIE
>   To: [EMAIL PROTECTED]
>   Sent: Saturday, November 22, 2003 2:04 PM
>   Subject: [PHP] Form with browse for file to upload "ftp"
>
>
>   Getting bit of a regular on here :)
>
>   I am hoping that someone can point me to a script that allows
> me to attach
> a
>   file to be uploaded to a set dir.
>   I have already got the form built, except for a browse file option.
>   The form is part of this admin area
>   http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
>   Instead of having a textfield displaying a url of the image and
> the admin
>   having to upload it sepratly i thought that i could get the admin to
> upload
>   the image via the form.  keeps it altogether.
>
>   I wouldnt know were to begin adding this to the form.  i am pretty sure
>   there a pre-built script that can do this.  Can someone point me to one.
> i
>   had a quick look but came up with very little.
>
>   Cheers
>   Paul
>
>   --
>   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
>

--- End Message ---
--- Begin Message ---
eh?

"Bronislav klučka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> User executing the script (www-data or nobody or some other user) has to
> vave the permission to wotk with this directory.
>
>
>
> Brona
>
>
> > I am getting this error once i run the script
> >
> > Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
> > Permission denied in /blah/blah
> > Do i need to set the chmod of the img folder?
> >
> > Cheers
> > Paul
> >
> >
> > "Nathan Taylor" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > There is nothing special to be done with the form itself for it to
support
> > file uploading aside from supply a browse field:
> >
> > <input type="file" name="file">
> >
> > As for uploading it, here's some untested code:
> >
> >  if(!empty($_FILES['file']['tmp_name'])) {
> >      $name = strtolower(eregi_replace('#| |\?|!', '',
> > $_FILES['file']['name']));
> >      $destination = 'path/to/where/you/want/the/file/saved/'.$name;
> >      if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
> >       echo 'Successful';
> >      } else {
> >       echo 'Failed';
> >      }
> >   }
> >   ----- Original Message -----
> >   From: PAUL FERRIE
> >   To: [EMAIL PROTECTED]
> >   Sent: Saturday, November 22, 2003 2:04 PM
> >   Subject: [PHP] Form with browse for file to upload "ftp"
> >
> >
> >   Getting bit of a regular on here :)
> >
> >   I am hoping that someone can point me to a script that allows
> > me to attach
> > a
> >   file to be uploaded to a set dir.
> >   I have already got the form built, except for a browse file option.
> >   The form is part of this admin area
> >   http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >   Instead of having a textfield displaying a url of the image and
> > the admin
> >   having to upload it sepratly i thought that i could get the admin to
> > upload
> >   the image via the form.  keeps it altogether.
> >
> >   I wouldnt know were to begin adding this to the form.  i am pretty
sure
> >   there a pre-built script that can do this.  Can someone point me to
one.
> > i
> >   had a quick look but came up with very little.
> >
> >   Cheers
> >   Paul
> >
> >   --
> >   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
> >

--- End Message ---
--- Begin Message ---
On Sat, Nov 22, 2003 at 08:18:30PM -0000, PAUL FERRIE wrote:
: 
: "Bronislav klučka" <[EMAIL PROTECTED]> wrote in message
: news:[EMAIL PROTECTED]
: >
: > User executing the script (www-data or nobody or some other user) has to
: > vave the permission to wotk with this directory.
: 
: eh?

I think he meant to say:

: > The user executing the script (www-data or nobody or some other user)
: > has to have the permission to work with this directory.

--- End Message ---
--- Begin Message ---
Hello,

He said that you have to check under which user/group is your webserver 
running (webserver is handling the scripts)... and then set the correct 
file/directory permissions on that /blah/blah directory......

yes u have to set at least chmod.... but look to chown also...

On Saturday 22 November 2003 21:18, PAUL FERRIE wrote:
> eh?
>
> "Bronislav klučka" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > User executing the script (www-data or nobody or some other user) has to
> > vave the permission to wotk with this directory.
> >
> >
> >
> > Brona
> >
> > > I am getting this error once i run the script
> > >
> > > Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
> > > Permission denied in /blah/blah
> > > Do i need to set the chmod of the img folder?
> > >
> > > Cheers
> > > Paul
> > >

-- 
:
:. kind regards
:..                      Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: [EMAIL PROTECTED] [EMAIL PROTECTED]
:.:
:.: "When you want something, all the universe 
:.:   conspires in helping you to achieve it."
:.:                   - The Alchemist (Paulo Coelho)

--- End Message ---
--- Begin Message --- PAUL FERRIE wrote:

I am getting this error once i run the script

Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
Permission denied in /blah/blah
Do i need to set the chmod of the img folder?

Cheers
Paul
<snip>

The user or group that your webserver is running as (default for Apache: nobody/nobody) has to have write permission in both the temp upload directory, and the directory that you're trying to move the file to.


-- By-Tor.com It's all about the Rush http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Got it working :)
thanks for the help

Paul

"Paul Ferrie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Getting bit of a regular on here :)
>
> I am hoping that someone can point me to a script that allows me to attach
a
> file to be uploaded to a set dir.
> I have already got the form built, except for a browse file option.
> The form is part of this admin area
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> Instead of having a textfield displaying a url of the image and the admin
> having to upload it sepratly i thought that i could get the admin to
upload
> the image via the form.  keeps it altogether.
>
> I wouldnt know were to begin adding this to the form.  i am pretty sure
> there a pre-built script that can do this.  Can someone point me to one.
i
> had a quick look but came up with very little.
>
> Cheers
> Paul

--- End Message ---
--- Begin Message ---
Glad to be of service. =)
  ----- Original Message ----- 
  From: PAUL FERRIE 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 22, 2003 3:52 PM
  Subject: [PHP] Re: Form with browse for file to upload "ftp"


  Got it working :)
  thanks for the help

  Paul

  "Paul Ferrie" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]
  > Getting bit of a regular on here :)
  >
  > I am hoping that someone can point me to a script that allows me to attach
  a
  > file to be uploaded to a set dir.
  > I have already got the form built, except for a browse file option.
  > The form is part of this admin area
  > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
  > Instead of having a textfield displaying a url of the image and the admin
  > having to upload it sepratly i thought that i could get the admin to
  upload
  > the image via the form.  keeps it altogether.
  >
  > I wouldnt know were to begin adding this to the form.  i am pretty sure
  > there a pre-built script that can do this.  Can someone point me to one.
  i
  > had a quick look but came up with very little.
  >
  > Cheers
  > Paul

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


--- End Message ---
--- Begin Message ---
I recently started coding online and i have the weirdest response, my code is: 

<?php

include 'function.inc';

echo "$id<br>";

print (gettype($id));

if ($id = "add" )

{

echo "is add";

exit;

}


if ($id = "own" )

{


echo "id is own";

exit;

}

if ($id = "all" )

{


echo "id is all";

exit;

}

?>

$id in this case  = "own", but it totally ignores this value and uses the first if 
statement and treats $id as if it has a value of "add". I am very frustrated and i 
really hope someone can help me. The server is linux, and php version 4.1.2

Thanks


--- End Message ---
--- Begin Message ---
On Sat, 2003-11-22 at 13:57, Pieter wrote:
> I recently started coding online and i have the weirdest response, my code is: 
> 
> <?php
> 
> include 'function.inc';
> 
> echo "$id<br>";
> 
> print (gettype($id));
> 
> if ($id = "add" )
> 
> {
> 
> echo "is add";
> 
> exit;
> 
> }
> 
> 
> if ($id = "own" )
> 
> {
> 
> 
> echo "id is own";
> 
> exit;
> 
> }
> 
> if ($id = "all" )
> 
> {
> 
> 
> echo "id is all";
> 
> exit;
> 
> }
> 
> ?>
> 
> $id in this case  = "own", but it totally ignores this value and uses the first if 
> statement and treats $id as if it has a value of "add". I am very frustrated and i 
> really hope someone can help me. The server is linux, and php version 4.1.2
> 
> Thanks
> 

Don't use = use ==
By using the = you are assigning $id to that value making the if
statement always true. 

The compare one to the other use == instead
-- 
"I have a photographic memory. I just forgot the film" --Unknown
=============================
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net

--- End Message ---
--- Begin Message --- Pieter wrote:
I recently started coding online and i have the weirdest response, my code is:

<?php

include 'function.inc';

echo "$id<br>";

print (gettype($id));

if ($id = "add" )

{

echo "is add";

exit;

}
<snip>

'=' sets value. '==' checks equality.

http://www.php.net/manual/en/language.operators.comparison.php

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
--- Pieter <[EMAIL PROTECTED]> wrote:
> I recently started coding online and i have the weirdest response,
> my code is: 
> 
> if ($id = "add" )

When you convert the string "add" to a boolean, it equates to true.

I'm assuming you want to be using a conditional expression rather than an
assignment statement. Either this was a typo, or you should really read a
lot of introductory material on PHP's syntax, as I'm guessing this is your
first programming language. Start with the PHP manual:

http://www.php.net/manual/

Expressions are discussed here:

http://www.php.net/manual/en/language.expressions.php

PHP's conditional expressions are given as follows:

--------------------------------------------------
PHP supports > (bigger than), >= (bigger than or equal to), == (equal), !=
(not equal), < (smaller than) and <= (smaller than or equal to).
--------------------------------------------------

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
Hi, I've got questions:

I've got sqlite like PHP module (under windows). I tried this:
        a)execute script 1 (selecting from some table), it tooks 2 minutes
        b)execute script 2 , it tooks 3 minutes
        c)execute them both at the same time (from different browser windows), both
of them stopped also at the same time and       it tooks 5 minutes

I've tried another questions and both of the scripts allways stopped at the
same time with duration of he sum of the time fo each process separated.
This is not, of course, the behaviour I would expect... Is this some feature
of sqlite or an I doing something wrong??

I've also tried the same with MySql and the result should be like
1/ first script alone - 2 minutes
2/ second script alone - 3 minutes
3/ both of them at the same time - first took 3 minutes, second took 4
minutes...



Brona

--- End Message ---
--- Begin Message ---
--- Bronislav_Klučka <[EMAIL PROTECTED]> wrote:
> Hi, I've got questions:

I only noticed one.

> I've got sqlite like PHP module (under windows). I tried this:
> a)execute script 1 (selecting from some table), it tooks 2 minutes
> b)execute script 2 , it tooks 3 minutes
> c)execute them both at the same time (from different browser
> windows), both of them stopped also at the same time and it tooks
> 5 minutes

[snip]

> Is this some feature of sqlite or an I doing something wrong?

Without seeing any code or being given any details, all I can make is an
educated guess. SQLite uses the filesystem for storage. If your queries
are needing to access the same file (maybe you're querying the same
table), SQLite is going to serialize those queries to help you avoid
threading problems. So, your queries are going to basically take turns.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
That's my code:
$dbfile="db.sdb";
$db=sqlite_open($dbfile);
$res=sqlite_query($db,"select a.*,b.* from a left join b on a.id=b.id_a
where a.name like \"%1%\" or b.street like \"%1%\" order by cellphone");
echo sqlite_num_rows($res).CRLF;
sqlite_close($db);

It's realy just "benchmark" I've done. I'm pretty much aware of system
sqlite is useing to store the data, and I also find obvious that if it would
be runnig like web database module, users will ask the same table ata the
same time (like with other db system, they are looking at the same page) but
I find it not good, I was only asking if there is a "way to change it"


Bronislav Klucka

>
> > Is this some feature of sqlite or an I doing something wrong?
>
> Without seeing any code or being given any details, all I can make is an
> educated guess. SQLite uses the filesystem for storage. If your queries
> are needing to access the same file (maybe you're querying the same
> table), SQLite is going to serialize those queries to help you avoid
> threading problems. So, your queries are going to basically take turns.
>

--- End Message ---
--- Begin Message ---
Dear Sirs,

I try to connect to email inbox via IMAP but I am getting folowing error:

Certificate failure for  xxxxxx self signed certificate:
/C=--/ST=SomeState/L=SomeCity

Any idea what is it mean?

--- End Message ---
--- Begin Message ---
Hey  - this one should be simple.

I am parsing some data and have $_GET variables in the URL stipulating on
which record to start and how many records to display (these then get basses
to the limit command in my database query).

So here is the catch. I am trying to make a page navigation menu (we have
all seen them, "Page: 1 2 3..."), and I would like to continue doing this
via the URL variables.  Right now, each of the page numbers is a hyper link
is set like this:

"page.php?".$_SERVER["QUERY_STRING"]."&more variables here."

The problem, however, is that those variables are a string. If the variables
that the menu defines are already in the string, it doesn't update them, it
just adds more definitions to the URL.

How have you people dealt with this? I am sure that there is some elegant
solution and I would love to know what it is.

Thanks in advance!

--- End Message ---

Reply via email to