php-general Digest 27 Apr 2001 10:34:07 -0000 Issue 652

Topics (messages 50523 through 50590):

Sizeof a multi-dimensional array??
        50523 by: Chris Anderson
        50556 by: Maxim Maletsky

Re: Ultradev PHP Server Model
        50524 by: John Platte
        50532 by: Andrew Hill
        50535 by: John Monfort

Re: cell iterations in loop
        50525 by: Jerry Lake

What's wrong with Apache + php + mysql on Windows?
        50526 by: Mig
        50557 by: Steve Maroney
        50583 by: nik
        50585 by: Nicolas Guilhot

(SOLVED)Re: [PHP] setting the name of the file in Save As windows
        50527 by: Black Dragon

How to Crypt entire MySQL DataBase
        50528 by: Augusto Cesar Castoldi

Re: (another) cms, but internationalized
        50529 by: Michael Kimsal

scripts execute as user nobody
        50530 by: Mr. Adam ALLEN.

sending content-type header after session_start()
        50531 by: matt.wong.tumbleweed.com
        50579 by: Yasuo Ohgaki

Re: Ultradev PHP Server Model--found!
        50533 by: John Monfort

Re: how to get var value
        50534 by: Jacky.lilst

line break
        50536 by: Gary
        50537 by: Alex Piaz
        50538 by: Joao Prado Maia
        50539 by: Alex Piaz

What is this??
        50540 by: Manesh
        50541 by: Jack Dempsey
        50542 by: Manesh
        50546 by: Andrew Hill
        50547 by: Philip Olson

PHP+MS Access and/or MS SQL
        50543 by: kelvin.eXtropia.com

error reporting/handling
        50544 by: Jack Dempsey

what is wrong with this login script?
        50545 by: Jacky.lilst

Re: math calculations query
        50548 by: Maxim Maletsky
        50562 by: Steve Werby

Re: mcrypt module for Win32
        50549 by: Maxim Maletsky
        50574 by: Carsten Gehling

Re: alter table name with php and mysql
        50550 by: Maxim Maletsky

Re: in_array() function not supported on my server... anyth ing else?
        50551 by: Maxim Maletsky

mkstemp()
        50552 by: Randy Johnson

printable output of array
        50553 by: Mike Tuller

Re: check if an url is valid
        50554 by: Maxim Maletsky
        50575 by: Black Dragon
        50586 by: yanto
        50588 by: Manisha

Re: Array & Javascript?
        50555 by: Maxim Maletsky

*.php and the search engienes on the web
        50558 by: SED
        50559 by: Philip Olson
        50561 by: Steve Werby

php4 on RedHat 7.1
        50560 by: j2n tech
        50568 by: Ralph Guzman

php dieing/apache or something!
        50563 by: Eric Peters

Submiting two forms at the same time
        50564 by: Reuben D Budiardja

A newbie search site question
        50565 by: waro
        50567 by: David Robley

Please send me som Semaphore and Shared Memory  example...
        50566 by: ±èº´°Ç

How can this be done?
        50569 by: Subodh Gupta
        50570 by: Jack Dempsey

parse error is always on line 1 == error ?
        50571 by: Jimmy Lantz
        50577 by: Frank Joerdens

Re: [PHP-DB] How can this be done?
        50572 by: Beau Lebens

Re: Problem with the HTTP_REFERER
        50573 by: Rosen
        50590 by: Simon Ould

Re: how do I calculate this?
        50576 by: Jacky.lilst
        50589 by: bill

How to execute a php scripts
        50578 by: Bertrand TACHAGO
        50584 by: Henning Kilset Pedersen

loops with array_walk or foreach using array??? of variable pairs
        50580 by: Helmut Ott

bug with sessions and output-compression?????
        50581 by: Sebastian Stadtlich

Extracting the body of the http request entity?
        50582 by: nik

help me pls
        50587 by: Yamin Prabudy

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]


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


Alright, count($x) would give me the number of array elements in $x. But how can I get 
the count of a multi-dimensional array? Count($x[0]) doesn't seem to work. Thanks in 
advance

Chris Anderson   aka "Null"    
--------------------------------------------
PHP Developer / Nulltech
PHP-GTK Tester / gtk.php.net
STA Administrator / www.stronger.org
DOD Co-Owner / www.dayofdefeat.com





it should.

if(is_array($x[0]))
        $count = count($x[0]);
else
        $count = 'not an array....';

Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Chris Anderson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 9:31 AM
To: PHP
Subject: [PHP] Sizeof a multi-dimensional array??


Alright, count($x) would give me the number of array elements in $x. But how
can I get the count of a multi-dimensional array? Count($x[0]) doesn't seem
to work. Thanks in advance

Chris Anderson   aka "Null"    
--------------------------------------------
PHP Developer / Nulltech
PHP-GTK Tester / gtk.php.net
STA Administrator / www.stronger.org
DOD Co-Owner / www.dayofdefeat.com





John Monfort wrote:

> I was wondering, is anyone aware of a PHP server model, for Ultradev?
> 
> Or, any leads on how I can create one?
> 
> I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
> of the Ultradev server model features (and convenience), but
> they only support ASP/JSP/JScript.

I'm not aware of one -- I wish I were!

The book "Extending Dreamweaver 4" from Macromedia documents their API's,
including server models. I've got the book...it's pretty hefty. I *think*
it's fairly complete, though I can't immediately determine if it has all
the info necessary to create a new server model.

I sincerely hope someone does this! I would give it a shot if I weren't so
green...

John Platte

"Truth binds the mind to what satisfies it,
but worldly thinking does not satisfy
and therefore ignites curiosity."

               -- St. Theophan the Recluse




Check out www.interakt.ro
It's beta... but functional.

Best regards,
Andrew


On Thursday, April 26, 2001, at 06:46 PM, John Platte wrote:

> John Monfort wrote:
>
>> I was wondering, is anyone aware of a PHP server model, for Ultradev?
>>
>> Or, any leads on how I can create one?
>>
>> I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
>> of the Ultradev server model features (and convenience), but
>> they only support ASP/JSP/JScript.
>
> I'm not aware of one -- I wish I were!
>
> The book "Extending Dreamweaver 4" from Macromedia documents their 
> API's,
> including server models. I've got the book...it's pretty hefty. I 
> *think*
> it's fairly complete, though I can't immediately determine if it has all
> the info necessary to create a new server model.
>
> I sincerely hope someone does this! I would give it a shot if I weren't 
> so
> green...
>
> John Platte
>
> "Truth binds the mind to what satisfies it,
> but worldly thinking does not satisfy
> and therefore ignites curiosity."
>
>                -- St. Theophan the Recluse
>
> --
> 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]
>
>






 Thanks Andrew, but I found it. It's working pretty well, so far.

 Thanks for the help.

__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Thu, 26 Apr 2001, Andrew Hill wrote:

> Check out www.interakt.ro
> It's beta... but functional.
>
> Best regards,
> Andrew
>
>
> On Thursday, April 26, 2001, at 06:46 PM, John Platte wrote:
>
> > John Monfort wrote:
> >
> >> I was wondering, is anyone aware of a PHP server model, for Ultradev?
> >>
> >> Or, any leads on how I can create one?
> >>
> >> I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
> >> of the Ultradev server model features (and convenience), but
> >> they only support ASP/JSP/JScript.
> >
> > I'm not aware of one -- I wish I were!
> >
> > The book "Extending Dreamweaver 4" from Macromedia documents their
> > API's,
> > including server models. I've got the book...it's pretty hefty. I
> > *think*
> > it's fairly complete, though I can't immediately determine if it has all
> > the info necessary to create a new server model.
> >
> > I sincerely hope someone does this! I would give it a shot if I weren't
> > so
> > green...
> >
> > John Platte
> >
> > "Truth binds the mind to what satisfies it,
> > but worldly thinking does not satisfy
> > and therefore ignites curiosity."
> >
> >                -- St. Theophan the Recluse
> >
> > --
> > 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]
> >
> >
>





Ok, after a few hours of messing here and there
I've got it to work. you can adjust for any number
of columns, and the pictures and it makes solid
tables.

Thanks, for all of the help

<snip>
<table width="450" border="1" align="center">
<?php
//set this number to the columns you would like
$columns = 7;
$pictures = 25;//could be from a database query
echo "<tr>\n";
for ($x=1; $x<=$pictures; $x++)
        {
                echo "<td>".$x."</td>\n";
                if ($x % $columns == 0)
                {
                        $loopcount++;
                        if ($loopcount < $x )
                                {
                                        echo "</tr>\n";
                                }
                        else
                                {
                                        echo "</tr>\n<tr>";
                                }
                }
        }
$test = (($loopcount + 1) * $columns);
$td = (($loopcount + 1) * $columns) - ($x -1);
if($td != $columns)
{
for ($x=0; $x<$td; $x++)
        {
                echo "<td><b>EMPTY</b></td>\n";
        }
}
#also added in
if($x % $columns != 0)
{
        #then we know that it did not end completely, so echo you're final </tr>
        echo "</tr>\n";
}
?>
</table>
</snip>

Jerry Lake            - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online     - http://www.pacifier.com


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 2:26 PM
To: Jerry Lake
Cc: [EMAIL PROTECTED]
Subject: Re: RE: RE: [PHP] cell iterations in loop


ahhhhh, i got it...
ok, try this:
$length is arbitrary...
$x is your counter...
do the loop as before, but each time through the loop, $loopcount++;
So, if you do the loop 5 times, $loopcount == 5.
Then, at the end, $length - ($loopcount*$x) gives you the amount of <td>
</td>'s to
echo. Put another for loop with these parameters after you've printed your
normal
td's...you could do this all in one for loop, and would just need some more
if statements...
i think this is what you need...let me know how it goes...

-jack
----- Original Message -----
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 5:20 pm
Subject: RE: RE: [PHP] cell iterations in loop

> Right, I understand that
> if I use <td></td> it is blank space
> if I use <td> </td> it is an empty cell
>
> right now $length is set at 42 (this is arbitrary)
> and there needs to be two empty cells at the end of
> the last row. if length is 41 I will need 3 and 40
> will need 4. but if I don't know what the value of
> $length is going to be on a dynamic page such as
> showing "x" amount of images from a folder. I need
> for the loop to know how many "<td> </td>" to
> echo out at the end depending on the $length;
>
> I apologize if I am not explaining this very well.
> I usually am quite concise.
>
> Jerry Lake            - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online            - http://www.pacifier.com
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:00 PM
> To: Jerry Lake
> Cc: [EMAIL PROTECTED]
> Subject: Re: RE: [PHP] cell iterations in loop
>
>
> ok, again, trying to understand "blank space"...but, try this:
> if you print out <td></td> you'll get something i think you're
> referring to
> as blank space...
> try using a nonbreaking space in there...either   or a space in the
> code; this will force
> the "emptiness" to show up...
>
> -jack
>
> ----- Original Message -----
> From: "Jerry Lake" <[EMAIL PROTECTED]>
> Date: Thursday, April 26, 2001 4:54 pm
> Subject: RE: [PHP] cell iterations in loop
>
> > Thanks, that worked with the removal
> > of the first if clause for part 2 of
> > my question, as far as part one, I will
> > try to explain better. if you view the
> > chunk of code in a browser you will get
> > a table with borders number 1-43 however
> > there will be a blank space at the end
> > where 44 & 45 would be. how can I make
> > the loop echo enough "<td> </td>" lines
> > to show empty cells instead of blank space
> > regardless of the number of cells I am
> > creating ?
> >
> > Jerry Lake            - [EMAIL PROTECTED]
> > Interface Engineering Technician
> > Europa Communications - http://www.europa.com
> > Pacifier Online            - http://www.pacifier.com
> >
> >
> > -----Original Message-----
> > From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 1:18 PM
> > To: [EMAIL PROTECTED]; Jerry Lake
> > Subject: RE: [PHP] cell iterations in loop
> >
> >
> > I'm a little unclear as to what you're trying to do, but here's my
> > interpretation:
> >
> > problem 2: if it ends on a complete row...
> > solution: put the echoing of the first and last tr's inside your
> > conditional. When $x is initialized to 0, the if will return true,
> > and you
> > will output the very first tr...same at the end...so i'd have
> > something like
> > this:
> >
> > <table width="450" border="1" align="center">
> > <!-- we delete this first <tr> //-->
> > <?
> > $x = 0;
> > #different here for later reason
> > $length = 42;
> > while ($x <= $length)
> >        {
> >                $x++;
> >                if ($x % 5 == 0)
> >                        {
> >                                echo "<tr>\n";
> >                        }
> >                echo "<td>".$x."</td>\n";
> >                if ($x % 5 == 0)
> >                {
> >                        echo "</tr>\n";
> >                }
> >
> >        }
> >
> > #also added in
> > if($length % 5 != 0){
> > {
> >        #then we know that it did not end completely, so echo
> > you're final </tr>
> >        echo "</TR>\n";
> > }
> > #no need for an else block because it would do nothing
> > ?>
> > <!-- as well as this one </tr> //-->
> > </table>
> >
> > Now if it ends on a complete row, you're fine!
> >
> > problem 1: what about if it ends at 42 or something, with just a
> > closing</td>?
> > solution: make a final check to see if you need that closing </tr>
> > That is the if statement after you're loop...
> >
> > I hope this helps.
> >
> > -jack
> >
> >
> >
> > -----Original Message-----
> > From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 2:32 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] cell iterations in loop
> >
> >
> > I've got some code that I am
> > creating that creates a table with
> > a loop. and it works fine for what
> > it is, but my question is how do I
> > compensate for rows that aren't divisible
> > by 5 ? i.e. the empty cells at the table.
> > additionally if it ends on a complete row
> > (divisible by 5) I end up with an additional
> > empty row at the end of the table, I can
> > see why it does, I'm just trying to get around
> > it. no big hurry on this, I'm just trying to
> > learn more.
> >
> > <snip>
> > <table width="450" border="1" align="center">
> >        <tr>
> > <?
> > $x = 0;
> > while ($x <= 42)
> >        {
> >                $x++;
> >                if ($x % 5 == 0)
> >                        {
> >                                echo "<td>".$x."</td>\n";
> >                                echo "</tr>\n<tr>\n";
> >                        }
> >                else
> >                        {
> >                                echo "<td>".$x."</td>\n";
> >                        }
> >        }
> > ?>
> >        </tr>
> > </table>
> > </snip>
> >
> > Jerry Lake            - [EMAIL PROTECTED]
> > Interface Engineering Technician
> > Europa Communications - http://www.europa.com
> > Pacifier Online            - http://www.pacifier.com
> >
> >
> > --
> > 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: php-list-
> > [EMAIL PROTECTED]
> >
> >
> >
> > --
> > 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: php-list-
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> 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: php-list-
> [EMAIL PROTECTED]
>
>
> --
> 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: php-list-
> [EMAIL PROTECTED]
>







Hello, I can't understand the reason apache server running locally on my
Win98 machine delays so much to respond browser when accesing php
scripts in the form

http://localhost/myscript.php

When I transfer php scripts to host server via FTP, script execution is
immediate, even remote server being in another continent.

I was running apache + php + mysql on Win95 and delay was terrible. Now
I moved to Win98 and delay became still worse.

I know some parameter in httpd.conf or php.ini should be changed, but
how to kwow which parameter?.

Thanks for any idea.

Mig








I think the question should be what's wrong with
Windows?  :)

Sorry, I can't give you more of an intelligent answer


Steve


On Thu, 26 Apr 2001, Mig wrote:

> Hello, I can't understand the reason apache server running locally on my
> Win98 machine delays so much to respond browser when accesing php
> scripts in the form
>
> http://localhost/myscript.php
>
> When I transfer php scripts to host server via FTP, script execution is
> immediate, even remote server being in another continent.
>
> I was running apache + php + mysql on Win95 and delay was terrible. Now
> I moved to Win98 and delay became still worse.
>
> I know some parameter in httpd.conf or php.ini should be changed, but
> how to kwow which parameter?.
>
> Thanks for any idea.
>
> Mig
>
>
>
> --
> 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]
>
>





> Hello, I can't understand the reason apache server running locally on my
> Win98 machine delays so much to respond browser when accesing php
> scripts in the form
>
> http://localhost/myscript.php
>
> When I transfer php scripts to host server via FTP, script execution is
> immediate, even remote server being in another continent.
>
> I was running apache + php + mysql on Win95 and delay was terrible. Now
> I moved to Win98 and delay became still worse.
>
> I know some parameter in httpd.conf or php.ini should be changed, but
> how to kwow which parameter?.

You could  try tweaking the filesystem optimisiation in Control Panel >
System > Performance.  If your system is optimised for desktop use, it'll
make an even more lousy server than Win9x usually does. :-)

nik





You can try to had HostnameLookups off in your httpd.conf if it is not
already present.
More info at http://www.apache.org/DELETE_ME/mod/core.html#hostnamelookups

---------------
> Hello, I can't understand the reason apache server running locally on my
> Win98 machine delays so much to respond browser when accesing php
> scripts in the form
>
> http://localhost/myscript.php
>
> When I transfer php scripts to host server via FTP, script execution is
> immediate, even remote server being in another continent.
>
> I was running apache + php + mysql on Win95 and delay was terrible. Now
> I moved to Win98 and delay became still worse.
>
> I know some parameter in httpd.conf or php.ini should be changed, but
> how to kwow which parameter?.
--------------






> I've tried unsuccesfully to print this header after the first header:
>
> header ("Content-Disposition: attachment; filename=\"WorkPlease.zip\"");
>

It works using:

  header("Content-Disposition: filename=\"WorkPlease.zip\"");

I think my browser is a bit mad :)
the rrf http://www.w3.org/Protocols/rfc2616/rfc2616  says that it must be
used the first one (with attachement)  :(









I want to crypt all my database.

I have in my scripts, a lot of mysql_querys, where I put and get data from
the database.

How can I insert crypt data in the database and then get the crypted data
from database and decrypt?

But I'd like to do some functions to do that. Because in case that I
change
the tables name I need to change the code just in "one" place.

Something like:

function Select ($columm, $tables, $where, $order) {

  $sql="SELECT $columm FROM $tables WHERE $where ORDER BY $order";
  $result=mysql_query($sql) or die ("Error 1.");

  // now the crypt stuffs...

}

thanks for any help and/or idea,

Augusto Cesar Castoldi
Florianópolis - SC - Brazil





We've worked on similar, but somewhat less ambitious projects,
and I will caution you on the 'easy' part of this.  It will never be
easy.  Doesn't matter who your target audience is - you're biting off
a huge project, and there will always be some people who find
what you're doing too difficult or too complex for the 'small' things
they want to do.  You'll need to figure out what level of ease you want
to accomodate, but be careful about how 'easy' you label it, because it
may end up frustrating more people than it helps.


Best of luck in your endeavour.  :)

Peter Van Dijck wrote:

> Hi,
> I'm working on another content management system, coz I can't find what I
> need out there.
> Some features:
> - multiple languages for everything
> - multiple templates (so you can have a english-simple template version or
> a french-old style template version of the same page, all cached)
> - easy to deploy sites with
> - easy to hack
> - focussed on content sites
> - (simple so far) workflows
> - multiple content types
> - articles are versioned and can have multiple languages
> - completely templated and sub-page level caching
> - other content types: weblog, discussion
> - RSS feeds
> - mailing list manager (using ezmlm now)
> - user login and stuff
> - "edit this page" style ease of updating
> - group based security
> - directory manager, for metadata and directories
> - ...
>
> It is in the early stages, I've written quite a bit of code but it needs a
> few more weeks of hard work to get usable, and then months of more
> development probably to get all the cool goodies going :)
>
> So: is there anyone interested in working on this. I'm not sure if I can
> get it to a 1.0 release on my own (even not incorporating all the above
> functionality), but with some help we could make it! And it would be rather
> unique, not another slashdot copy, or extremely advanced cms that you have
> to reconfigure your server for, and not a half baked guest book either (it
> seems most fall in one of these categories)
>
> Please get in touch with me if you're interested.
> The main important feature of it all is the international capability and
> the templating and caching and lots of content types and user management.
>
> Peter
>





I have a problem with my PHP scripts on my web-hot, all my php scripts are
running as the user nobody (group nobody).

Whenever I login via ftp/telnet I am logged in as the user asduk (group
asdukgrp).

The problem I have is that I cannot delete my files because the permissions
on the directory is set to 775. I cannot change to the user nobody  my host
will not allow that.

If I change the permissions on the directories to 777 then I can delete the
files, but have read that this is dangerous.

If anyone has suggestions on how to get round this problem I'd appreciate
them (or let me know if a user browsing a php site in directories with
permission 777 can exploit this).

I am using PHP 3.0.14 (when using PHP4.05 RC1 on a different host I don't
get this problem - but need this working with PHP 3.0.14)

Thanks for any help

Mr. Adam ALLEN.
[EMAIL PROTECTED]
http://www.dynamicinteraction.co.uk






Hello,

please correct me if I'm wrong, but it seems that in PHP 4, after calling
session_start(), you are stuck with serving an HTML page.

What if you want to call session_start(), but you want to send headers
after the session has started? for example, I'd like to deliver a 
downloadable file, but before I deliver that file, I'd like to check the 
user's session and make sure that the user is logged in and that the user 
has proper authorization to access the file.

I've got a workaround for this problem (see below). However, I would prefer
to handle the problem with the built-in session handling functions. Does
anyone know if this can be done?
Thanks
-Matt
<?php
/****
this page serves a request to download a file. The file should
not be served unless the user has authorization to view this file. To
check that authorization, the user must be logged in
****/
function my_session_start() {
// decode session data, if any
if($GLOBALS["PHPSESSID"]) {
$fname = "/tmp/sess_".$GLOBALS["PHPSESSID"]; // file path hardcoded
for this example
$fcontents = @file($fname);
if($fcontents) {
$fcontents = implode("", $fcontents);
include("User.phpc"); // defines the User object stored in the session
session_decode ($fcontents);
}
}
}
/**** start processing the page
get session data, and still allow content type headers to be sent.
why doesn't the built-in session_start() allow this?
****/
my_session_start();
$s_user = &$HTTP_SESSION_VARS["s_user"];
if(!$s_user) {
$err = "user not logged in";
} else {
// pseudo code from here on
if(!$s_user->has_authorization_to_download_requested_file()) {
$err = "user not logged in, or has no authorization to download this
file";
} else {
header("content-type: ".requested_file_mime_type());
output_requested_file_data();
}
}
}
if($err) echo "Error: $err";
?>






Use ob_start() at the top of script. (Before calling session_start()) It will do
what you want.
You may want to flush output buffer. Refer to output buffering functions for
details.

Regards,
--
Yasuo Ohgaki


<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> please correct me if I'm wrong, but it seems that in PHP 4, after calling
> session_start(), you are stuck with serving an HTML page.
>
> What if you want to call session_start(), but you want to send headers
> after the session has started? for example, I'd like to deliver a
> downloadable file, but before I deliver that file, I'd like to check the
> user's session and make sure that the user is logged in and that the user
> has proper authorization to access the file.
>
> I've got a workaround for this problem (see below). However, I would prefer
> to handle the problem with the built-in session handling functions. Does
> anyone know if this can be done?
> Thanks
> -Matt
> <?php
> /****
> this page serves a request to download a file. The file should
> not be served unless the user has authorization to view this file. To
> check that authorization, the user must be logged in
> ****/
> function my_session_start() {
> // decode session data, if any
> if($GLOBALS["PHPSESSID"]) {
> $fname = "/tmp/sess_".$GLOBALS["PHPSESSID"]; // file path hardcoded
> for this example
> $fcontents = @file($fname);
> if($fcontents) {
> $fcontents = implode("", $fcontents);
> include("User.phpc"); // defines the User object stored in the session
> session_decode ($fcontents);
> }
> }
> }
> /**** start processing the page
> get session data, and still allow content type headers to be sent.
> why doesn't the built-in session_start() allow this?
> ****/
> my_session_start();
> $s_user = &$HTTP_SESSION_VARS["s_user"];
> if(!$s_user) {
> $err = "user not logged in";
> } else {
> // pseudo code from here on
> if(!$s_user->has_authorization_to_download_requested_file()) {
> $err = "user not logged in, or has no authorization to download this
> file";
> } else {
> header("content-type: ".requested_file_mime_type());
> output_requested_file_data();
> }
> }
> }
> if($err) echo "Error: $err";
> ?>
>
>
>
> --
> 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]
>






 Since I posted the questions, I thought I'll post the solutions.

 For those interested, UDzone.com has a PHP Server Model for Macromedia
 Ultradev. It's a beta copy, but it seems to work pretty well for
 PHP-MySQL.

 You can find it at:
  http://www.udzone.com/showDetail.asp?TypeId=3&NewsId=505


 enjoy!



__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Thu, 26 Apr 2001, John Platte wrote:

> John Monfort wrote:
>
> > I was wondering, is anyone aware of a PHP server model, for Ultradev?
> >
> > Or, any leads on how I can create one?
> >
> > I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
> > of the Ultradev server model features (and convenience), but
> > they only support ASP/JSP/JScript.
>
> I'm not aware of one -- I wish I were!
>
> The book "Extending Dreamweaver 4" from Macromedia documents their API's,
> including server models. I've got the book...it's pretty hefty. I *think*
> it's fairly complete, though I can't immediately determine if it has all
> the info necessary to create a new server model.
>
> I sincerely hope someone does this! I would give it a shot if I weren't so
> green...
>
> John Platte
>
> "Truth binds the mind to what satisfies it,
> but worldly thinking does not satisfy
> and therefore ignites curiosity."
>
>                -- St. Theophan the Recluse
>





why don't you assign in next page like this?
$newvar = $test;
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
----- Original Message -----
From: AJDIN BRANDIC <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 26, 2001 5:53 AM
Subject: [PHP] how to get var value


> Hi,
>
> (this is just an example)
> I have on one page
>
> $test=1;
> $var1='test';
>
> on another page I want to be able to construct variable from the value in
> $var1 (test in this case)  and print its value.   So,
>
> $newvar=$;
> $newvar.=echo"$var1";
>
> now $newvar contains string '$test' but not the value of $test (1 in this
> case).
>
> There has to be way aroud this but I am just cannot find it :(.
>
> Regards
>
> Ajdin
>
> --
> 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]
>
>





Hi all,
I know how to get a line break in text. Is there a way to get a line 
break between the user agent string below? I would line to print in a 
column instead of a long row.

<?php
$newfile = fopen("log_test.txt", "a+");
fwrite($newfile, getenv("HTTP_USER_AGENT"));
fclose($newfile);
?>

TIA
Gary





At 22:07 26/4/2001 -0400, you wrote:
>Hi all,
>I know how to get a line break in text. Is there a way to get a line break 
>between the user agent string below? I would line to print in a column 
>instead of a long row.

Use \n\r concatening with your actual string

See below:

><?php
>$newfile = fopen("log_test.txt", "a+");
>fwrite($newfile, getenv("HTTP_USER_AGENT")."\n\r");
>fclose($newfile);
>?>


It will work.

Regards

Alex






On Thu, 26 Apr 2001, Alex Piaz wrote:

> At 22:07 26/4/2001 -0400, you wrote:
> >Hi all,
> >I know how to get a line break in text. Is there a way to get a line break
> >between the user agent string below? I would line to print in a column
> >instead of a long row.
>
> Use \n\r concatening with your actual string
>
> See below:
>
> ><?php
> >$newfile = fopen("log_test.txt", "a+");
> >fwrite($newfile, getenv("HTTP_USER_AGENT")."\n\r");
> >fclose($newfile);
> >?>
>
>
> It will work.
>

Actually the correct sequence is \r\n on Windows platforms. Just a small
note.

Joao

--
João Prado Maia <[EMAIL PROTECTED]>
http://phpbrasil.com - php com um jeitinho brasileiro





At 22:23 26/4/2001 -0400, Joao Prado Maia wrote:
>Actually the correct sequence is \r\n on Windows platforms. Just a small
>note.

Yeah! You're right. I made a typo here:-)

Nice to know I'm not alone. See you at php-pt;-)

[]'s

Alex





Warning: Undefined variable


How do i get rid of this???




Manesh wrote:
> 
> Warning: Undefined variable
> 
> How do i get rid of this???
> 
> --
> 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]

if you're sure that its because you didn't initialize first before
using, then look in your php.ini file...there are options there where
you can error strictness...




where is that?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
Dempsey
Sent: Thursday, April 26, 2001 10:38 PM
To: Manesh
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] What is this??


Manesh wrote:
> 
> Warning: Undefined variable
> 
> How do i get rid of this???
> 
> --
> 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]

if you're sure that its because you didn't initialize first before
using, then look in your php.ini file...there are options there where
you can error strictness...




You want to find the Error :


Modify the error reporting section of you php.ini.
You may combine different error settings with the symbols "~" 
(not) , "|" (or), and "&". to control the final error reporting level.

As an example, the default setting  "E_ALL & ~E_NOTICE" means "report 
all errors, except notices".
All the options you can use are listed here: 
http://www.php.net/manual/en/html/features.error-handling.html

Best regards,
Andrew
--------------------------------------------
Andrew Hill - OpenLink Software
Directory of Technology Evangelism
Internet Data Integration Technology
http://www.openlinksw.com


On Thursday, April 26, 2001, at 10:38 PM, Manesh wrote:

> where is that?
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
> Dempsey
> Sent: Thursday, April 26, 2001 10:38 PM
> To: Manesh
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] What is this??
>
>
> Manesh wrote:
>>
>> Warning: Undefined variable
>>
>> How do i get rid of this???
>>
>> --
>> 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: php-list-
>> [EMAIL PROTECTED]
>
> if you're sure that its because you didn't initialize first before
> using, then look in your php.ini file...there are options there where
> you can error strictness...
>
> --
> 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]
>
>





Have a look at this post :

  http://marc.theaimsgroup.com/?m=98571030029538

regards,
philip



On Thu, 26 Apr 2001, Manesh wrote:

> Warning: Undefined variable
> 
> 
> How do i get rid of this???
> 
> -- 
> 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]
> 





just point your browser to phpbuilder.net. Alternatively, just send me an email =)



Date: Wed, 25 Apr 2001 19:02:12 -0700 (PDT)
From: John Monfort <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: PHP+MS Access and/or MS SQL


 Hello everyone,

 I'm looking for information on PHP+ MS Access , and PHP+MS SQL.

 Any recommendations?

 Thx in advance!


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Thu, 26 Apr 2001, Ben Quinn wrote:

> Hi all,
>
> I am trying to copy an image from an external server and save it to my own.
> I have the following script to do this for a txt file and it works great!
>
> ?>
>
> $page  = "../temp/yep.txt";
>
> $date = date("http:/www.example.com/yep.txt");
>
> $cartFile = fopen("$page","a");
> fwrite($cartFile,$date,strlen($date));
> fclose($cartFile);
>
> ?>
>
> But i can't get it to work for image files - the images are saved and
> displayed on screen as a whole bunch of rubbish.
>
> I'd appreciate any help you can give me
>
>
>
> --
> 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]
>
>




k.e.l.v.i.n c.h.a.n
the open web technology company
www.eXtropia.com
[EMAIL PROTECTED]
Tel: 7738550 




manesh,

its in your php.ini file under error handling and logging...
seek and ye shall find...

-jack




Hi all
I tried to make a login function for my site using script below, but after I type user 
name and password, it asked me to type again and again and simply reject it, although 
I have made sure that the username and password I used to test is in the table for 
sure. No database connection probelm for sure as well.

if(!($PHP_AUTH_USER)):
 Header("WWW-authenticate: basic realm=Restricted Area");
 Header("HTTP/1.0 401 Unauthorized");
 echo "<meta http-equiv=\"refresh\" content=\"0;url=failed.
    php3\">";
 exit;
else:
 $connection  = mysql_connect("localhost", "username", "password")or die("connection 
fail");
if (!$connection) {echo "An error occurred in connection.\n";
exit;}

mysql_select_db("manageasy", $connection);
$user_id=$PHP_AUTH_USER;
$password=$PHP_AUTH_PW;
$result = mysql_query("SELECT hotel_id,username,password FROM hotels WHERE username = 
'$user_id' AND password='$password'", $connection);

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"






SELECT 
        SUM(quantity)*SUM(total) As mySUM
FROM
        table
WHERE
        ...


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 4:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] math calculations query


hi all,

i have a script which selects description, price and quantity from a mysql
table.

i have displayed the results on a page in the form of description, price,
quantity but I was wondering how best to go about calculating a total total,
ie. sum of quantitys multiplied by sum of prices.

Any ideas?

Many thanks,

Sean.





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




"Maxim Maletsky" <[EMAIL PROTECTED]> wrote:
> SELECT
> SUM(quantity)*SUM(total) As mySUM
> FROM
> table
> WHERE

Technically, this is correct based on what the original poster (below)
stated he wanted, but that's not really what he wanted since there's no real
world reason to calculate what he stated he wanted.  He must really want the
total monetary value of the items returned by the query.  That's calculated
by multiplying the quantity of each record by the price of each item and
summing that for each record.  So the correct SQL statement is:

SELECT SUM(price*quantity)
FROM table_name
WHERE ...

If he doesn't want to run the query above in addition to his existing query
to return individual records, he can calculate this total programatically.
Sean, in this case, as you're looping through the records do:

$amount_record = $price * $quantity;
$amount_total += $amount_record;

After the loop is complete, $amount_total will contain the value you want.
Alternately, the first line can be eliminated by calculating the amount for
each record within the query.

[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] wrote:
> i have a script which selects description, price and quantity from a mysql
> table.
>
> i have displayed the results on a page in the form of description, price,
> quantity but I was wondering how best to go about calculating a total
total,
> ie. sum of quantitys multiplied by sum of prices.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





I think PEAR has it.

have you tried to look at it?


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com







-----Original Message-----
From: Carsten Gehling [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 5:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mcrypt module for Win32


Where can I find a win32 version of the mcrypt module?

- Carsten



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




From: "Maxim Maletsky" <[EMAIL PROTECTED]>
Sent: Friday, April 27, 2001 5:00 AM


> I think PEAR has it.
>
> have you tried to look at it?

Found it, thanks!

It contains HCE_MD5, but AFAICT it does not utilize the other encryption
modes found in mcrypt. But it doesn't matter - I think this is fine for me.

I need it to create a serial-key with which a customer can unlock certain
modules in my scripts.

- Carsten








it just as same as doing a query:

$db->connect();
$db->query("ALTER TABLE table CHANGE field field ~ATTRIBUTES~");

well, that was with a DB abstraction layer.

just use what you usually use to query your Db having your ALTER TABLE in
the mysql_query. (no need to show the results up)


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Augusto Cesar Castoldi [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 6:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] alter table name with php and mysql


How can I alter a table name in mysql with php?

thanks,

Augusto cesar Castoldi


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




yeah.. the loop.

see php.net/arrays

most of the coolest array functions were introduced in PHP4

if you are trying to make a dynamic portable application you might want to
look into phpversion();

this will tell you which version it runs, and based on that will select the
best way to find the results on any server.


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


 

-----Original Message-----
From: Richard [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 6:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] in_array() function not supported on my server...
anything else?


Greetings..

This is how I currently check for instances of words and other:

 for ($i=0; $i < $total_lines; $i++){
        $line_array = explode("|",$line[$i]);


        $swhat=strtolower($txtLinkname);
        $xos =
array(strtolower($line_array[1]),strtolower($line_array[2]),strtolower($line
_array[3]),strtolower($line_array[4]),strtolower($line_array[5]));

        if (in_array($swhat,$xos,true)) {
            $found++;


Problem is, that the server where I have my files don't support in_array. It
is claimed that the servers PHP server is on version 4.0, how can this be
when in_array is a function that came first with PHP4  (according to my
documents) ??

Is there something else I could use?

Thanks
- Richard



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




I cannot find any documentation on mkstemp() .  Can somebody point me in the
right place?


thanks

randy





I had what I thought was a great idea in creating a downloadable phone
directory using PHP to connect to the LDAP server and gather the info for
output. I originally wanted to have it create a PDF document, and still
would, but I don't think that you can create multiple page documents with
PHP and PDFlib. Please correct me if I am wrong.

Does anyone know what might be the best way to accomplish this project? We
have 4200 employees total.

Thanks





no, sockets are not a bad solution at all. They are just as fast.

And plus fsockopen has more functionality such as timing out, result
messages, mess_num etc... what fopen doesn't have.

I think fsockopen is better for this job.


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Black Dragon [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 6:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP] check if an url is valid


Hi!

can you tell me how can I check if a remote files exists?

I've tried with fopen, but I've a warning on STDOUT if file doesn't exists.
I wouldn't redirect the STDERR to solve this problem.

I could use fsockopen, but I feel that this is a bad solution.

Can you tell me something that is easy?

I would a function that return true/false if an url is/not is valid; without
error to browser

Thanks




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




ok, I'll try with socket.

Thanks

> no, sockets are not a bad solution at all. They are just as fast.
>
> And plus fsockopen has more functionality such as timing out, result
> messages, mess_num etc... what fopen doesn't have.
>
> I think fsockopen is better for this job.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -----Original Message-----
> From: Black Dragon [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 27, 2001 6:41 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] check if an url is valid
>
>
> Hi!
>
> can you tell me how can I check if a remote files exists?
>
> I've tried with fopen, but I've a warning on STDOUT if file doesn't
exists.
> I wouldn't redirect the STDERR to solve this problem.
>
> I could use fsockopen, but I feel that this is a bad solution.
>
> Can you tell me something that is easy?
>
> I would a function that return true/false if an url is/not is valid;
without
> error to browser
>
> Thanks
>
>
>
>
> --
> 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]
>
> --
> 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]
>







there is no pure fopen function available to connect to other site. because
basically fopen use to open file (file open). fopen in php just try to
facilite programmer with human friendly name, but inside, when the argument
is url, it'll make standard socket connection like any other tcp/ip
connetion.


-toto-






Any body know how to un-subscribe temporarily. As I am going out station 
for 2 weeks. I want to stop all my PHP user group mails. (other wise there 
will be big junk) But later again I want to restart.

If I un-subscribe now whether I will be able to subscribe again ?


manisha





STRIPSLASHES();


use single quotes for the array.

add the slashes in front each JS's single quote,

when echoing use :

echo stripslashes($js);


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Marcus Ouimet [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 6:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Array & Javascript?


        I am trying to add a Javascript in array but it gives me an error
unless
certain characters are commented which makes sense, but then the Javascript
won't run. Any ideas here is what I am trying:

<?
    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text'  => '
<A HREF="test.html" onmouseover="document.images[0].src='test1'.jpg; return
true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');

of course the ' characters are a problem etc. so for an example I tried:

<?
    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text'  => '
<A HREF="test.html" onmouseover="document.images[0].src=\'test1\'.jpg;
return true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');

Any suggestions on how to get this to work?




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




Hi all,

If I make a whole website based on one PHP-navigation file with links like
"index.php?id=123", will all the search engines who crawl the websites be
able to follow it and index?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------





some do, not sure which do and don't these days though.  for related
information, check out this tutorial :

  Building Dynamic Pages With Search Engines in Mind :
  ----------------------------------------------------
  http://phpbuilder.com/columns/tim20000526.php3


regards,
philip


On Fri, 27 Apr 2001, SED wrote:

> Hi all,
> 
> If I make a whole website based on one PHP-navigation file with links like
> "index.php?id=123", will all the search engines who crawl the websites be
> able to follow it and index?
> 
> Regards,
> Sumarlidi Einar Dadason
> 
> SED - Graphic Design
> 
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
> 
> 
> -- 
> 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]
> 





"SED" <[EMAIL PROTECTED]> wrote:
> If I make a whole website based on one PHP-navigation file with links like
> "index.php?id=123", will all the search engines who crawl the websites be
> able to follow it and index?

A lot of them won't index pages with query strings (the part after the "?").
I posted a message in a similar thread earlier this month with more details
and some strategies to generate URLs that make search engines happy.  The
post is at the first URL below.

http://marc.theaimsgroup.com/?l=php-general&m=98618455619989&w=2

Here are links to other similar threads I've replied to - read all of each
thread for the full picture.

http://marc.theaimsgroup.com/?l=php-general&m=98754380108909&w=2
http://marc.theaimsgroup.com/?l=php-general&m=96578812203470&w=2

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19.
I downloaded php-4.0.4pl and configured and installed it.  Now when I try to
bring up a php page it trys to download it instead of execute.  I added the
"AddType" line for php4 in my httpd.conf but it made no difference.  I
noticed Apache 1.3.19 with RH7.1 treats modules differently with the
IfDefine functions...am i missing something here?  Anybody have any idea how
I might be able to get this to work?

Thanks.

--j2n.






Your httpd.conf configuration should look something like this:

AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps

-----Original Message-----
From: j2n tech [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php4 on RedHat 7.1


I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19.
I downloaded php-4.0.4pl and configured and installed it.  Now when I try to
bring up a php page it trys to download it instead of execute.  I added the
"AddType" line for php4 in my httpd.conf but it made no difference.  I
noticed Apache 1.3.19 with RH7.1 treats modules differently with the
IfDefine functions...am i missing something here?  Anybody have any idea how
I might be able to get this to work?

Thanks.

--j2n.



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





[root@blackwidow logs]# gdb /usr/local/apache/bin/httpd
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run -X -f /usr/local/apache/conf/http_debug.conf
Starting program: /usr/local/apache/bin/httpd -X -f
/usr/local/apache/conf/http_debug.conf
WARNING: detected MinSpareServers set to non-positive.
Resetting to 1 to avoid almost certain Apache failure.
Please read the documentation.

Program received signal SIGSEGV, Segmentation fault.
0x4021a17c in chunk_free (ar_ptr=0x402aef40, p=0x81e2ed0) at malloc.c:3119
3119    malloc.c: No such file or directory.
(gdb) bt
#0  0x4021a17c in chunk_free (ar_ptr=0x402aef40, p=0x81e2ed0) at
malloc.c:3119
#1  0x4021a005 in __libc_free (mem=0x81e2ed8) at malloc.c:3031
#2  0x40321039 in _efree (ptr=0x81e2ee4) at zend_alloc.c:238
#3  0x40333bcd in destroy_op_array (op_array=0x818fda4) at
zend_opcode.c:172
#4  0x4032e772 in execute (op_array=0x8198ba4) at ./zend_execute.c:2081
#5  0x4033a150 in zend_execute_scripts (type=8, file_count=3) at
zend.c:729
#6  0x4034b261 in php_execute_script (primary_file=0xbffff8b4) at
main.c:1221
#7  0x40347ca2 in apache_php_module_main (r=0x818457c,
display_source_mode=0) at sapi_apache.c:89
#8  0x403485c3 in send_php (r=0x818457c, display_source_mode=0,
filename=0x0) at mod_php4.c:516
#9  0x403485f4 in send_parsed_php (r=0x818457c) at mod_php4.c:527
#10 0x8094ae3 in ap_invoke_handler ()
#11 0x80a8a89 in process_request_internal ()
#12 0x80a8eb8 in ap_internal_redirect ()
#13 0x8067cad in handle_dir ()
#14 0x8094ae3 in ap_invoke_handler ()
#15 0x80a8a89 in process_request_internal ()
#16 0x80a8aec in ap_process_request ()
#17 0x80a002e in child_main ()
#18 0x80a01dc in make_child ()
#19 0x80a0339 in startup_children ()
#20 0x80a0976 in standalone_main ()
#21 0x80a1113 in main ()
#22 0x401d89bb in __libc_start_main (main=0x80a0dbc <main>, argc=4,
argv=0xbffffaf4, init=0x8054ce8 <_init>,
    fini=0x80d7a80 <_fini>, rtld_fini=0x4000af40 <_dl_fini>,
stack_end=0xbffffaec) at ../sysdeps/generic/libc-start.c:92
(gdb) continue
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)

Any ideas :) I've recompiled up the ying yang

Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Fri, 27 Apr 2001 04:32:13 GMT
Server: Apache/1.3.19 (Unix) PHP/4.0.4pl1 AuthMySQL/2.20 mod_ssl/2.8.2
OpenSSL/0.9.5a
Content-Location: index.html.en
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Sat, 07 Apr 2001 21:17:24 GMT
ETag: "36cca-a71-3acf83e4;3adfb0bb"
Accept-Ranges: bytes
Content-Length: 2673
Connection: close
Content-Type: text/html
Content-Language: en
Expires: Fri, 27 Apr 2001 04:32:13 GMT

Connection closed by foreign host.
[root@blackwidow logs]#

PHP:
./configure  --with-mysql --with-apxs=/usr/local/apache/bin/apxs
--enable-track-vars --with-gd=/usr/local --with-jpeg-dir=/usr/lib
--with-imap=/usr/local

Apache:

./configure \
"--with-layout=Apache" \
"--enable-module=so" \
"--activate-module=src/modules/auth_mysql/libauth_mysql.a" \
"--enable-module=ssl" \
"--enable-module=rewrite" \
"$@"


Thanks!

Eric





Hello,
Is there any way I can send two forms at one time? What I want to do is to 
have two forms with different method (GET and POST), and then send them at 
one time, so that in the next page I get both $HTTP_POST_VARS and 
$HTTP_GET_VARS. To illustrate this:

     <FORM ACTION=3D"bla.php" METHOD=3D"post">
     <INPUT TYPE=3D"hidden" NAME=3D"foo" VALUE=3D"yahoo">
     </FORM>

    <FORM ACTION=3D"bla.php" METHOD=3D"GET">
    <INPUT TYPE=3D"hidden" NAME=3D"bar" VALUE=3D"yehaa">
    </FORM>

I want so that after submiting these forms, somehow, in the bla.php I=20
have
$HTTP_POST_VARS["foo"] = "yahoo"
$HTTP_GET_VARS["bar"] = "yehaa"

at one time. Is this possible at all?

Thanks in advance for any reply.
Reuben D. Budiardja





Hello,

I just learn PHP for a month now. It's hard for me
since I have no background in programming (I do HTML
but this is totally different).
Last few days I try to make a simple script so
visitors can search my site. I use a MySQL database
here and there are some tables to handle my other PHP
works. The "search" table contains: words_id, words,
path_id, file_id, and info fields.

This is my snippet: 
<?php//search.php
// Connect to database
include "db.php";
// Looking for the right word
$query = mysql_query ("SELECT search.words_id,
search.words, search.path_id, search.file_id,
search.info, tips.tips, path.path_id, path.path,
filename.file_id FROM search, tips, path, filename 
                        WHERE words LIKE '%$search%', search.path_id =
path.path_id AND search.file_id = filename.file_id 
                        ORDER BY words_id");
if (empty($query)){
                echo "<P>Sorry, no matching ...</P>";
        }
else {// Display search
        while ($hasil = mysql_fetch_array($query)){
                echo "<P><A
href=\"$hasil[path]/tip.php?file_id=$hasil[file_id]&tips=$hasil[tips]\">$hasil[tips]</A>";
                echo "$hasil[info]</P>\n";
        }
}
?>

And here's my search form:
  <FORM method="GET" action="search.php">
     <INPUT type="text" name="search" size="15">
     <INPUT type="submit">
  </FORM>

But I always get the "Sorry, no matching ..." output
even though my SQL table has the word in its field.
Would someone help me with this. Any suggestion, hints
or tips will help me so much.

Thank you in advance,

=====
Best regards, 

Dewara Sianipar
My Personal Pages.

"Life is like a beautiful melody, only the lyrics are messed up." 
-Anon.






On Fri, 27 Apr 2001 14:27, waro wrote:
> Hello,
>
> I just learn PHP for a month now. It's hard for me
> since I have no background in programming (I do HTML
> but this is totally different).
> Last few days I try to make a simple script so
> visitors can search my site. I use a MySQL database
> here and there are some tables to handle my other PHP
> works. The "search" table contains: words_id, words,
> path_id, file_id, and info fields.
>
> This is my snippet:
> <?php//search.php
> // Connect to database
> include "db.php";
> // Looking for the right word
> $query = mysql_query ("SELECT search.words_id,
> search.words, search.path_id, search.file_id,
> search.info, tips.tips, path.path_id, path.path,
> filename.file_id FROM search, tips, path, filename
>                       WHERE words LIKE '%$search%', search.path_id =

I think part of your problem may be in the WHERE clause above, where you 
use a comma  instead of (I think) AND


> path.path_id AND search.file_id = filename.file_id
>                       ORDER BY words_id");
> if (empty($query)){
>               echo "<P>Sorry, no matching ...</P>";
>       }
> else {// Display search
>       while ($hasil = mysql_fetch_array($query)){
>               echo "<P><A
> href=\"$hasil[path]/tip.php?file_id=$hasil[file_id]&tips=$hasil[tips]\"
>>$hasil[tips]</A>"; echo "$hasil[info]</P>\n";

and then this may cause a problem: you should enclose the array indices 
in " thus - $hasil["path]" so PHP doesn't get confused whether they are 
constants or not.

>       }
> }
> ?>
>
> And here's my search form:
>   <FORM method="GET" action="search.php">
>      <INPUT type="text" name="search" size="15">
>      <INPUT type="submit">
>   </FORM>
>
> But I always get the "Sorry, no matching ..." output
> even though my SQL table has the word in its field.
> Would someone help me with this. Any suggestion, hints
> or tips will help me so much.
>
> Thank you in advance,

A general tip - whenever you are having trouble with a SQL you can echo 
the actual query and (if you can) feed it directly to the database engine 
or (for MySQL) use mysql_error() after any calls to the database 
functions to return an error string.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Bad breath is better than no breath.




i try to use Semaphore and Shared Memory ...

but all... trying is failed.... @,@

please send some good example

about using Semaphore and Shared Memory








Hi All,

I created a table using the create command.

create table trivia
(
    entry_id integer not null auto_increment,
    trivia     text null
);

Now I have a fle tvia.txt, the content of which are as follows:

The average person's left hand does 56% of the typing.
The longest one-syllable word in the English language is "screeched".
All of the clocks in the movie "Pulp Fiction" are stuck on 4:20.
No word in the English language rhymes with month, orange, silver, or purple.

I want to insert each line of the file in a new row in the table.

I wrote the following code for it.

<?php
    include "db.php";
    dbconnect("guestbook2k");
    $fcontents=file("tvia.txt");
    while (list ($line_num, $line) = each ($fcontents)) {
        $query="insert into trivia (trivia) values ('$line')";
        $result = mysql_query($query)
        or die("Query failed: "
            ."<li>errorno=".mysql_errno()
            ."<li>error=".mysql_error()
            ."<li>query=".$query
    );
    echo "<b>Line $line_num:</b> ". $line . "<br>\n";
}
?>

I got the following error.
Query failed:
errorno=1064
error=You have an error in your SQL syntax near 's left hand does 56% of the typing. 
')' at line 1
query=insert into trivia (trivia) values ('The average person's left hand does 56% of 
the typing. ')

Now I know that I got the error because there was ( ' ) in the first line.  So how do 
I prevent this.  Or in other words insert into
the table text containing
( ' ) and ( " ) or for that matter any metacharacter.

Thank You in Advance.

Subodh Gupta
I have learned, Joy is not in things, it is in us.
You will ultimately be known by what you give and not what you get.






http://www.php.net/addslashes

-jack

Subodh Gupta wrote:
> 
> Hi All,
> 
> I created a table using the create command.
> 
> create table trivia
> (
>     entry_id integer not null auto_increment,
>     trivia     text null
> );
> 
> Now I have a fle tvia.txt, the content of which are as follows:
> 
> The average person's left hand does 56% of the typing.
> The longest one-syllable word in the English language is "screeched".
> All of the clocks in the movie "Pulp Fiction" are stuck on 4:20.
> No word in the English language rhymes with month, orange, silver, or purple.
> 
> I want to insert each line of the file in a new row in the table.
> 
> I wrote the following code for it.
> 
> <?php
>     include "db.php";
>     dbconnect("guestbook2k");
>     $fcontents=file("tvia.txt");
>     while (list ($line_num, $line) = each ($fcontents)) {
>         $query="insert into trivia (trivia) values ('$line')";
>         $result = mysql_query($query)
>         or die("Query failed: "
>             ."<li>errorno=".mysql_errno()
>             ."<li>error=".mysql_error()
>             ."<li>query=".$query
>     );
>     echo "<b>Line $line_num:</b> ". $line . "<br>\n";
> }
> ?>
> 
> I got the following error.
> Query failed:
> errorno=1064
> error=You have an error in your SQL syntax near 's left hand does 56% of the typing. 
>')' at line 1
> query=insert into trivia (trivia) values ('The average person's left hand does 56% 
>of the typing. ')
> 
> Now I know that I got the error because there was ( ' ) in the first line.  So how 
>do I prevent this.  Or in other words insert into
> the table text containing
> ( ' ) and ( " ) or for that matter any metacharacter.
> 
> Thank You in Advance.
> 
> Subodh Gupta
> I have learned, Joy is not in things, it is in us.
> You will ultimately be known by what you give and not what you get.
> 
> --
> 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]




Hi, I have a problem,
that when I get a parse error it always says that it's on line 1 in 
this or that file.
Where is the configuration option to set this right?
I have on another server seen that it's possible to get it to state 
the actual error line.
(it's PHP Version 3.0.15  on  solaris)
Please help me out on this one.
Best wishes
Jimmy Lantz
Sweden




On Fri, Apr 27, 2001 at 08:49:46AM +0200, Jimmy Lantz wrote:
> Hi, I have a problem,
> that when I get a parse error it always says that it's on line 1 in 
> this or that file.
> Where is the configuration option to set this right?

When I had this problem it turned out that the files in question had
been created on a Macintosh in Adobe GoLive, I think. The newline
characters in files created by this program are different to those used
on Unix or DOS computers, which messes up things to the effect that the
PHP parser only sees a single line. I used a tool from the Perl Power
Tools page to convert the Mac files to Unix format, and the problem went
away:

http://language.perl.com/ppt/src/nlcvt/index.html

Cheers, Frank




you need to use the addslashes() command which will escape the quote mark
for you, so something like

$query="insert into trivia (trivia) values ('" . addslashes($line) . "')";

however, you will find that on a machine which is configured with
magic_quotes_gpc turned on, you will end up with something like

"The average person\'s left hand does 56% of the typing."

coming back out of your database, because it will actually insert

"The average person\\'s left hand does 56% of the typing." (i *think*)

so, what i have found is the best thing to do from a portability viewpoint
is write a function something along the lines of (obviously pseudo-code)

function check_quotes( $string ) {
        if magic quotes are turned off   // there is a variabel you can check for
this...
                return $string;
        else
                return addslashes($string);
}

then rather than using

$query="insert into trivia (trivia) values ('" . addslashes($line) . "')";

and risk having things doubleshashed, you can use

$query="insert into trivia (trivia) values ('" . check_quotes($line) . "')";

and it will turn out properly whether magic_quotes_gpc is turned on or off

ok, enough of me going on and on

good luck and have fun



may the php be with you :)


// -----Original Message-----
// From: Subodh Gupta [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 27 April 2001 2:44 PM
// To: PHP DB; PHP Gen
// Subject: [PHP-DB] How can this be done?
//
//
// Hi All,
//
// I created a table using the create command.
//
// create table trivia
// (
//     entry_id integer not null auto_increment,
//     trivia     text null
// );
//
// Now I have a fle tvia.txt, the content of which are as follows:
//
// The average person's left hand does 56% of the typing.
// The longest one-syllable word in the English language is "screeched".
// All of the clocks in the movie "Pulp Fiction" are stuck on 4:20.
// No word in the English language rhymes with month, orange,
// silver, or purple.
//
// I want to insert each line of the file in a new row in the table.
//
// I wrote the following code for it.
//
// <?php
//     include "db.php";
//     dbconnect("guestbook2k");
//     $fcontents=file("tvia.txt");
//     while (list ($line_num, $line) = each ($fcontents)) {
//         $query="insert into trivia (trivia) values ('$line')";
//         $result = mysql_query($query)
//         or die("Query failed: "
//             ."<li>errorno=".mysql_errno()
//             ."<li>error=".mysql_error()
//             ."<li>query=".$query
//     );
//     echo "<b>Line $line_num:</b> ". $line . "<br>\n";
// }
// ?>
//
// I got the following error.
// Query failed:
// errorno=1064
// error=You have an error in your SQL syntax near 's left hand
// does 56% of the typing. ')' at line 1
// query=insert into trivia (trivia) values ('The average person's
// left hand does 56% of the typing. ')
//
// Now I know that I got the error because there was ( ' ) in the
// first line.  So how do I prevent this.  Or in other words insert into
// the table text containing
// ( ' ) and ( " ) or for that matter any metacharacter.
//
// Thank You in Advance.
//
// Subodh Gupta
// I have learned, Joy is not in things, it is in us.
// You will ultimately be known by what you give and not what you get.
//
//
//
// --
// PHP Database 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]
//





Is anybody knows how can I redirect to another page
and the REFERER to another page to be my page ?

Thanks,
Rosen Marinov


""Rosen"" <[EMAIL PROTECTED]> wrote in message
9c912a$had$[EMAIL PROTECTED]">news:9c912a$had$[EMAIL PROTECTED]...
> Hi,
> I have BIG problem using "HTTP_REFERER".
> I have two pages:
>
> main.php:
> <A HREF=test.php target= _blank>Click here</A>
>
> test.php:
> .........somecode
> echo "<SCRIPT
> language=\"javascript\">window.location.href=\"http://$web\";;</script>";
>
> $web - some website.
>
>
> But on the $web site (some site) I can't get the REFERER !!!
>
>
>
>
>
> --
> 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]
>






My interpretation of the problem is:
You want a link on page A.php which points to B.php, 
B.php does some stuff, then redirects the user to page C.php

You want the value of HTTP_REFERER on page C.php to be A.php

Correct? If so, read on, if not, then delete this email.

I'm using php-4.0.4pl1, apache 1.3.14, IE5.5, win2000, and this works on my
system.

My two solutions both use the following 2 files :
[index.html]
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<A HREF="test.php" target="_blank">Click here</A>
</BODY>
</HTML>

[targetpage.php]
<HTML>
<HEAD>
<TITLE>targetpage.php</TITLE>
</HEAD>
<BODY>
You came to this page from "<?php echo $HTTP_REFERER;?>"
</BODY>
</HTML>


Solution 1:
Use the php function "header"
(http://www.php.net/manual/en/function.header.php)

[test.php]
<?php
        //... do stuff
        $web= "http://localhost/referer_test/targetpage.php";;
        header ("Location: ".$web);
?>

-------------------
Solution 2:
Pass HTTP_REFERER in the URL: This also works on my system, but isn't
exactly the neatest of methods.

[test.php]
<HTML>
<HEAD>
<TITLE>test.php</TITLE>
</HEAD>
<BODY>
<?php
        $web= "localhost/referer_test/targetpage.php";
        $web= $web."?HTTP_REFERER=".$HTTP_REFERER;      //pass HTTP_REFERER
in the URL
        echo "<SCRIPT
language=\"javascript\">window.location.href=\"http://$web\";</script>";
?>
</BODY>
</HTML>




Hope that helped,

Simon.

> -----Original Message-----
> From: Rosen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 27, 2001 07:56
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem with the HTTP_REFERER
> 
> 
> Is anybody knows how can I redirect to another page
> and the REFERER to another page to be my page ?
> 
> Thanks,
> Rosen Marinov
... snip ...





Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"
----- Original Message ----- 
From: Jacky 
To: [EMAIL PROTECTED] 
Sent: Friday, April 27, 2001 2:59 PM
Subject: how do I calculate this?


Hi all
I have a variable that store number of days, I want to divided by 7 and if it can be 
divided by 7 perfectly, then I will redirect them to one page, otherwise send them to 
another page.
How do I set up condition in the if...then....else bit to determine if the value is 
divided by 7 perfectly or not?
cheers 
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




$days = <whatever>;

if ($days % 7 == 0) {
  ...then $days is divisible by seven;
} else {
  ...if is not;
}

the % is the modulus operator. basically divides left hand side by right
hand side and returns the remainder.

HTH

On Fri, 27 Apr 2001, Jacky wrote:

> ----- Original Message -----
> From: Jacky
> To: [EMAIL PROTECTED]
> Sent: Friday, April 27, 2001 2:59 PM
> Subject: how do I calculate this?
>
>
> Hi all I have a variable that store number of days, I want to divided
> by 7 and if it can be divided by 7 perfectly, then I will redirect
> them to one page, otherwise send them to another page. How do I set up
> condition in the if...then....else bit to determine if the value is
> divided by 7 perfectly or not? cheers Jack [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>





Hi,

I want to know how to execute a php scripts which update a MySQL
database.

I am working on Win 98 and MySQL is install on Linux on another
computer.

Thank You in Advance.





Bertrand,

if you're serious about trying to get help for something, it would be very
helpful if you ask a more specific question, with code samples of what
you've done so far.

There are excellent tutorials on this subject, at http://www.phpbuilder.com,
http://www.phpbeginner.com, http://www.zend.com, http://www.devshed.com etc.
etc. Start with the devshed one, click on the PHP area, and find your way
through PHP101. It takes a few hours to get into it, but it will be worth
your time, believe me.

You also have to tell us if you have php&apache (or another webserver) on
the MySQL computer, or if you're running PHP and the webserver on Windows
and MySQL on a different (Linux, as you said) computer. These things are
important for things such as user access rights in MySQL (the default mysql
account doesn't have privileges to access the database from a remote host,
only @localhost).


Regards,
Henning Pedersen
Funcom Oslo



-----Original Message-----
From: Bertrand TACHAGO [mailto:[EMAIL PROTECTED]]
Sent: 27. april 2001 18:45
To: [EMAIL PROTECTED]
Subject: [PHP] How to execute a php scripts


Hi,

I want to know how to execute a php scripts which update a MySQL
database.

I am working on Win 98 and MySQL is install on Linux on another
computer.

Thank You in Advance.


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






I need to run the if-construct below (containing a number of variables in
each "branch") using the 2 variables $table1 and $table2  in each run  for
each combination
Is it array_walk or foreach ? (I "guess" that here I need a 2-dim-array, or
so, passing always these 2 variables with each run:
This expression has to be run using the 2 variables $table1 and $table2 in
each possible combination, which is :


$table1="a"; $table2="x";
$table1="a"; $table2="y";
$table1="a"; $table2="z";
$table1="b"; $table2="x";
$table1="b"; $table2="y";
$table1="b"; $table2="z";

How do I assign these valies to a multidim array and pass pairs of $table1
and $table2 to a foreach() or array_walk loop?

Now this is the construct that shall be looped thru:

For($i=0,$i<$numfields,$i++)
{
    If($table1=="a" || $table1=="b" )
    {
      if($table1=="a")
        {Do this using 4 variables}
      elseif($table1=="b")
        {Do that using 6 varuables}
    }
    elseif($table1=="c")
    {
      if($table2=="x")
       {Do this} using 4 variables
      elseif($table2=="y")
       {Do that using 4 variables}
      elseif($table3=="z")
       {Do something else using 6 variables}
    }
} //endfor

Thanks for any idea on this.





Hi

I just rewrote a website to use sessions all over the site. on one page
i used
output-compression just to test it. if i use MSIE everything just works
fine, BUT:
if i use Netscape WITHOUT cookies the PHP does not rewrite the relative
urls....
here is the code of the page :

session_start();
function my_obstart() {
$encoding = getenv("HTTP_ACCEPT_ENCODING");
if (eregi("gzip",$encoding))
{
ob_start("ob_gzhandler");
} else
{
ob_start();
}
}
my_obstart();
...
...

i can't view the html-source-code when using netscape and compression,
so i don't
know exactly what arrives at the browser....

thanks

Sebastian 




 I need to write a script which extracts information POSTed by a
non-browser client, and stores it on the server.  With a browser client
I could upload from with <input type="file"> form elements and use the
PHP upload functions, but using a browser at the client end is not an
option here.

According to the w3c docs, POSTed  content is sent in the "request
entity body".  Since the request has a header, it's logical that it can
have a body too :-) but I don't see any PHP functionality for getting at
it. Someone in another group suggested accessing a variable called
$HTTP_RAW_POST_DATA, but that doesn't seem to exist when I POST data to
either of my test systems, which are Linux/Apache or Win98/PWS.

PHP itself must be able to extract the POSTed data - it does so when
saving a POSTed file to its temporary location - but this function don't
seem to be exposed in the API... is it?

Thanks for any wisdom!
nik





I write a script for dealing with a form and the algorithem will look like
this

if (isset($somthing)) {
        the form is here and user input it

}

if($filter_in_the_form == 'something) {
        print the 1st
}

elseif($all_condition_done == 'OK') {
       print the 2nd

} else { print nothing done }



when i run it the first condition are done,....OK then i input my data in
the form
then the $filter_in_the_form checked up something and so another form then i
input the data.....after i submit it should print out
all the data then I input as a result

but the thinks happen is .... then result of my input data print out with
the 2nd form
how do I print out the data with out showing the 2nd form ???

in perl when i used cgi i just define cgi->new

Thanks in Advance

Yamin Prabudy




Reply via email to