php-general Digest 23 Feb 2002 16:42:47 -0000 Issue 1189

Topics (messages 85925 through 85941):

Re: sometimes browser just recieves half the page
        85925 by: Gary

Re: how to build an array
        85926 by: Steven Walker
        85928 by: jtjohnston

Not Quite: how to build an array
        85927 by: jtjohnston

Re: login determines content on page
        85929 by: jtjohnston
        85930 by: Rasmus Lerdorf

Subject: [PHP] imagecreate with Windows .exe installer
        85931 by: Mike Brackenridge

fork?
        85932 by: Paul Roberts
        85933 by: Andrey Hristov

Newbie on Sessions/Pages Management
        85934 by: Alexander P. Javier
        85939 by: Michael Kimsal
        85940 by: Edward van Bilderbeek - Bean IT

Unix Authentication
        85935 by: developer.viitindia.org

Output buffering behaviour
        85936 by: hassan

mysql_db_query and the future?
        85937 by: Thomas Seifert
        85938 by: Eric Thelin

uploading files | how to avoid submitting twice?
        85941 by: Andy

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


John Ericson wrote:

> Im programming a page where I have a java-tree-menu that gets generated
> from a db. The code works perfectly but sometimes when a browser reads the
> page I just get half of the page. I have noticed this behaivour on many
> different browsers such as mozilla, netscape, galeon, explorer and even
> wget sometimes.
> 
> The page is here so you can try it yourself (Its a frameset page actually,
> the page with the problem is to the left):
> http://www.rskhq.2y.net/~nacka/
> The actual php page that has the problem is:
> http://www.rskhq.2y.net/~nacka/vr_navbar.php
> 
> 
> I suspect it is some problem with the configuration of apache or php but
> I dont know where to start looking. 
> 
> Versions:
> PHP 4.1.1 (See http://www.rskhq.2y.net/~nacka/phpinfo.php)
> Apache/1.3.22 (Unix)
> 
> 
> Please CC me since Im not a member of this maillinglist.
> 
> 
The javascript showing up in the left frame is not showing the same as your link to it.

 The page showing up in the frame

is broken. The javascript tags are closed before the script
<script language="JavaScript"></script>

Gary



--- End Message ---
--- Begin Message ---
Also, for adding items onto an array use array_push()

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 22, 2002, at 07:41  PM, Jim Winstead wrote:

> Jtjohnston <[EMAIL PROTECTED]> wrote:
>> Where/How do I start in building a new array? ".=" doesn't work:
>>
>> $authors .= explode(";", $mydata->KW);
>
> '.=' doesn't work because that does a string append.
>
> you just want:
>
>   $authors = explode(";", $mydata->KW);
>
> then you can sort the array using sort(). http://php.net/sort
>
> jim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Yeah but, this doesn't work either? I'm trying :)

 $news = mysql_query("select AS from $table");

 while ($mydata = mysql_fetch_object($news))
 {
# $authors = explode(";", $mydata->AS);
 array_push ($authors, explode(";", $mydata->AS));
 }

 foreach($authors as $author)
 {
 echo "$author<br>\n";
 }


--- End Message ---
--- Begin Message ---
OK. I use:

 while ($mydata = mysql_fetch_object($news))
 {
 $authors = explode(";", $mydata->AS);
 }

Then why "Invalid argument supplied for foreach()"
Am I indeed building an array as I go through my database?

 foreach($authors as $author)
 {
#echo sort($author)".<br>\n";
 echo "$author<br>\n";
 }

http://www.php.net/manual/en/control-structures.foreach.php
foreach ($arr as $value) {
echo "Value: $value<br>\n";
}

I have the right syntax? Did I build the array?
Newbie, but have to learn it somehow :)

----------------snip---------------------
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

 $news = mysql_query("select AS from $table");

 while ($mydata = mysql_fetch_object($news))
 {
 $authors = explode(";", $mydata->AS);
 }

 foreach($authors as $author)
 {
 echo "$author<br>\n";
 }


--- End Message ---
--- Begin Message ---
What's the difference between
if (isset($submit_happening))
and
if $submit_happening)

John

[EMAIL PROTECTED] wrote:

> On Fri, 22 Feb 2002 21:38:16 -0500, you wrote:
>
> >I'd to know how difficult it is to achieve the following:
> >
> >Create login page, when the submit button is clicked, the user info is checked 
>against a database as
> >to whether is login info is valid. if it is valid, a page is displayed that lists 
>all of the classes
> >that the user has registered for, meaning each user will see a different list of 
>classes.
>
> At first, I thought this was a homework question, but that seems
> unlikely. Ok, one way to do this is to have a form submit to itself.
>
> Briefly :
>
> <?
> if (isset($submit_happening)) {
>         if ($username == "david" && $password="xyzzy") {
>                 echo("Successfully logged in");
>         } else {
>                 echo("Not logged in");
>         }
> } else {
> ?>
> <form method="post" action="<?=$PHP_SELF?>">
> <input type="hidden" name="submit_happening" value="1">
> <input type="text" name="username">
> <input type="password name="password">
> </form>
> <?
> }
> ?>
>
> Untested. If you want to store a user's logon status permanently, look
> at sessions. http://www.php.net/manual/en/ref.session.php
>
> djo

--
John Taylor-Johnston
-----------------------------------------------------------------------------
  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   -     Université de Sherbrooke:
          http://compcanlit.ca/
          819-569-2064


--- End Message ---
--- Begin Message ---
Well, if $submit_happening is set to 0, "0" or false then

if($submit_happening) will evaluate to false while
if(isset($submit_happening)) will evaluate to true

As the documentation (please read http://www.php.net/isset) isset()
returns true if the variable exists and false if it doesn't.

-Rasmus

On Sat, 23 Feb 2002, jtjohnston wrote:

> What's the difference between
> if (isset($submit_happening))
> and
> if $submit_happening)
>
> John
>
> [EMAIL PROTECTED] wrote:
>
> > On Fri, 22 Feb 2002 21:38:16 -0500, you wrote:
> >
> > >I'd to know how difficult it is to achieve the following:
> > >
> > >Create login page, when the submit button is clicked, the user info is checked 
>against a database as
> > >to whether is login info is valid. if it is valid, a page is displayed that lists 
>all of the classes
> > >that the user has registered for, meaning each user will see a different list of 
>classes.
> >
> > At first, I thought this was a homework question, but that seems
> > unlikely. Ok, one way to do this is to have a form submit to itself.
> >
> > Briefly :
> >
> > <?
> > if (isset($submit_happening)) {
> >         if ($username == "david" && $password="xyzzy") {
> >                 echo("Successfully logged in");
> >         } else {
> >                 echo("Not logged in");
> >         }
> > } else {
> > ?>
> > <form method="post" action="<?=$PHP_SELF?>">
> > <input type="hidden" name="submit_happening" value="1">
> > <input type="text" name="username">
> > <input type="password name="password">
> > </form>
> > <?
> > }
> > ?>
> >
> > Untested. If you want to store a user's logon status permanently, look
> > at sessions. http://www.php.net/manual/en/ref.session.php
> >
> > djo
>
> --
> John Taylor-Johnston
> -----------------------------------------------------------------------------
>   ' ' '   Collège de Sherbrooke:
>  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
>    -     Université de Sherbrooke:
>           http://compcanlit.ca/
>           819-569-2064
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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


The php_gd.dll is in the extension folder, the error does not show in
Apache, it opens with php 4.1.1 running..... The error shows on the page in
the browser when the page is loaded? I restarted Apache after altering the
.ini file?

Mike

> You need to have that dll installed on your system.  You need to download
> php-version.zip file that contains all of the dlls in it to run with.
> 
> Ray Hunter
> Firmware Engineer
> 
> ENTERASYS NETWORKS
> 
> 
> -----Original Message-----
> From: Mike Brackenridge [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 22, 2002 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] imagecreate with Windows .exe installer
> 
> 
> php4 installed with Apache on Windows ME, using as localhost.
> 
> I am trying to use imagecreate with a version of php4 that was installed
> with the binary .exe installer, php seems to be installed OK.
> 
> I have changed the .ini file line:
> 
> ;extension=php_gd.dll
> 
> To
> 
> extension=php_gd.dll
> 
> But I get an error of:
> 
> Fatal error: call to undefined function: imagecreate() in c:directory

--- End Message ---
--- Begin Message ---
how do i do two things at the same time, i'm thinking of the equivalent of fork in perl


Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++

--- End Message ---
--- Begin Message ---
Vulcan Logic SRM
www.vl-srm.net

Every your task is a banana.

Regards,
Andrey Hristov

----- Original Message ----- 
From: "Paul Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 23, 2002 1:05 PM
Subject: [PHP] fork?


how do i do two things at the same time, i'm thinking of the equivalent of fork in perl


Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++


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



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

I'm very new to PHP, as a matter of fact, I never had any experience anything about 
web-enabled applications development. I've been more into local Visual Basic and MS 
SQL Serve devt.  If there's any kind soul out there, please HEEEEEEEELPPPPP!!!!

The question is: why do the values of my session variables disappear when i traverse 
through different php scripts? duhhhhhh  =(


Sincerely yours,
Alex



---------------------------------
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
--- End Message ---
--- Begin Message ---
Alexander P. Javier wrote:
> I'm very new to PHP, as a matter of fact, I never had any experience anything about 
>web-enabled applications development. I've been more into local Visual Basic and MS 
>SQL Serve devt.  If there's any kind soul out there, please HEEEEEEEELPPPPP!!!!
> 
> The question is: why do the values of my session variables disappear when i traverse 
>through different php scripts? duhhhhhh  =(
> 


Do you have cookies enabled?  By default the session variables rely on 
PHP sending a session cookie.  If your browser doesn't accept them, 
you'll end up with 'new' sessions on every page.

--- End Message ---
--- Begin Message ---
every script you use the variable should contain a "session_start()"
statement...

----- Original Message -----
From: "Michael Kimsal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 23, 2002 5:26 PM
Subject: [PHP] Re: Newbie on Sessions/Pages Management


> Alexander P. Javier wrote:
> > I'm very new to PHP, as a matter of fact, I never had any experience
anything about web-enabled applications development. I've been more into
local Visual Basic and MS SQL Serve devt.  If there's any kind soul out
there, please HEEEEEEEELPPPPP!!!!
> >
> > The question is: why do the values of my session variables disappear
when i traverse through different php scripts? duhhhhhh  =(
> >
>
>
> Do you have cookies enabled?  By default the session variables rely on
> PHP sending a session cookie.  If your browser doesn't accept them,
> you'll end up with 'new' sessions on every page.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
For one of my php applications I want to check user's UNIX[Linux] account. If his / 
her username password pair matches with that of /etc/passwd or samba or NIS then only 
the user will be allowed to access the contents. How to achieve this ?
TIA
Shekhar

___________________________________
V I I T,  http://www.viitindia.org



--- End Message ---
--- Begin Message ---
hi,
I'm working on content management system entirely written in Object 
oriented PHP using templates

i used output buffering to be able to send header calls in the middle of my 
classes

i have noticed that performance has become "random" meaning that the same 
script could take from 1 up to 30 seconds in the same conditions, passing 
exactly the same params.

while trying to find a solution, i removed the ob_end_flush() call while 
keeping the ob_start() call at the beginning of the script
and strangely speed of execution came back to normal.

output buffering is still on

i am not flushing it out

the pages are generated just fine without freeing the buffer ??!!!!

i would like to know if anyone has had similar experiences with output 
buffering
this behavior occurred on a windows and a linux box both with php 4.1.1 and 
pretty much the same php.ini settings

Regards


__________________________________

hassan el forkani
http://WarmAfrica.com EveryOne's Africa
__________________________________

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

just wondering, why the mysql_db_query is being abandoned and called 
"deprecated" ?

With the current implementation of the mysql_connect I have a problem 
with using 2 databases with the same username/password.
PHP will use the same connection and so only use one of the two 
databases :-(.

Is there any other way than always calling mysql_select_db before making
a query?
I was used using an abstraction layer with a class for each connection
which used also mysql_db_query for the query so that I could use each
class on a different database (but with the same connection parameters).

Is there a speed penalty in using the combination of 
mysql_select_db();mysql_query ... compared against mysql_db_query?


Thanks a lot for already reading this ;-)

Thomas

--- End Message ---
--- Begin Message ---
You can add the database to your query.  Such as:

SELECT * FROM database.table WHERE stuff=other_stuff;

I am not sure what other databases support this notation but I know that
MySQL does.

Eric



On Sat, 23 Feb 2002, Thomas Seifert wrote:

> Hi folks,
>
> just wondering, why the mysql_db_query is being abandoned and called
> "deprecated" ?
>
> With the current implementation of the mysql_connect I have a problem
> with using 2 databases with the same username/password.
> PHP will use the same connection and so only use one of the two
> databases :-(.
>
> Is there any other way than always calling mysql_select_db before making
> a query?
> I was used using an abstraction layer with a class for each connection
> which used also mysql_db_query for the query so that I could use each
> class on a different database (but with the same connection parameters).
>
> Is there a speed penalty in using the combination of
> mysql_select_db();mysql_query ... compared against mysql_db_query?
>
>
> Thanks a lot for already reading this ;-)
>
> Thomas
>
>
>

-- 
Eric Thelin                                          [EMAIL PROTECTED]
           AZtechBiz.com: Where Arizona Does Tech Business

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

I would like to upload files using a form.

Unfortunatelly it takes a while till the file is uploaded to the server.
During this time the same page with the submit button is viewed. If the user
clicks another time on the submit button, I get wrong records and sometimes
the same file twice.

Is there a way to redirect imediatelly to a waiting page? I tryed to
redirect, but somehow the server is first uploading the file before
something else happens.

Thanx for any help

Andy


--- End Message ---

Reply via email to