php-general Digest 30 Dec 2008 01:52:38 -0000 Issue 5872

Topics (messages 285192 through 285220):

mysql question
        285192 by: ann kok
        285194 by: Phpster

Re: Problem with fetching values...
        285193 by: Michelle Konzack
        285195 by: Eric Butera

Re: imap_rfc822_parse_adrlist problem
        285196 by: Ben Stuyts

Search functionality in website.
        285197 by: Tiji varghese
        285198 by: Miles Thompson
        285199 by: John Corry
        285200 by: Richard Heyes
        285213 by: tedd

Php mysql update
        285201 by: admin.buskirkgraphics.com
        285202 by: Gautier Di Folco
        285203 by: John Corry
        285204 by: admin.buskirkgraphics.com

Need Help
        285205 by: dlinden
        285206 by: Eric Butera
        285208 by: John Corry

Help debugging a file upload on IIS
        285207 by: Brian Dunning
        285210 by: Ashley Sheridan
        285212 by: Ashley Sheridan
        285215 by: Brian Dunning
        285218 by: Ashley Sheridan

Re: Need Help - apology
        285209 by: John Corry
        285211 by: Eric Butera

POSIX 1003.1-2001 gethostname(2)
        285214 by: Brian A. Seklecki
        285216 by: Daniel Brown

running python in php timeout
        285217 by: brad
        285220 by: Lars Torben Wilson

Re: Architecture patterns in PHP
        285219 by: Manuel Lemos

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 all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com


--- End Message ---
--- Begin Message --- The mysql forum is the best place. Note that their holiday schedule may mean some lag in getting answers.

Bastien

Sent from my iPod

On Dec 29, 2008, at 7:51 AM, ann kok <[email protected]> wrote:

Hi all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


__________________________________________________________________ Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com


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


--- End Message ---
--- Begin Message ---
Am 2008-12-29 22:09:16, schrieb chris smith:
> > So, PostgreSQL catch the array by "name"
> >
> >    pg_fetch_array($db_query, null, PGSQL_ASSOC)
> >
> > and MySQL use the "position"
> >
> >    mysql_fetch_array($db_query, MYSQL_NUM)
> 
> Why?
> 
> http://www.php.net/mysql_fetch_array
> 
> Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
> uses BOTH.

Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>               <http://www.can4linux.org/>
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 7:57 AM, Michelle Konzack
<[email protected]> wrote:
> Am 2008-12-29 22:09:16, schrieb chris smith:
>> > So, PostgreSQL catch the array by "name"
>> >
>> >    pg_fetch_array($db_query, null, PGSQL_ASSOC)
>> >
>> > and MySQL use the "position"
>> >
>> >    mysql_fetch_array($db_query, MYSQL_NUM)
>>
>> Why?
>>
>> http://www.php.net/mysql_fetch_array
>>
>> Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
>> uses BOTH.
>
> Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!
>
> Thanks, Greetings and nice Day/Evening
>    Michelle Konzack
>    Systemadministrator
>    24V Electronic Engineer
>    Tamay Dogan Network
>    Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> ##################### Debian GNU/Linux Consultant #####################
> <http://www.tamay-dogan.net/>               <http://www.can4linux.org/>
> Michelle Konzack   Apt. 917                  ICQ #328449886
> +49/177/9351947    50, rue de Soultz         MSN LinuxMichi
> +33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)
>

FWIW you can also use mysql_fetch_assoc

http://us2.php.net/mysql_fetch_assoc

--- End Message ---
--- Begin Message ---
Hi,

On 29 dec 2008, at 08:57, [email protected] wrote:

File a bug report at
http://bugs.php.net

You have a pretty clear-cut case of a built-in function gone awry, and it will probably be fixed pretty fast.

I also rely on this function quite a bit, so it needs to work right when I end up at 5.2.8 some day :-)

I already did that: http://bugs.php.net/bug.php?id=46918
and it has been fixed by [email protected]: "This bug has been fixed in CVS." (Thanks!).

I was trying to find out if a 5.2.9 release is imminent, but I can't seem to find any sort of roadmap. I'm using php from the ports system in FreeBSD, so using CVS would mean going around that.

On 21 dec 2008, at 03:41, Manuel Lemos wrote:

on 12/20/2008 09:34 PM Ben Stuyts said the following:
Hi,

Since upgrading to php 5.2.8 I have a problem with
imap_rfc822_parse_adrlist. When I run the example given on the manual
page at http://nl3.php.net/imap_rfc822_parse_adrlist:
...
So the host part isn't filled in correctly. I have verified this on
two
FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this
works
fine. Before the update, I was running php 5.2.6 and there was no
problem either. Any ideas?

Sometime ago I decided to not use IMAP library functions to parse e-
mail
addresses because it was not handling all sorts of addresses as it
should.

Ben


--- End Message ---
--- Begin Message ---
Hi all,I would like to set up search functionality on my website. I'm using PHP 
and Mysql. Most of the pages contain static text in the html and is not 
database driven. I need some idea on how should I go about it without moving 
everything to database driven functionality. Please help.Thanks in advance! 


      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 10:47 AM, Tiji varghese <[email protected]> wrote:

> Hi all,I would like to set up search functionality on my website. I'm using
> PHP and Mysql. Most of the pages contain static text in the html and is not
> database driven. I need some idea on how should I go about it without moving
> everything to database driven functionality. Please help.Thanks in advance!
>
>
>      Add more friends to your messenger and enjoy! Go to
> http://messenger.yahoo.com/invite/


ht-dig (or digg)

--- End Message ---
--- Begin Message ---
Or even a google search widget...

Miles Thompson wrote:
> On Mon, Dec 29, 2008 at 10:47 AM, Tiji varghese <[email protected]> wrote:

> ht-dig (or digg)
> 

--- End Message ---
--- Begin Message ---
> Hi all,I would like to set up search functionality on my website. I'm using 
> PHP and Mysql. Most
> of the pages contain static text in the html and is not database driven. I 
> need some idea on how
> should I go about it without moving everything to database driven 
> functionality.

You could look into using Zend_Search_Lucene (part of the Zend
framework). Never used it myself, but from what I've read about it, it
looks quite good (plus it's file based, ie. you don't need MySQL).
There's also the Google search widget like I use on my personal
website: http://www.phpguru.org

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)

--- End Message ---
--- Begin Message ---
At 8:17 PM +0530 12/29/08, Tiji varghese wrote:
Hi all,I would like to set up search functionality on my website. I'm using PHP and Mysql. Most of the pages contain static text in the html and is not database driven. I need some idea on how should I go about it without moving everything to database driven functionality. Please help.Thanks in advance!

Try:

http://sperling.com/examples/search/

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Okay maybe i have just forgot.
I am trying to update the database and do a +1 to a int field without pulling 
the data and adding 1 to it and sticking it back in.

Someone refresh me on this please.
I think it is something like.
$dwsl = mysql_query("UPDATE database set Field='+1' WHERE Criteria='Criteria'");

--- End Message ---
--- Begin Message ---
Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET "Field"="Field"+1 WHERE 
"Criteria"=\'Criteria\'');> From: [email protected]> To: 
[email protected]> Date: Mon, 29 Dec 2008 12:05:37 -0500> Subject: 
[PHP] Php mysql update> > Okay maybe i have just forgot.> I am trying to update 
the database and do a +1 to a int field without pulling the data and adding 1 
to it and sticking it back in.> > Someone refresh me on this please.> I think 
it is something like.> $dwsl = mysql_query("UPDATE database set Field='+1' 
WHERE Criteria='Criteria'");> > -- > PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

--- End Message ---
--- Begin Message ---
Wouldn't it be:
mysql_query("UPDATE database set Field = Field+1 WHERE
Criteria='Criteria'");

Note: no '' around +1, = operator

John Corry

[email protected] wrote:
> Okay maybe i have just forgot.
> I am trying to update the database and do a +1 to a int field without pulling 
> the data and adding 1 to it and sticking it back in.
> 
> Someone refresh me on this please.
> I think it is something like.
> $dwsl = mysql_query("UPDATE database set Field='+1' WHERE 
> Criteria='Criteria'");
> 

--- End Message ---
--- Begin Message ---
Sorry about that it hit me right after i sent the email.
Thank You so much for you reply


Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET "Field"="Field"+1 WHERE 
"Criteria"=\'Criteria\'');> From: [email protected]> To: 
[email protected]> Date: Mon, 29 Dec 2008 12:05:37 -0500> Subject: 
[PHP] Php mysql update> > Okay maybe i have just forgot.> I am trying to update 
the database and do a +1 to a int field without pulling the data and adding 1 
to it and sticking it back in.> > Someone refresh me on this please.> I think 
it is something like.> $dwsl = mysql_query("UPDATE database set Field='+1' 
WHERE Criteria='Criteria'");> > -- > PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

--- End Message ---
--- Begin Message ---
I am getting this error and can't resolve;

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132

code listing follows;

<?php
  /* Program: CompanyHome.php
   * Desc:    Displays a Web page that has four levels:
   *          1) the home page, 2) a department page, 3) a
   *          content list page, and 4) a detail page.
   */
if (!isset($_SESSION))                                   #7
  session_start();

include_once("functions_main.inc");

$page = array(                                           #12
  "title"          => "The Company Intranet",
  "header"         => "The Company Intranet",
  "bottom"         => "Copyright(R) 2005",
  "left_nav_links" => array(),
  "body_links"     => array(),
  "col_headers"    => array(),
  "data_rows"      => array(),
);

$admin = FALSE;
$base_url = "CompanyHome.php";
$trail = "<a href='$base_url'>Home</a>";                #24

if (!isset($_SESSION['user_name']))
  header("Location: Login.php");                        #27
else
{
  if (isset($_SESSION['user_dept'])
      && isset($_GET['dept_id']))
  {                                                     #32
    $admin = $_SESSION['user_dept'] == $_GET['dept_id'];
  }

  $cxn = Connect_to_db("Vars.inc");
  $left_nav_links = array();
  $page["browse_level"] =                               #38
    isset($_GET['browse_level']) ?
      $_GET['browse_level'] : "home";               

  switch ($page["browse_level"])                        #42
  {
    case "home":
      $sql = "SELECT name, dept_id, description
              FROM Department
              ORDER BY name";
      $results = mysqli_query($cxn, $sql);
      $body_links = "";
      while($row = mysqli_fetch_assoc($results))        #50
      {
        $link = "$base_url?dept_id=" . $row['dept_id']
          . "&browse_level=department";
        $page["left_nav_links"][$link] = $row['name'];
        $body_links .= "<li><a href=\"" . $link
          . "\">" . $row['name'] . "</a> - "
          . $row['description'];
      }
      $page["left_nav_header"] = "Departments";         #59
      $page["top"] = "Welcome to our Intranet";
      $page["body_text"] = "Welcome to our Intranet "
        . "where each department shares content with "
        . "the whole company.  You can update your "
        . "own departments content too with our simple "
        . "interface.<p>Vist the departments' "
        . "home pages: $body_links";

      break;

    case "department":                                  #70
      $dept_id = $_GET['dept_id'];
      $sql = "SELECT name, dept_id, description
              FROM Department
              WHERE dept_id = $dept_id ORDER BY name";
      $results = mysqli_query($cxn, $sql);
      $row = mysqli_fetch_assoc($results);
      $dept_name = $row['name'];
      $dept_desc= $row['description'];

      $page["left_nav"] = "$dept_name Content";
      $page["body_text"] = "$dept_name - $dept_desc";
      $sql = "SELECT a.name, a.type_id,
                     count(b.content_id)
              FROM Content_Type a
              LEFT OUTER JOIN Content b on
                   a.type_id = b.content_type
                   and b.dept_id = $dept_id
              GROUP BY a.name, a.type_id ORDER BY name";
      $results = mysqli_query($cxn, $sql);

      $body_links = "";
      while($row = mysqli_fetch_assoc($results))        #92
      {
        $link = "$base_url?dept_id=$dept_id"
          . "&type_id=" . $row['type_id']
          . "&browse_level=content";
        $page["left_nav_links"][$link] = $row['name'];
        $body_links .= "<li><a href=\"" . $link
          . "\">" . $row['name'] . "</a>";
      }
      $page["left_nav_header"] = "Content Index";
      $page["top"] = $dept_name;
      $page["body_text"] = "$dept_name - $dept_desc "
        . "<p>Vist the departments' "
        . "areas: $body_links";
      $trail .= " - <a href='$base_url?dept_id=$dept_id"
             .  "&browse_level=department'>$dept_name</a>";
      break;

    case "content":                                    #110
      $dept_id = $_GET['dept_id'];
      $type_id = $_GET['type_id'];
      $sql = "SELECT a.name, a.type_id, b.title,
                b.description, b.content_date,
                b.create_date, b.created_by,
                b.last_upd_date, b.last_upd_by,
                c.name as dept_name, content_id
              FROM Content_Type a, Department c
              LEFT OUTER JOIN Content b on
                a.type_id = b.content_type
                and a.type_id = b.content_type
                and b.dept_id = $dept_id
                and b.content_type = $type_id
              WHERE c.dept_id = $dept_id
              ORDER BY content_date DESC";
      $results = mysqli_query($cxn, $sql);

      $body_links = "";
      $content_count = 0;
      $page["body_text"] = "";

      while($row = mysqli_fetch_assoc($results))       #132
      {
        if (!isset($area_name) && $type_id == $row["type_id"])
        {
          $area_name = $row["name"];
          $dept_name = $row["dept_name"];
        }
        $link = "$base_url?dept_id=$dept_id"
          . "&type_id=" . $row['type_id']
          . "&browse_level=content";
        $page["left_nav_links"][$link] = $row['name'];

        if (!isset($row["content_id"]))               #144
          continue;

        $content_id = $row["content_id"];

        $content_count++;
        $link = "$base_url?dept_id=$dept_id"
          . "&type_id=$type_id&browse_level=content";
        $page["left_nav_links"][$link] = $row['name'];
        $page["data_rows"][] = $row;

      }
      if ($content_count == 0)                         #156
      {
        $page["body_text"] = "There are no $area_name
          content items for $dept_name";
      }
      if ($admin)                                      #161
      {
        $page["body_text"] .= "<p>[<a href='$base_url?dept_id=$dept_id"
               . "&browse_level=details&type_id=$type_id"
               . "&content_id='>add</a>]";
      }
      $page["col_headers"]["title"] = "$area_name Title";
      $page["col_headers"]["content_date"] = "$area_name Date";
      $page["col_headers"]["create_date"] = "Created On";
      $page["col_headers"]["created_by"] = "Created By";
      $page["col_headers"]["last_upd_date"] =
        "Last Updated On";
      $page["col_headers"]["last_upd_by"] =
        "Last Updated By";

      $page["left_nav_header"] = "Content";            #176
      $page["top"] = "$dept_name - $area_name";
      $trail .= " - <a href='$base_url?dept_id=$dept_id"
             .  "&browse_level=department'>$dept_name</a>";
      $trail .= " - <a href='$base_url?dept_id=$dept_id"
             .  "&browse_level=content"
             .  "&type_id=$type_id'>$area_name</a>";
      break;

    case "details":                                    #185
      $dept_id = $_GET['dept_id'];
      $type_id = $_GET['type_id'];

      $sql = "SELECT a.name as dept_name, b.name
              FROM Department a, Content_Type b
              WHERE b.type_id = $type_id
                and a.dept_id = $dept_id
              ORDER BY name";
      $results = mysqli_query($cxn, $sql);
      $body_links = "";
      $content_count = 0;

      while($row = mysqli_fetch_assoc($results))       #198
      {
        $area_name = $row["name"];
        $dept_name = $row["dept_name"];

        if (!isset($row["content_id"]))                #203
          continue;

        $content_count++;
        $link = "$base_url?dept_id=$dept_id"
          . "&type_id=".$row['type_id']
          . "&browse_level=content";
        $page["left_nav_links"][$link] = $row['name'];
        $body_links .= "<li><a href=\"" . $link
          . "\">" . $row['name'] . "</a>";
      }
      $create_date = date("m/d/y", time());
      $created_by = $_SESSION["user_name"];
      $last_upd_by = $_SESSION["user_name"];

      $content_id = $_GET["content_id"];
      $edit = $admin && (@$_GET["edit"] == "true"
                         || $content_id == "");

      if ($content_id != "")                           #222
      {
        Connect_to_db("Vars.inc");
        $sql = "SELECT content_id, dept_id, content_date,
                  content_type as type_id, title,
                  description, create_date,
                  created_by, last_upd_date, last_upd_by
                FROM Content
                WHERE content_id = $content_id";
        $results = mysqli_query($cxn, $sql);
        if ($row = mysqli_fetch_assoc($results))
        {
          foreach ($row as $key => $value)
            $$key = $value;
        }
        $sql = "SELECT download_id, file_name
                FROM Content_Download
                WHERE content_id = $content_id";

        $results = mysqli_query($cxn, $sql);
        while($row = mysqli_fetch_assoc($results))     #242
        {
          $download_id = $row["download_id"];
          $file_name = $row["file_name"];
          $link = "files/$download_id/$file_name";
          $page["left_nav_links"][$link] = $file_name;

          if ($edit)                                   #249
            $page["left_nav_links"][$link] .= "</a>
            [<a href=\"Admin.php"
              . "?action=DeleteDownload&download_id=$download_id\"
            >del</a>]";
        }
      }

      foreach ($_GET as $name => $value)               #257
        $$name = $value;

      $edit = $admin && (@$_GET["edit"] == "true" || $content_id == "");

      $page["top"] = "$dept_name - $area_name";

      if ($edit)                                       #264
      {
        $page["body_text"] = "<center><u>Add Downloads</u>";
        for ($i = 0; $i < 3; $i++)
        {
          $page["body_text"] .=
            "<br><input type='file' name='upload_file$i'>";
        }

        $page["body_text"] .= "
          </center> <p />
          <center>
            <input type='reset' name='action'
              value ='Reset Form'>
            <input type='submit' name='action'
              value ='Cancel'>
            <input type='submit' name='action'
              value ='Save Changes'>
          </center>";

        $page["top"] .= " Edit/Create";
      }
      else
      {
        $page["body_text"] =
          "<a href='javascript:history.go(-1)'>Back</a>";
      }

      $page["left_nav_header"] = "Downloads";
      $trail .= " - <a href='$base_url?dept_id=$dept_id"
             .  "&browse_level=department'>$dept_name</a>";
      $trail .= " - <a href='$base_url?dept_id=$dept_id"
             .  "&browse_level=content"
             .  "&type_id=$type_id'>$area_name</a>";

      break;
  }

  include("company.inc");
}
?>

Thank You,

Dennis Linden 



Cell 609-744-4480

http://www.springtidepartners.com <http://www.springtidepartners.com/> 

SpringTide Partners, LLC

CONFIDENTIALITY NOTICE: This e-mail and any accompanying documents contain
confidential information belonging to the sender which is legally
privileged. The information is intended only for the use of the
individual(s) or entity(ies) named above. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or the taking of any action in reliance on the contents of this
information is strictly prohibited. If you have received this e-mail in
error, please reply as such and delete the e-mail.



--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 2:39 PM, dlinden <[email protected]> wrote:
> I am getting this error and can't resolve;
>
> Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
> boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132
>

I'm not going to read all 500 lines of that, but I'm seeing your error
says boolean given.  Maybe your query failed and is false instead of a
resource.

--- End Message ---
--- Begin Message ---
1. It's generally considered poor etiquette to send that much code to a
mailing list. How about snipping the relevant section next time?

2. the error says: mysqli_fetch_assoc() expects parameter 1 to be
mysqli_result. There's your clue. Is the query good? Is the connection good?

I'm getting a little dismayed here lately at how many people are posting
to this list who don't have a clue and aren't willing to even TRY to get
a clue before asking for help from someone else.

Tracking down errors like this, function by function, is how you LEARN
this stuff.

Please do yourself (and everyone else on the list) a favor and do at
least just even a MODEST amount of research before sending your hundreds
of lines of crappy code out to the ether asking someone to fix it for you!

John

PS - sorry if that's not soft and sensitive enough. Where I come from
(vintage late 90s self-educated programmer), you didn't DARE ask for
help until you could demonstrate to everyone you were asking that you
had done your homework on the problem, researched the relevant
functions/error messages, tried some tests doing something similar, run
the query to make sure it's good...basically everything you COULD do to
debug your own mess.


dlinden wrote:
> I am getting this error and can't resolve;
> 
> Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
> boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132
> 
> code listing follows;

--- End Message ---
--- Begin Message --- Hi - I have a file upload that returns no error, but the file does not appear on the server. Here is the result of $_FILES:

Array (
        [f] => Array (
                [name] => Elephants.pdf
                [type] => application/pdf
                [tmp_name] => C:\WINDOWS\Temp\php3133.tmp
                [error] => 0
                [size] => 114109 ) )

Nothing new at all in C:\Windows\Temp\. PHP is properly putting its session files in there, so I know PHP has permission. Anyway I set Everyone permissions to Full Control for that directory. post_max_size and upload_max_filesize are both 250M. Just not sure what else to check.

PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise Edition, SP2

Thanks.

--- End Message ---
--- Begin Message ---
On Mon, 2008-12-29 at 11:54 -0800, Brian Dunning wrote:
> Hi - I have a file upload that returns no error, but the file does not  
> appear on the server. Here is the result of $_FILES:
> 
> Array (
>       [f] => Array (
>               [name] => Elephants.pdf
>               [type] => application/pdf
>               [tmp_name] => C:\WINDOWS\Temp\php3133.tmp
>               [error] => 0
>               [size] => 114109 ) )
> 
> Nothing new at all in C:\Windows\Temp\. PHP is properly putting its  
> session files in there, so I know PHP has permission. Anyway I set  
> Everyone permissions to Full Control for that directory. post_max_size  
> and upload_max_filesize are both 250M. Just not sure what else to check.
> 
> PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise  
> Edition, SP2
> 
> Thanks.
Are you sure that it is using the same temp directory as it is for the
sessions?


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
On Mon, 2008-12-29 at 20:34 +0000, Ashley Sheridan wrote:
> On Mon, 2008-12-29 at 11:54 -0800, Brian Dunning wrote:
> > Hi - I have a file upload that returns no error, but the file does not  
> > appear on the server. Here is the result of $_FILES:
> > 
> > Array (
> >     [f] => Array (
> >             [name] => Elephants.pdf
> >             [type] => application/pdf
> >             [tmp_name] => C:\WINDOWS\Temp\php3133.tmp
> >             [error] => 0
> >             [size] => 114109 ) )
> > 
> > Nothing new at all in C:\Windows\Temp\. PHP is properly putting its  
> > session files in there, so I know PHP has permission. Anyway I set  
> > Everyone permissions to Full Control for that directory. post_max_size  
> > and upload_max_filesize are both 250M. Just not sure what else to check.
> > 
> > PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise  
> > Edition, SP2
> > 
> > Thanks.
> Are you sure that it is using the same temp directory as it is for the
> sessions?
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
> 
Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
removes the files once the script has run it's course; so unless you're
doing something with the file in your code, you won't really see it.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
The one thing I was doing was:
move_uploaded_file($_FILES['upload_file']['tmp_name'], $new_path);

but nothing was happening, no new file appearing where it was supposed to, and no error returned, left me scratching my head. (Later the same script logs the upload to MySQL using data from $_FILES and that part works fine.)

On Dec 29, 2008, at 12:43 PM, Ashley Sheridan wrote:

Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
removes the files once the script has run it's course; so unless you're
doing something with the file in your code, you won't really see it.



--- End Message ---
--- Begin Message ---
On Mon, 2008-12-29 at 13:29 -0800, Brian Dunning wrote:
> The one thing I was doing was:
> move_uploaded_file($_FILES['upload_file']['tmp_name'], $new_path);
> 
> but nothing was happening, no new file appearing where it was supposed  
> to, and no error returned, left me scratching my head. (Later the same  
> script logs the upload to MySQL using data from $_FILES and that part  
> works fine.)
> 
> On Dec 29, 2008, at 12:43 PM, Ashley Sheridan wrote:
> 
> > Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
> > removes the files once the script has run it's course; so unless  
> > you're
> > doing something with the file in your code, you won't really see it.
> 
> 
> 
Does the script have permission to write the file to the new directory?
What value is returned from attempting this? Just assign that
move_uploaded_file line to a variable and print the output.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
That was too heavy handed.

I'm sorry. Please forgive my harshness.

John

--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 3:18 PM, John Corry <[email protected]> wrote:
>
> That was too heavy handed.
>
> I'm sorry. Please forgive my harshness.
>
> John
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Having a bad day at work? ;)

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

All:

Is anyone interested in adding POSIX 1003.1-2001 gethostname(2) support? I'm interested in sponsoring a small contract development initiative.

I need something more reliable than $_ENV[]. Not all shells export $HOSTNAME by default.

~BAS

--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 16:26, Brian A. Seklecki
<[email protected]> wrote:
>
> All:
>
> Is anyone interested in adding POSIX 1003.1-2001 gethostname(2) support? I'm
> interested in sponsoring a small contract development initiative.
>
> I need something more reliable than $_ENV[].   Not all shells export
> $HOSTNAME by default.

    Brian,

    As you most likely mean the core engine, Brian, this email is
being forwarded to the Internals mailing list.  If you haven't
already, please consider subscribing to that list by sending a blank
email to [email protected].

-- 
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

--- End Message ---
--- Begin Message ---
Hi,

I'm executing a python script from php that runs quite a long time (15+ minutes) and ends up timing out. Is there a way I can execute the python code and move on executing the remaining php code on the page?
Thanks!

--- End Message ---
--- Begin Message ---
2008/12/29 brad <[email protected]>:
> Hi,
>
> I'm executing a python script from php that runs quite a long time (15+
> minutes) and ends up timing out. Is there a way I can execute the python
> code and move on executing the remaining php code on the page?
> Thanks!

Hi Brad,

It's a little tough to say for sure since you didn't specify your OS
or platform (always good info to include), but if you're on *nix then
you'll need to tell the child process to run in the background and
redirect the output from the child process to somewhere else (say, a
log file). You also didn't say how you're executing the child process,
but here's a common way to do it using backticks:

`/path/to/executable "$arg1" "$arg2" >> /path/to/logfile.log 2>&1 &`

The '>> /path/to/logfile.log' redirects standard output from the
process to your log file. The '2>&1' following that redirects the
process's standard error to its standard output (which means that
error messages will also be written to the log file), and the final
ampersand puts the child process into the background.

The same technique also works with exec() etc.


Torben

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

on 12/27/2008 10:57 PM Murray said the following:
> I'm interested in this topic as well. I'm starting out on a reasonably large
> web application, and I'm wondering at the best approach in PHP, particularly
> since it's been some years since I worked with PHP on a daily basis (the
> last 5 years have been purely C#).
> 
> There's some dev community bias against using frameworks, isn't there? On
> one hand I'd love to take an approach that would make my end goal easier
> (thanks for pointing out Code Igniter, I'll look into it further), but on
> the other hand I'd rather avoid choices that 'tainted' (perhaps not the
> right word, but the best I could think of) the overall acceptance of the
> application once it's ready for release.

I would not say there is bias against frameworks, but rather that there
is no consensual around a specific framework. Some people prefer one
framework, other people prefer others. Some people prefer relying on
code written by themselves, others prefer using ready to code provided
by others.

One thing is certain, if you adopt a framework, you need to invest time
learning how to use it. Some frameworks are not easy to learn and you
end up spending more time than you wanted.

Here is a longer reflection about using frameworks in PHP:

http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html


> So, currently I'm wondering about things like, 'Do I make an app that is a
> distinct page-per-function, or do I make an app that uses a monolithic
> index.php (similar to Wordpress?) and dynamically presents
> *everything*based on querystring values.'

Personally I prefer to separate in different pages. It helps making
things more organized.

To sort out things that are more organized, some people use frameworks
to help parsing URL parameters and route requests to different
application modules.

If you separate things, you do not need to build or learn any framework
to handle things separately.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---

Reply via email to