php-general Digest 9 Nov 2003 16:33:59 -0000 Issue 2405

Topics (messages 168974 through 168991):

Re: Help With Recursion && Multi-Dimensional Arrays
        168974 by: Jordan S. Jones
        168981 by: Burhan Khalid
        168988 by: Lowell Allen

Re: BTML 2.0 released!!!
        168975 by: John Nichel
        168976 by: Robert Cummings

Re: Beveled text
        168977 by: Javier Muniz
        168978 by: Ashley M. Kirchner
        168980 by: Ashley M. Kirchner
        168982 by: Javier Muniz
        168983 by: Ashley M. Kirchner

Problems with session_id() in Windows?
        168979 by: Steve Lane
        168989 by: Steve Buehler

Dose this exist?
        168984 by: Dave Carrera
        168987 by: Burhan Khalid
        168990 by: Greg Beaver

Executing shell commands
        168985 by: Teren
        168986 by: Robert Cummings

Re: PHP session won't die!
        168991 by: Marek Kilimajer

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 --- Navid,

So you want something like this:

Category 1
Category 2
    |
     ---> Category a
    |
    ----> Category b
                 |
                  ----> Category X
                 |
                  ----> Category Y
                               |
                                ----> Category AC
                               |
                                ----> Category BC
                  |
                   ----> Category Z
    |
     ----> Category c
Category 3

in a multi-dimentional array????

Jordan S. Jones



Navid Yar wrote:

Hello Guys,

I need a little bit of help with recursion. I've searched our PHP website
and Google, but none helped me understand my problem. There is a code below
this message in order to help you understand what I am trying to achieve.
Here is an explaination:

What I'm trying to do is list a typical category/subcategory system with
parents and children associated with those parents. My database table
(categories) lists all the parents and children together, each with a
parent_id field
(with root being a value of 0). What I want to do is, if a user clicked on
one of the parent categories, only one level of that category will show (or
only the direct children of that specific category will show). I want the
depth to be endless because I want to control the depth some other way. I
know that using a recursive theory would cost a lot as far as speed goes,
but I'm willing to risk it for now.

Here is the problem: The problem is that the recursive method yields several
arrays, instead of one long array. I tried to use an array_push() function,
but that doesn't seem to work well with multi-dimentional arrays. I tried
the straight way, i.e. $menu_array[$count]['name'] = $name_of_category or
$menu_array['name'][$count] = $name_of_category, but that yields several
arrays instead of one long array or category names. The depth of the
categories can be determined by the $_GET string passed, $_GET['some_path'],
which is in the format: parent1_child1_grandchild1_grandchild2,
etc.($some_path = 1_4_6_8), where all of these are related to each other.
These, of course, are split using the underscore delimeter: $path['0'] = 1,
$path['1'] = 4, and so on.

And finally, here is my question: How do I get all these categories, parents
and children, listed into one array and then returned. I want to be able to
list them on the web page using one array. I will also include id,
parent_id, and other info with each array, but first I want to get the name
listings of the categories to work. Also, if anyone has any suggestions
about a more speedier way to do this, please let me know.

Sorry for the long explaination, I just wanted to make sure you guys
understood my goals. Thanks in advance to anyone that responds, I appreciate
it very much. Here is the code I promised:

-----------------------------------------

function menu_tree($parent_id = '0', $cPath = '', $menu_array = '') {
   if (!is_array($menu_array)) {
       $menu_array = array();
       $cPath = $this->separatePath($_GET['cPath']); // separates $_GET
string into array of category ids
   } else {
       reset($cPath);
       array_shift($cPath);
   }

   if (sizeof($cPath) >= 0) {
       $db = new base_db();
       $query = "select cid, name, parent_id from categories where
parent_id = '" . $parent_id . "' order by sort_order, name;";
       $categories = $db->fetch_results($query);
       //echo sizeof($cPath)."<br />";
       //echo $query."<br />";

       for ($i = 0, $count = 0; $i < count($categories); $i++, $count++) {
          // The following are the methods I tied, but failed to work
           //$menu_array['name'][$count] = $categories[$i]['name'];
           //$menu_array[]['name'] = $categories[$i]['name'];
           //$menu_array['name'][] = $categories[$i]['name'];
                //array_push($menu_array, $categories[$i]['name']); // This one works, 
but
does not yeild a multi-dimensional array, which is what I need if I were to
add more information to the output of this array, like id and parent_id
           //array_push($menu_array[$count]['name'],
$categories[$i]['name']); // This does not work, gives error saying the
first parameter of array_push must be an array

           if (($this->get_children($categories[$i]['cid'])) &&
in_array($categories[$i]['cid'],$cPath)) {
               $this->menu_tree($categories[$i]['cid'], $cPath,
$menu_array);
           }
       }
   }
   print_r($menu_array);
}

-----------------------------------------
Here is what it returns using the print_r() function on $menu_array

Array ( [name] => Array
       (
           [0] => Cars
           [1] => Honda
           [2] => Accord
           [3] => 1996
           [4] => 1997
           [5] => 1998
           [6] => 1999
           [7] => 2000
           [8] => 2001
           [9] => 2002
       )
)
Array ( [name] => Array
       (
           [0] => Cars
           [1] => Honda
           [2] => Accord
           [3] => Civic
       )
)
Array
(
   [name] => Array
       (
           [0] => Cars
           [1] => Honda
           [2] => Toyota
       )
)
Array
(
   [name] => Array
       (
           [0] => Cars
           [1] => Suvs
           [2] => Trucks
       )
)




-- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones

--- End Message ---
--- Begin Message --- Navid Yar wrote:

Hello Guys,

I need a little bit of help with recursion. I've searched our PHP website
and Google, but none helped me understand my problem. There is a code below
this message in order to help you understand what I am trying to achieve.
Here is an explaination:

What I'm trying to do is list a typical category/subcategory system with
parents and children associated with those parents. My database table
(categories) lists all the parents and children together, each with a
parent_id field
(with root being a value of 0). What I want to do is, if a user clicked on
one of the parent categories, only one level of that category will show (or
only the direct children of that specific category will show). I want the
depth to be endless because I want to control the depth some other way. I
know that using a recursive theory would cost a lot as far as speed goes,
but I'm willing to risk it for now.

Here is the problem: The problem is that the recursive method yields several
arrays, instead of one long array. I tried to use an array_push() function,
but that doesn't seem to work well with multi-dimentional arrays. I tried
the straight way, i.e. $menu_array[$count]['name'] = $name_of_category or
$menu_array['name'][$count] = $name_of_category, but that yields several
arrays instead of one long array or category names. The depth of the
categories can be determined by the $_GET string passed, $_GET['some_path'],
which is in the format: parent1_child1_grandchild1_grandchild2,
etc.($some_path = 1_4_6_8), where all of these are related to each other.
These, of course, are split using the underscore delimeter: $path['0'] = 1,
$path['1'] = 4, and so on.

Can you give a sample of what the print_r() of the desired output would be like? That would help :)



-- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com ----------------------- "Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing."

--- End Message ---
--- Begin Message ---
[snip]

> What I'm trying to do is list a typical category/subcategory system with
> parents and children associated with those parents. My database table
> (categories) lists all the parents and children together, each with a
> parent_id field
> (with root being a value of 0). What I want to do is, if a user clicked on
> one of the parent categories, only one level of that category will show (or
> only the direct children of that specific category will show). I want the
> depth to be endless because I want to control the depth some other way. I
> know that using a recursive theory would cost a lot as far as speed goes,
> but I'm willing to risk it for now.
> 
> Here is the problem: The problem is that the recursive method yields several
> arrays, instead of one long array. I tried to use an array_push() function,
> but that doesn't seem to work well with multi-dimentional arrays. I tried
> the straight way, i.e. $menu_array[$count]['name'] = $name_of_category or
> $menu_array['name'][$count] = $name_of_category, but that yields several
> arrays instead of one long array or category names. The depth of the
> categories can be determined by the $_GET string passed, $_GET['some_path'],
> which is in the format: parent1_child1_grandchild1_grandchild2,
> etc.($some_path = 1_4_6_8), where all of these are related to each other.
> These, of course, are split using the underscore delimeter: $path['0'] = 1,
> $path['1'] = 4, and so on.
> 
> And finally, here is my question: How do I get all these categories, parents
> and children, listed into one array and then returned. I want to be able to
> list them on the web page using one array. I will also include id,
> parent_id, and other info with each array, but first I want to get the name
> listings of the categories to work. Also, if anyone has any suggestions
> about a more speedier way to do this, please let me know.

I'm currently experimenting with something very similar to what you
describe, and having success by creating one array from a database query,
then using foreach loops to go through that array to display the main menu,
find submenu items or create submenu arrays as needed. However, I'm limiting
menus to three levels deep, so I can get away with conditional checks that
only need to consider id, parent id, and grandparent id.

Here's how I create the main array:

$menu_sql = "SELECT id, parentid, menuname FROM pages WHERE
displaystatus='Y' ORDER BY parentid, displayorder";
$menu_result = mysql_query($menu_sql);
if (mysql_num_rows($menu_result) > 0) {
    while ($menu_row = mysql_fetch_array($menu_result)) {
        $menu_array[] = array($menu_row["id"], $menu_row["parentid"],
$menu_row["menuname"]);
    }
}

Here's the code that creates the main menu:

// home id is 10
$id = isset($_GET["id"]) ? $_GET["id"] : 10;
$pid = isset($_GET["pid"]) ? $_GET["pid"] : 0;
$gpid = isset($_GET["gpid"]) ? $_GET["gpid"] : "";

// create tab menu
echo("<div id=\"tabs\">\n<ul>\n");
foreach ($menu_array as $menu) {
    if ($menu[1] == 0) {
        if ($menu[0] == $id || $menu[0] == $pid || $menu[0] == $gpid) {
            echo("<li id=\"selected\"><a href=\"" . $PHP_SELF . "?id=" .
$menu[0] . "&pid=0\">" . $menu[2] . "</a></li>\n");
        } else {
            echo("<li><a href=\"" . $PHP_SELF . "?id=" . $menu[0] .
"&pid=0\">" . $menu[2] . "</a></li>\n");
        }
    }
}
echo("</ul>\n</div>\n");

Second-level and third-level menus are created in a similar manner:

if ($gpid == "0") {
    // display children of parent page, then children of current page
    // build submenu of child pages of parent page
    foreach ($menu_array as $subcheck) {
        if ($subcheck[1] == $pid) {
            $sublevel[] = array($subcheck[0], $subcheck[1], $subcheck[2]);
        }
    }
    if (count($sublevel) > 0) {
        $menu_count = 0;
        echo("<div id=\"submenu\">\n");
        foreach ($sublevel as $sublink) {
            $menu_count++;
            if ($menu_count < count($sublevel)) {
                if ($sublink[0] == $id) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\" style=\"font-weight: bold; color:
#900;\">" . $sublink[2] . "</a> | \n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\">" . $sublink[2] . "</a> | \n");
                }
            } else {
                if ($sublink[0] == $id) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\" style=\"font-weight: bold; color:
#900;\">" . $sublink[2] . "</a>\n</div>\n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\">" . $sublink[2] . "</a>\n</div>\n");
                }
            }
        }
    }
    // build submenu of child pages of current page
    foreach ($menu_array as $subcheck2) {
        if ($subcheck2[1] == $id) {
            $sublevel2[] = array($subcheck2[0], $subcheck2[1],
$subcheck2[2]);
        }
    }
    if (count($sublevel2) > 0) {
        $menu_count = 0;
        echo("<div id=\"submenu2\">\n");
        foreach ($sublevel2 as $sublink2) {
            $menu_count++;
            if ($menu_count < count($sublevel2)) {
                echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $pid . "\">" . $sublink2[2] . "</a> |
\n");
            } else {
                echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $pid . "\">" . $sublink2[2] .
"</a>\n</div>\n");
            }
        }
    }
} elseif ($gpid != "" && $gpid != "0") {
    // display children of grandparent page, then children of parent page
    // build submenu of children of grandparent page
    foreach ($menu_array as $subcheck) {
        if ($subcheck[1] == $gpid) {
            $sublevel[] = array($subcheck[0], $subcheck[1], $subcheck[2]);
        }
    }
    if (count($sublevel) > 0) {
        $menu_count = 0;
        echo("<div id=\"submenu\">\n");
        foreach ($sublevel as $sublink) {
            $menu_count++;
            if ($menu_count < count($sublevel)) {
                if ($sublink[0] == $pid) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\" style=\"font-weight: bold; color:
#900;\">" . $sublink[2] . "</a> | \n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\">" . $sublink[2] . "</a> | \n");
                }
            } else {
                if ($sublink[0] == $pid) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\" style=\"font-weight: bold; color:
#900;\">" . $sublink[2] . "</a>\n</div>\n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink[0] .
"&pid=" . $sublink[1] . "&gpid=0\">" . $sublink[2] . "</a>\n</div>\n");
                }
            }
        }
    }
    // build submenu of child pages of parent page
    foreach ($menu_array as $subcheck2) {
        if ($subcheck2[1] == $pid) {
            $sublevel2[] = array($subcheck2[0], $subcheck2[1],
$subcheck2[2]);
        }
    }
    if (count($sublevel2) > 0) {
        $menu_count = 0;
        echo("<div id=\"submenu2\">\n");
        foreach ($sublevel2 as $sublink2) {
            $menu_count++;
            if ($menu_count < count($sublevel2)) {
                if ($sublink2[0] == $id) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $gpid . "\" style=\"font-weight: bold;
color: #900;\">" . $sublink2[2] . "</a> | \n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $gpid . "\">" . $sublink2[2] . "</a> |
\n");
                }
            } else {
                if ($sublink2[0] == $id) {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $gpid . "\" style=\"font-weight: bold;
color: #900;\">" . $sublink2[2] . "</a>\n</div>\n");
                } else {
                    echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $gpid . "\">" . $sublink2[2] .
"</a>\n</div>\n");
                }
            }
        }
    }
} elseif ($pid == "0") {
    // only display children of current page
    // build submenu of child pages of current page
    foreach ($menu_array as $subcheck2) {
        if ($subcheck2[1] == $id) {
            $sublevel2[] = array($subcheck2[0], $subcheck2[1],
$subcheck2[2]);
        }
    }
    if (count($sublevel2) > 0) {
        $menu_count = 0;
        echo("<div id=\"submenu\">\n");
        foreach ($sublevel2 as $sublink2) {
            $menu_count++;
            if ($menu_count < count($sublevel2)) {
                echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $pid . "\">" . $sublink2[2] . "</a> |
\n");
            } else {
                echo("<a href=\"" . $PHP_SELF . "?id=" . $sublink2[0] .
"&pid=" . $sublink2[1] . "&gpid=" . $pid . "\">" . $sublink2[2] .
"</a>\n</div>\n");
            }
        }
    }
}

Sorry for all the code, and sorry I can't offer an example URL (don't think
the client would like me to at this stage), but HTH.

--
Lowell Allen

--- End Message ---
--- Begin Message --- Robert Cummings wrote:
On Sat, 2003-11-08 at 21:07, John Nichel wrote:

I suggested the same thing...albeit not as nice as you ;) and got a, "Kiss my ass" response.



WOW, 2 posts in about 2 hours, both 24 hours after the thread died.
Seems like you're the only one keeping the thread going. I'm not sure
how to explain to you, how ridiculous you seem.

Cheers,
Rob.

Don't look now Rob, but someone else just posted to the thread....and not off of either of my posts. I really don't need you to explain anything to me, cause if I want an example on 'ridiculous', I'll reread your little flame war....over top-posting vs bottom-posting no less. I will do something though, that you claimed you were going to do '24 hours' ago, and not post anymore to this topic.


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


--- End Message ---
--- Begin Message ---
This was a private "REPLY" to you. So you're just an asshole now.

Cheers,
Rob.


On Sat, 2003-11-08 at 23:16, John Nichel wrote:
> Robert Cummings wrote:
> > On Sat, 2003-11-08 at 21:07, John Nichel wrote:
> > 
> >>I suggested the same thing...albeit not as nice as you ;) and got a, 
> >>"Kiss my ass" response.
> >>
> > 
> > 
> > WOW, 2 posts in about 2 hours, both 24 hours after the thread died.
> > Seems like you're the only one keeping the thread going. I'm not sure
> > how to explain to you, how ridiculous you seem.
> > 
> > Cheers,
> > Rob.
> 
> Don't look now Rob, but someone else just posted to the thread....and 
> not off of either of my posts.  I really don't need you to explain 
> anything to me, cause if I want an example on 'ridiculous', I'll reread 
> your little flame war....over top-posting vs bottom-posting no less.  I 
> will do something though, that you claimed you were going to do '24 
> hours' ago, and not post anymore to this topic.
> 
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
You'll have to increase the character spacing as well, so that each
character has the same center not just the individual word/phrase.  I don't
think this is going to be exactly a bevel effect, but on small enough text
it might appear like one.

-Javier

-----Original Message-----
From: Nathan Taylor [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 6:02 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Beveled text


Well, I'm speaking from imagination here but I imagine the effect could be
obtained by creating a series of layers to one item in a loop, changing the
alpha transparency slightly each time as well as shrinking the size of the
image.  You'd start with 75ish alpha level and then loop through one level
at a time up a to 100 or something like that, shrinking the text gradually
and building off the same center each time.

Try it and tell me what happens, I am curious.

Cheers,
Nathan
  ----- Original Message ----- 
  From: Siddhartha Lahiri 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 08, 2003 8:45 AM
  Subject: [PHP] Beveled text


  Hi, is it possible to create a beveled text using GD.
  Going through all the classes I have not come across any algorithm which
  explains beveled text.
  Siddhartha

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

--- End Message ---
--- Begin Message --- Siddhartha Lahiri wrote:

Hi, is it possible to create a beveled text using GD.
Going through all the classes I have not come across any algorithm which
explains beveled text.
Siddhartha

I take the text, and output it three times. The first time it'll be dark, and shifted down and right. The second time it'll be light, shifted up and left, and the last time it'll be a color in between those two, not shifted.

This produces the attached result. Not exactly beveled, but pretty close (and it's the effect I wanted.)


--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.




--- End Message ---
--- Begin Message --- Ashley M. Kirchner wrote:

This produces the attached result. Not exactly beveled, but pretty close (and it's the effect I wanted.)

Hmm, yes. Attached result gets stripped by the listserv. So, it's also visible here:


http://37th.yeehaw.net/phpiscool.png

--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.

--- End Message ---
--- Begin Message ---
Interesting, is this for a website?  If so have you tried doing the same
thing with CSS?  Using CSS you could make the site load faster and be more
accessible (for instance, you can allow users to choose their own font size,
and make it easier for page readers to handle your page).

-Javier

-----Original Message-----
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 10:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Beveled text


Ashley M. Kirchner wrote:

>    This produces the attached result.  Not exactly beveled, but pretty
> close (and it's the effect I wanted.)

    Hmm, yes.  Attached result gets stripped by the listserv.  So, it's 
also visible here:

    http://37th.yeehaw.net/phpiscool.png

-- 
 H| I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A. 

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

--- End Message ---
--- Begin Message --- Javier Muniz wrote:

Interesting, is this for a website?  If so have you tried doing the same
thing with CSS?  Using CSS you could make the site load faster and be more
accessible (for instance, you can allow users to choose their own font size,
and make it easier for page readers to handle your page).

When I originally created the script, it was simply an exercise, to see if I could do it. However, I have since then incorporated it into a site design of mine, where I wanted the headers to be images, dynamically created. So yes, for each page that loads, each header calls this script which then spits out the PNG data. Large overhead, simply because I never bothered looking into doing it with CSS, and also because outputting a PNG image I'm guaranteed it will work, and it will look the way I want it to look (both font type, as well as with layout positioning,) as opposed to dealing with broken browsers and people not seeing the same thing. And also because I can use my fonts, instead of relying on the user having a particular font installed on their system.

--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.

--- End Message ---
--- Begin Message ---
Hello all:

We recently ported an application from Linux to Windows and had a few
sessions-handling issues (we were going from PHP 4.1.2 Linxu to PHP 4.3.3
Windows).

We traced this to PHP's session_id() function. It worked fine in Linux, but
apparently not at all in windows, or not as expected.

Has anyone seen or heard of this? The notes in the docs didn't tell me
anything special about this.

-- steve lane

--- End Message ---
--- Begin Message --- Check your php.ini file and see where it is trying to save your sessions at. I "think" it is trying to save them to /tmp. You might have to make sure that directory exists. You might also have to put it in as the full path. ex.....C:\tmp. Make sure to restart your apache, or whatever Web Server you are running after making this change.

Steve

At 12:10 AM 11/9/2003, you wrote:
Hello all:

We recently ported an application from Linux to Windows and had a few
sessions-handling issues (we were going from PHP 4.1.2 Linxu to PHP 4.3.3
Windows).

We traced this to PHP's session_id() function. It worked fine in Linux, but
apparently not at all in windows, or not as expected.

Has anyone seen or heard of this? The notes in the docs didn't tell me
anything special about this.

-- steve lane

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

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

Is there such a tool that will generate a form and relevant code when given
the mysql db->table->fields to update, select, insert etc ?

I ask as hand coding forms and the relevant php code is becoming very time
consuming and I need to speed up this operation.

Any URL's would be useful.

Thank you in advance for any help

Yours
Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003
 

--- End Message ---
--- Begin Message --- Dave Carrera wrote:

Hi List,

Is there such a tool that will generate a form and relevant code when given
the mysql db->table->fields to update, select, insert etc ?

I ask as hand coding forms and the relevant php code is becoming very time
consuming and I need to speed up this operation.

Any URL's would be useful.

http://pear.php.net/HTML_Quickform http://smarty.php.net

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."

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

Although HTML_QuickForm is useful, you will find DB_DataObject is closer to what you need http://pear.php.net/db_dataobject

Greg
--
phpDocumentor
http://www.phpdoc.org

Dave Carrera wrote:
Hi List,

Is there such a tool that will generate a form and relevant code when given
the mysql db->table->fields to update, select, insert etc ?

I ask as hand coding forms and the relevant php code is becoming very time
consuming and I need to speed up this operation.

Any URL's would be useful.

Thank you in advance for any help

Yours
Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003

--- End Message ---
--- Begin Message ---
Hi, I'm trying to write a front end for something and I want to be able to execute 
shell commands. I tried all of the pre-written functions and non of them would work. I 
setup a user that can sudo and then i set apache to run as that user. So, what I tried 
to do is shell_exec("sudo -s; reboot;"); but that didn't work, I also tried other 
numerous variations all of which didn't work (also using exec(), system(), passthru()  
). If any one has any ideas how i can do this, please let me know. Thanks

Teren

--- End Message ---
--- Begin Message ---
On Sun, 2003-11-09 at 03:41, Teren wrote:
>
> Hi, I'm trying to write a front end for something and I want to be able
> to execute shell commands. I tried all of the pre-written functions
> and non of them would work. I setup a user that can sudo and then i
> set apache to run as that user. So, what I tried to do is
> shell_exec("sudo -s; reboot;"); but that didn't work, I also tried
> other numerous variations all of which didn't work (also using exec(),
> system(), passthru()  ). If any one has any ideas how i can do this,
> please let me know. Thanks

I believe this has been answered quite recently and the large consensus
was to have a daemon (cron or otherwise) check for some status file or
database entry, which when set it would perform the required function.
So for instance to reboot the machine, perhaps a cron job would check
for the existence of /tmp/myFrontEnd/reboot and if found reboot the
machine. Thus the front end would only need to create the file.

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

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:
I have tried about 15 combinations of unset(), session_unregister(), session_destroy(), session_unset(), $_SESSION = array(),
I miss session_start in the list. You have to start the session prior to destroying it.
--- End Message ---

Reply via email to