php-general Digest 15 Dec 2001 20:24:02 -0000 Issue 1054

Topics (messages 77815 through 77826):

Re: Is PHP up to task?
        77815 by: Charles Williams
        77823 by: René Fournier

how to reinitialise an MySQL_fetch_array
        77816 by: Ivan Carey

Re: Online editor that edits all pages
        77817 by: Bharath Bhushan Lohray
        77820 by: Vincent Stoessel

Re: What do admins put in their open_basedir
        77818 by: Daniel Urstöger

Re: Unable to return object references from functions
        77819 by: John Lim

Re: [PHP/Apache] Transparent Subdomains ?
        77821 by: Shane Wright

Re: Logout problem - help me out....!
        77822 by: Shane Wright

thanks
        77824 by: david.postboy.net
        77825 by: Michael Sims

Re: file upload problem - Warning: Max file size of 8 bytes exceeded
        77826 by: David Serrano

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

----- Original Message -----
From: "René Fournier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 15, 2001 1:27 AM
Subject: [PHP] Is PHP up to task?


> (Now that I have your attention... :-)
>
> Here's the situation: All the navigational buttons in the site I'm
> working on have three different states (for mousovers--normal,
> mouseover, onClick). What I don't like: When I mouse over one button, it
> takes a second or two for the page to fetch the mouseover state of the
> button from the server. Now, normally, I would just write a
> preloadimages() function in JavaScript and preload all the button states
> when the pages load. BUT, this is a little harder, since this is a
> fairly big site (or will be) and it's not always the same buttons that
> need to be loaded; they can change from page to page (say, between
> sections, with subnav bars). That being said, I've kept one thing
> simple: All the buttons (and their states) are stored in the same
> directory, and in fact only button images are in that directory ("/nav").
>
> So here's what I would like to know: Is it possible for PHP to read the
> contents of a directory--all the files--and then take that array and
> generate some javascript preload() statements? (Of course, I'm sure it
> IS possible, but I would appreciate any pointers you might have before I
> undertake it. Maybe there's even a better way than what I can see!) What
> I was thinking was to preload all the nav buttons and their states in
> the header.inc.
>
> Thanks.
>
> ...Rene

Rene,

Of course this is possible.  However, I doubt if it is desirable.  The more
visitors to your site the larger the load if you load all the graphics,
because each session would have it's own copy of all the graphics.  It would
be better if you checked the page being loaded and passed a list of the
needed graphics needed to a function that would load ONLY those graphics
needed for said page.  This is not too very difficult and if run on a PHP
caching server then the overhead is not so bad.  The hard part is getting
the JS to work correctly (at least for me. hehe. I suck at JS).

For example. http://clans.acnsnet.com is a package I'm working on that uses
templates to control the layout.  Each menu item is stored in an SQL backend
as well as the Template info (location, menu type, state, etc....).  I
already have a function to determine what page is active.  So finding out
what menu items are visible is simply a matter of comparing the active page
to the array of menu items.  I can then determin which images I would need
to load (depending on the template in use).  This way I only load the images
that are needed, which saves on load time and memory.

Anyway, have fun.

chuck

--- End Message ---
--- Begin Message ---
What you're saying makes sense--that loading ALL the nav button images 
for the whole site at once is overkill. In this case, however, it really 
isn't, since there are just to 'sets' of nav buttons--the top-level set, 
which needs to be preloaded no matter what page the user is on; and the 
products subsection set, which SHOULD be preloaded, because every visit 
will inevitably visit that section (it is the reason why any visits the 
site). I agree that if there were numerous sub-level 'sets' of nav 
button images, that loading all of them would be inefficient.

...Rene

On Saturday, December 15, 2001, at 02:08  AM, Charles Williams wrote:

>
> ----- Original Message -----
> From: "René Fournier" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, December 15, 2001 1:27 AM
> Subject: [PHP] Is PHP up to task?
>
>
>> (Now that I have your attention... :-)
>>
>> Here's the situation: All the navigational buttons in the site I'm
>> working on have three different states (for mousovers--normal,
>> mouseover, onClick). What I don't like: When I mouse over one button, 
>> it
>> takes a second or two for the page to fetch the mouseover state of the
>> button from the server. Now, normally, I would just write a
>> preloadimages() function in JavaScript and preload all the button 
>> states
>> when the pages load. BUT, this is a little harder, since this is a
>> fairly big site (or will be) and it's not always the same buttons that
>> need to be loaded; they can change from page to page (say, between
>> sections, with subnav bars). That being said, I've kept one thing
>> simple: All the buttons (and their states) are stored in the same
>> directory, and in fact only button images are in that directory 
>> ("/nav").
>>
>> So here's what I would like to know: Is it possible for PHP to read the
>> contents of a directory--all the files--and then take that array and
>> generate some javascript preload() statements? (Of course, I'm sure it
>> IS possible, but I would appreciate any pointers you might have 
>> before I
>> undertake it. Maybe there's even a better way than what I can see!) 
>> What
>> I was thinking was to preload all the nav buttons and their states in
>> the header.inc.
>>
>> Thanks.
>>
>> ...Rene
>
> Rene,
>
> Of course this is possible.  However, I doubt if it is desirable.  The 
> more
> visitors to your site the larger the load if you load all the graphics,
> because each session would have it's own copy of all the graphics.  It 
> would
> be better if you checked the page being loaded and passed a list of the
> needed graphics needed to a function that would load ONLY those graphics
> needed for said page.  This is not too very difficult and if run on a 
> PHP
> caching server then the overhead is not so bad.  The hard part is 
> getting
> the JS to work correctly (at least for me. hehe. I suck at JS).
>
> For example. http://clans.acnsnet.com is a package I'm working on that 
> uses
> templates to control the layout.  Each menu item is stored in an SQL 
> backend
> as well as the Template info (location, menu type, state, etc....).  I
> already have a function to determine what page is active.  So finding 
> out
> what menu items are visible is simply a matter of comparing the active 
> page
> to the array of menu items.  I can then determin which images I would 
> need
> to load (depending on the template in use).  This way I only load the 
> images
> that are needed, which saves on load time and memory.
>
> Anyway, have fun.
>
> chuck
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
---
René Fournier
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hello,
I would like to reinitialise an MySQL_fetch_array. That is, once it has gone through I 
would like to be able to go back to the start again.

for eg 
while ($myrow=MySQL_fetch_array($result2)) 
    {
     $befid=$myrow["beforeid"];
    
     while($myrow5=MySQL_fetch_array($result5))
         {
              $aftid=$myrow["afteridid"];  
              if ( $befid == aftid)
                  {
                      do something;
                  }
         } //while($myrow5=MySQL_fetch_array($result5))
        
        //now that the inner loop has finished I would like to be able to restart the 
inner loop by reinitailsing the MySQL_fetch_array

    } //while ($myrow=MySQL_fetch_array($result2)) 

Regards,
Ivan


--- End Message ---
--- Begin Message ---
IT IS NOT POSSIBLE!!!

Php does not permit editing of files on the file system of a remote host. If
you want to edit your php scripts on some free host...then place a dirty
code editor on that system...It may be slow but it is the only solution...

It MIGHT be possible to use the fopen() command and make an editor like
that(your imagination) but you need to set the CHMOD of the files each time
you edit it....But it is a BAD idea....It is going to be slow..You may get
several errors....

If it works...make it a public domain for the advantages of others..




"R. Lindeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 sorry fo.....


--- End Message ---
--- Begin Message ---
You may want to take a look at the midgard project's
cms API using php4.
http://www.midgard-project.org/

That combined with a web base interface created by hklc.com
called nadmin studio enables you write your entire web site from a browser.
here is a demo of it on hhlc's site.

http://cmsdemo.hklc.com/
user : demo
pass : demo


R. Lindeman wrote:

> sorry for the inconvieniance but i have to restate my question i'm looking
> for a online editor that is able to edit pages that are not on the same host
> as the editor is.
> 
> thanx
> 
> 
> 
> 



-- 
Vincent Stoessel [EMAIL PROTECTED]
Java Linux Apache Mysql Php (JLAMP) Engineer
(301) 362-1750 Mobile (410) 419-8588
AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica

--- End Message ---
--- Begin Message ---
Ehm ...
I tried to do open_basedir within the .htaccess and own this file by root,
so the user
couldn´t change the settings. But yeah, that wasn´t the best solution, now I
do within
the Apache config file.
A entry for a vhost looks like this:

<VirtualHost IPADRESS>
    ServerAdmin [EMAIL PROTECTED]
    ServerName www.domain.com
    ServerAlias domain.com
    DocumentRoot /home/domain/public_html
    php_admin_value open_basedir /home/domain
</VirtualHost>

Hope it helps !
Cya !

Daniel

"Marc Delisle" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I would like to know if sysadmins usually put "." in their php.ini,
open_basedir variable, or if
> they put some other directory, or both.
>
> The reason is that phpMyAdmin's dump uploads don't work well currently on
a server with
> open_basedir, and I would try to code around the problem, if practical.
>
> Thanks.
>
> Marc Delisle
> phpMyAdmin dev. team


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

I seem to remember having similar problems understanding objects and
references
also and you guided me here. Manuel is a good programmer and if he also has
problems, I'm a bit worried for novices. Objects and references are not
intuitive :(

Regards, John

Yasuo Ohgaki <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Manuel Lemos wrote:
>
> > Hello,
> >
> > I am trying to return a reference from an object created inside a
> > function and at the same time have the object stored in a global
> > variable.
> >
> > It seems that when I try doing it by assigning the object reference to a
> > function argument that is passed by reference, nothing is returned in
> > that variable despite inside the function the argument variable seems to
> > have the right value.
> >
> > Is this a PHP bug or this is not the right way to do it?
>
>
> No this is not a bug, but issue.
>
> Please ask this kind of question only to php-general.
> Thank you.
>
> PS: Read manaul sections (Object and Reference.
> It's explained ;)
>
> --
> Yasuo Ohgaki
>
> >
> > Try the example below.
> >
> > Manuel Lemos
> >
> > <?
> > class test_class
> > {
> >         var $dummy="nothing";
> > };
> >
> > Function not_assigning(&$not_returned,&$copy)
> > {
> >         global $object;
> >
> >         $object=new test_class;
> >         $object->dummy="original";
> > $success=1;
> >         $not_returned= &$object;
> >         $copy=$object;
> >         $copy->dummy="copy";
> > var_dump("In the function",$success,$not_returned,$copy,$object);
> > return $success;
> > }
> >
> > $success=not_assigning($not_returned,$copy);
> >
> > var_dump("Out the function",$success,$not_returned,$copy,$object);
> >
> > ?>
> >
>
>
>
> --
> Yasuo Ohgaki
>


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

If there are no other virtual hosts on your box, you could leave Apache as is 
(unrecognised hostnames will go to the default site), and do the dynamic 
processing in PHP using the $REQUEST_URI variable...

as for the crazy-page.php thing, you could set up a custom error handler page 
that points at your dynamic page...

Hope that helps...

--
Shane



On Thursday 13 Dec 2001 7:56 pm, Jon Shoberg wrote:
> Any ideas on how to pull this off.
>
>     I would like to have http://mydomain.com and http://www.mydomain.com
> resolve to my /index.html page.  When a user types in
> http://crazy.mydomain.com or http://crazy.mydomain.com/crazy-page.php, I
> would like to have it resolve to /home/mydomain/public_html/handler.php
> where I can trap for the subdomain/URI and perform dynamic processing on
> those values.
>
>     I presume it would have to be a process though mod_rewrite and
> .htaccess?  Is this able to be done.  I've gone though quite a bit yet
> unable to get it working as described.
>
> Any ideas?
>
> Jon
--- End Message ---
--- Begin Message ---

HTTP authentication (which is what you're using) is controlled by the 
browser.  Some browsers even keep the login/password after the window is 
closed until the user logs out (Konqueror on Linux for one...)

If you want more control over logins and the ability to do a logout, you 
should make your own login scheme using an HTML form for username/password 
and setting a cookie to flag that the user is 'logged in'.  Then, when the 
user wants to log out, clear the cookie and job done :)

--
Shane

On Saturday 15 Dec 2001 5:37 am, J.F.Kishor wrote:
> hello all,
>
>       I have already posted this mail, Is there anyone to help me out?,
> it's urgent plz.....!
>
>        I have designed a web page using php, as a security measure I have
>  kept it password protected. I have used Apache authentication, using
>  htpasswd file. Now I want to keep a logout in this web page, I tried to
>  send a header request "http/1.0 401 Unauthorized" to force it to
>  reauthenticate when the logout link is clicked in the form, but this dose
>  not work.
>
>  I tried using session_destroy() even that does not work.
>
>  To get the authenticated users name I have used GetEnv("REMOTE_USER") in
>  all the form and with that username I'am handling mysql and other
> requests. I don't know where exactly the REMOTE_USER gets stored.
>
>  So please help me out in this problem. I want to remove the
>  window's authentication cache.
>
>  Please give me some ideas and suggestion to remove the user name and make
>  the page fresh for the other user to log in.
>
>  If possible please send me a sample script.
>
> Thanks for sparing time on this mail.
>
> with hope's,
>                                               - JFK
>
> kishor
> Nilgiri Networks
--- End Message ---
--- Begin Message ---
 been using php for a few months now, just wanted to say a big THANK YOU to all the 
developers for such a wonderful language, thanks guys!
--- End Message ---
--- Begin Message ---
At 07:56 PM 12/15/2001 +0000, [EMAIL PROTECTED] wrote:
>  been using php for a few months now, just wanted to say a big THANK YOU 
> to all the developers for such a wonderful language, thanks guys!

Well, I have to second that.  If it weren't for PHP I probably would have 
never gotten into web development at all.  I've said it before and I'll say 
it again...if Microsoft solutions were the only ones available I would have 
switched careers long ago.  Thank God (and the PHP developers) for PHP!

--- End Message ---
--- Begin Message ---
I'm not sure if you've read this or not but it may help:
http://www.php.net/manual/en/features.file-upload.php

-David Serrano ([EMAIL PROTECTED])

"Lee Philip Reilly" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have an HTML form containing a file upload form object called 'file'.
> When I submit the form (either holiding a path to a 1kb file or a 7MB
> file) I get the following error:
>
> -----
> Warning: Max file size of 8 bytes exceeded - file [file] not saved in
> Unknown on line 0
> -----
>
> I had hoped that by changing the upload_max_filesize value in the
> php.ini this problem would be resolved, but it hasn't. I expect some
> people have had similar problems in the past; can anyone suggest what
> the problem is? Some additional info at the foot of this message.
>
> Thanks in advance!
>
> - Best regards,
>
> Lee
>
> Windows 2000; PHP4; Apache V1.3
>
> PHP.INI reads:
> -=-=-==-=-=-=-=
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 8M
> -=-=-==-=-=-=-=
>
> Simplified PHP script reads:
> -=-=-==-=-=-=-=
> if ($file!=""){
>  @copy("$file", "c:\Program Files\Apache Group\Apache\htdocs\sasdap\v4"
> or die ("Could not copy the file.");
> }
> else {
>  die("No input file specified");
> }
> -=-=-==-=-=-=-=
>
> .HTML's file upload name = "file"
>


--- End Message ---

Reply via email to