Re: [PHP] HTTP_REFERER work without a problem....

2003-01-16 Thread Jason Wong
On Thursday 16 January 2003 05:38, Scott Fletcher wrote:
> Or worse, not substituting the characters in the Session ID.  Just use the
> same Session ID.  What if there is leftover session file in the /tmp
> directory of the Unix machine and we're dealing with hundred of users each
> day.  Some of those session files aren't deleted because the user just
> closed the browser without logging out.  It is unfortunate that there is no
> better solution to this.

I've been sort of following this thread and as I understand it you're trying 
to use HTTP_REFERER to ascertain whether a user has 'logged in'? IE if 
HTTP_REFERER isn't the login page then they haven't 'logged in'? 

If that is the case then you should know that this provides no security at 
all.

Use a proper authentication system based on sessions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If Robert Di Niro assassinates Walter Slezak, will Jodie Foster marry Bonzo??
*/


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




Re: [PHP] I wanta the PHP doc notes.

2003-01-16 Thread Jason Wong
On Wednesday 15 January 2003 21:16, Avenger wrote:
> Hey,I wanta used the PHP doc user notes.
>
> Where can i get it.

http://weblabor.hu/php-doc-chm

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY:
#32: You call your answering service and they've never heard of you.
*/


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




Re: [PHP] Session wierdness...

2003-01-16 Thread Jason Wong
On Thursday 16 January 2003 04:17, Timothy Hitchens \(HiTCHO\) wrote:
> Now what is the output if you do this outside of the function after
> registering a session var??
>
>
> Timothy Hitchens (HiTCHO)
> Open Source Consulting
> e-mail: [EMAIL PROTECTED]
>
> > -Original Message-
> > From: Duncan Abbott [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, 16 January 2003 4:53 AM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Session wierdness...
> >
> >
> > I did what you suggested and I've attached the output -
> > there's no $_SESSIONS array in there.
> >
> > But I've managed to register session vars outside of this
> > function I'm having trouble with so what's going on?

You've probably realised by now that it is the $_SESSION variable you're 
looking for?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Man who arrives at party two hours late will find he has been beaten
to the punch.
*/


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




[PHP] Why oh Why????

2003-01-16 Thread WMB
As a beginner I have been trying and trying, but to no suc6. Hope there's
someone here able to help me out:

Am trying to get rid of spaces and change all into uppercase in an entered
form variable, which I am able to do when trying things out but when running
the full php statement it refuses to change and enters the original variable
into the database anyway. Haven't got a clue why.

Please, what's wrong with the following:

 if(mysql_result($query, 0, 0) == 0)// && (mysql_result($query2) > 0)#)
  {
  $password = md5($_POST['strPassword']);
  $newstrUserName = $_POST['strUsername'];
  $newstrUserName = strtoupper(ereg_replace(" ", "",
$newstrUserName));
  $strQuery = "INSERT INTO users (";
  $strQuery .= "`username`, `password`, `level`, `firstname`,
`lastname`, `ngfnummer`, `email`) VALUES (";
  $strQuery .= "'$newstrUserName', '$password', '1',
'{$_POST['strFirstName']}', '{$_POST['strLastName']}',
'{$_POST['strNgfnummer']}', '{$_POST['strEmail']}')";
if(mysql_query($strQuery)) etc etc etc

original username given f.i. 'joe 8', $newstrUserName makes this 'JOE8', but
the above still enters 'joe 8' into database, how come?
Thanks,
Martin





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




[PHP] Re: Php's future with Asp .NET?

2003-01-16 Thread Brian McGarvie
The 'problem' with ASP is that it really requires a Windows platform... and
while Unix is still primarily the OS of choice for web-servers then ASP &
PHP will 'co-exist' there will always be a PHP and ASP camp... naturally any
broad-minded developer will keep up with both technologies as this will
ultimatley make you more sellable when looking for work or a job.

I have very little ASP experiance, but that has cost me the oppertinity to
apply for several well-paying jobs, as there is very few PHP positions
around - I'm speaking for the UK market here.

Saying that, most companies that ask for ASP don't necessarily 'need' to use
ASP, they just request it cos it's the executive-level buzzword of the
moment, if you get in you can always show them the errors of their
misconceptions - I generally have!

However  I feel that will change - in the UK atleast there is a slowly
growing number of PHP-based projcets & roles appearing, and PHP is by far
the most flexible & powerfull of the 2 - IMHO. I have been a web-developer
for several years, and have deployed solutions in ASP, Cold Fusion and PHP,
PHP remains my platform of choice as it works equally well in both Unix &
Windows platforms.

This is of course just my views & hopes for the present and future :)

Long live PHP!!!


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 08/01/03



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




[PHP] Random Row...

2003-01-16 Thread Brian McGarvie
$sql = "
select count(*) as theCount
from myTable
";
...
$row_id = rand(1, $myrow["theCount"]);
...
$sql_randow_row "
select *
from myTable
where id = $row_id
";

I assume I'm right with the method above to select a random row? or any
other way?



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 08/01/03



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




[PHP] GD version 1.6.2 and resizing images...

2003-01-16 Thread Marco Alting
My provider has GD version 1.6.2 running, and I'm trying to dynamically
resize uploaded JPEG images. But ofcourse that doesn't work with that
version. Does anyone have another solution to automatically resize JPEG
images upon upload?



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




Re: [PHP] Random Row...

2003-01-16 Thread Danny Shepherd
Don't make life difficult for yourself :)

SELECT * FROM myTable ORDER BY RAND() LIMIT 0,1

HTH

Danny.

- Original Message - 
From: "Brian McGarvie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 9:37 AM
Subject: [PHP] Random Row...


> $sql = "
> select count(*) as theCount
> from myTable
> ";
> ...
> $row_id = rand(1, $myrow["theCount"]);
> ...
> $sql_randow_row "
> select *
> from myTable
> where id = $row_id
> ";
> 
> I assume I'm right with the method above to select a random row? or any
> other way?
> 

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




RE: [PHP] Re: Php's future with Asp .NET?

2003-01-16 Thread Sean Malloy
I think that the developers of PHP know exactly where they want PHP
to sit in the big bad world of .NET/J2EE.

The whole reason the dotnet and java extensions have been written for
PHP, is to allow PHP to talk to java/net objects, but more importantly,
have PHP act as the front end, and .NET/J2EE do the business logic. I
can't remember where I read it, but one of the PHP developers was
mentioning that part of the modifications to ZE2 and its object
handling, was to enable better interactione with Java and .NET.

It will be more interesting once the Mono project reaches v1.0. Then
you will have a .NET runtime on Unix environments, as well as ASP.NET,
and the argument that 'ASP.NET is windows only' will cease to exist.

There will always be a place for PHP in the web world. As an application
engine, and as a frontend to other languages (Just look at what yahoo
are doing with PHP)

The 'ASP vs PHP' threads will still continue. What a waste of time
they are.

-Original Message-
From: Brian McGarvie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 16 January 2003 8:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Php's future with Asp .NET?


The 'problem' with ASP is that it really requires a Windows platform... and
while Unix is still primarily the OS of choice for web-servers then ASP &
PHP will 'co-exist' there will always be a PHP and ASP camp... naturally any
broad-minded developer will keep up with both technologies as this will
ultimatley make you more sellable when looking for work or a job.

I have very little ASP experiance, but that has cost me the oppertinity to
apply for several well-paying jobs, as there is very few PHP positions
around - I'm speaking for the UK market here.

Saying that, most companies that ask for ASP don't necessarily 'need' to use
ASP, they just request it cos it's the executive-level buzzword of the
moment, if you get in you can always show them the errors of their
misconceptions - I generally have!

However  I feel that will change - in the UK atleast there is a slowly
growing number of PHP-based projcets & roles appearing, and PHP is by far
the most flexible & powerfull of the 2 - IMHO. I have been a web-developer
for several years, and have deployed solutions in ASP, Cold Fusion and PHP,
PHP remains my platform of choice as it works equally well in both Unix &
Windows platforms.

This is of course just my views & hopes for the present and future :)

Long live PHP!!!


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




RE: [PHP] Problems with require() and variables

2003-01-16 Thread Ford, Mike [LSS]
> -Original Message-
> From: Phil Powell [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2003 04:33
> 
> I have view.php, a script that will include display.php and 
> have to manipulate the variables within display.php for itself.
> 
> So in view.php I have:
> 
> require('/.../.../display.php');
> 
> However, when display.php finishes being "required", I lose 
> all of my variables that I need for view.php.  How do I 
> retain them??

You don't need to -- the included file is effectively part of the including file, so 
all variables available in one are equally available in the other.

>  How can I ensure that these variables in 
> display.php will also exist in view.php?

By doing nothing.  You must be doing something else wrong.  Show us your code (or a 
relevant sample, if it's big!).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] Getting a dynamic IP address

2003-01-16 Thread Marek Kilimajer
it is stored in $_SERVER["SERVER_ADDR"]

Kyle Lampkin wrote:


  Hello all,
Newbie here I need to know if there is a way I can get my dynamic 
IP address for use in a php script?



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




Re: [PHP] GD version 1.6.2 and resizing images...

2003-01-16 Thread Jason Wong
On Thursday 16 January 2003 17:43, Marco Alting wrote:
> My provider has GD version 1.6.2 running, and I'm trying to dynamically
> resize uploaded JPEG images. But ofcourse that doesn't work with that
> version. Does anyone have another solution to automatically resize JPEG
> images upon upload?

If you can install your own programs then you can use netpbm or ImageMagick 
(or you can ask your host to do so).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
He who knows, does not speak.  He who speaks, does not know.
-- Lao Tsu
*/


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




Re: [PHP] [phplib template] file does not exist

2003-01-16 Thread Marek Kilimajer
First go to the file that generates the error and find out how it knows 
the template file does not exists

roel wrote:

Hi,

i'm having a problem. I just installed a webserver with mysql and php. I
copied my files that i had stored on another webserver to my new. I didn't
change anything to these files and the files worked fine on the other
server.

Now in this server i get this error with a template:
   Template Error: filename: file ./templates/nav_left_body.tpl.php does
   not exist.
   Halted

But that file does exist. I can see it through ftp an i can get to it via
http browser.

What could be wrong? Could it be a config failure in my php.ini? Or in
httpd.conf? In case it is the config, what could it be?

Thanks in advance!!



 



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




Re: [PHP] Images : Store in dB or disk?

2003-01-16 Thread Marek Kilimajer


Bobby Patel wrote:


Hello,
I have the Images table setup with columns (width, height, size, type,
etc...) the question is should I have the image data stored in this table or
disk?

I know, alot of people have said it is faster in disk, which is 1 page I/O.
But I need these images for displaying product pages, and I believe that it
would be faster to just pluck the properties from the dB (including the
image file) .

Usually I will need to pull 6 or 10 images per page, this is my rational for
this situation:

If all stored on db:
One query  - will take about 4-5 page I/O (assumiing index on filename)


images will be requested separate, so there will be query to get the 
properties (page request), and queries to get the actual image data 
(requests for images).


If just properties stored on dB and image on disk:
One query to grab the rows of properties - 2-3 page I/O
to grab 6 or 10 images - 6 or 10 page I/O
Total - 8 - 13 Page I/O's

If all images stored on disk, no dB whatso ever:
to grab 6 or 10 images - 6 or 10 page I/O
cpu time to run getimagesize()  for each image - CPU time unknown?

I assume that "page I/O" is that same as "disk access".

I AGREE that storing images strored on disk is a valid approach PROVIDED
that you only need 1 image per page, but if you need to grab a bunch at a
time, I do beleieve that storing the actual file on the dB is faster.

I would like to hear from the list, of people that have worked with images
and PHP. I just started with images, so I just want to take the right path.



 



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




Re: [PHP] temporary DNS lookup in php?

2003-01-16 Thread Marek Kilimajer
I'm not sure if I understand you, but you can simply specify IP address 
and correct Host header

Patrick Hsieh wrote:

Hello list,

I am trying to open a remote webpage in my php program with curl library. The 
webpage will redirect me to another webpage(Say, 
"http://www.anothersite.com/index.html";). Basically, the curl library will 
resolve the domain name via the DNS servers defined in the system, however, I 
hope I can customized the temporary DNS lookup in the php program for special 
purpose without modifying the /etc/resolv.conf or other system configuration 
files. Is it possible? How?


 



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




Re: [PHP] Why oh Why????

2003-01-16 Thread Jason Wong
On Thursday 16 January 2003 17:17, WMB wrote:

Please use a descriptive subject!

> Am trying to get rid of spaces and change all into uppercase in an entered
> form variable, which I am able to do when trying things out but when
> running the full php statement it refuses to change and enters the original
> variable into the database anyway. Haven't got a clue why.
>
> Please, what's wrong with the following:
>
>  if(mysql_result($query, 0, 0) == 0)// && (mysql_result($query2) > 0)#)
>   {
>   $password = md5($_POST['strPassword']);
>   $newstrUserName = $_POST['strUsername'];
>   $newstrUserName = strtoupper(ereg_replace(" ", "",
> $newstrUserName));

So here if you echo $newstrUserName, it is correct and what you had expected?

>   $strQuery = "INSERT INTO users (";
>   $strQuery .= "`username`, `password`, `level`, `firstname`,
> `lastname`, `ngfnummer`, `email`) VALUES (";
>   $strQuery .= "'$newstrUserName', '$password', '1',
> '{$_POST['strFirstName']}', '{$_POST['strLastName']}',
> '{$_POST['strNgfnummer']}', '{$_POST['strEmail']}')";

What if you now echo $strQuery? Is it still what you expected?

> if(mysql_query($strQuery)) etc etc etc

And you should have error checking in your code, something like:

  if (mysql_query($strQuery)) {
 do_your_stuff; }
  else { //an error
echo mysql_error();
  }

or checkout the examples in the manual.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The most costly of all follies is to believe passionately in the palpably
not true.  It is the chief occupation of mankind.
-- H.L. Mencken
*/


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




Re: [PHP] Free web-hosting

2003-01-16 Thread David T-G
Gladky --

...and then Gladky Anton said...
% 
% Hello everybody!

Hi!


% Can anybody advice me the best free web-hosting with PHP?

No, there's still no new advice (I can understand posting a second time
because of a lack of response the first time -- and so I'll stop a third
post right now).  Check the mailing list archives for the last million
times this has come up.


% Thank you.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93181/pgp0.pgp
Description: PGP signature


Re: [PHP] execute shell commands

2003-01-16 Thread Marek Kilimajer
Use sudo (man sudo)

Mantas Kriauciunas wrote:


Hey!
What I want to do is, There is user that logs into the channel. And I
need to make script to change his password. How do I execute shell
command: passwd ? or what should I do to change that password?
Thanks!
mNTKz

 



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




Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread Sancar Saran
On Thursday 16 January 2003 09:07, Dhaval Desai wrote:
> Hello ppl,
>
> I was just wondering what is php's future with something like Asp .Net
> coming up...I have read many articles by Php guys who think Asp.Net is the
> future. If that's the true case...is it really worth sticking to Php at
> all?
>
> Thanx!
> -Dhaval
>
Hi,
My opinon is Php future is very bright. .NET is marketing mumbo jumbo, and 
java is Sun's bug yard.

It was pretty clear. None of them able to compete against PHP. ASP.NET is 
expensive, JSP is hard to config and code. Both of them slower than PHP, 
learning PHP easier than others.

Sancar "Delifisek" Saran



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




[PHP] Speed concerns with OOP and PHP4

2003-01-16 Thread John Wells
I'm working on a large VB/Sql Server to Php/Postgresql conversion (approx.
60k lines of code).

I'd like to design this thing as OO as possible, because I think
ultimately it leads to better, more extendable and readable software. 
However, since php does the whole copy thing with objects, I'm a little
concerned.

Is this "deficiency" on the part of PHP 4 something I should be concerned
about?  If I have a 60k loc fully object-oriented php app with a large
amount (approx. 500 or so) queries to a db, am I making a mistake by going
OO?  Will it really slow down the app *that* much, or consume memory like
a pack of hungry piranhas?

Thanks for the input, guys.

John





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




Re: [PHP] Getting a dynamic IP address

2003-01-16 Thread Chris Hayes
At 00:41 16-1-2003, you wrote:

  Hello all,
Newbie here I need to know if there is a way I can get my dynamic IP 
address for use in a php script?
--

There are loads of variables in the arrays $_SERVER and $_ENV, dump these 
arrays and see if there is something in it that you can use. Maybe you can 
get a hint by running the

phpinfo()
?>
function. It will output loads of info.




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



Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread 1LT John W. Holmes
> On Thursday 16 January 2003 09:07, Dhaval Desai wrote:
> > Hello ppl,
> >
> > I was just wondering what is php's future with something like Asp .Net
> > coming up...I have read many articles by Php guys who think Asp.Net is
the
> > future. If that's the true case...is it really worth sticking to Php at
> > all?
> >
> > Thanx!
> > -Dhaval
> >

Do you believe everything you hear? If so, email me, because I can get you
some great deals on anything you want!

Anyhow... PHP/ASP/JSP are all here to stay. PHP is moving further up and up.
Overall, the best recommendation is to use what you know and what
accomplishes your mission.

On a semi-related note, I read something the other day that MS was dropping
the .Net name from it's next round of OS releases. I guess there was
supposed to be a Windows Server .Net or something, but they decided to drop
it because even they admitted that _everything_ was .Net and it was getting
saturated.

---John Holmes...


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




Re: [PHP] "document contained no data"

2003-01-16 Thread Marek Kilimajer
If the server crashes, it is definetly NOT fault of your scripts, the 
server/php should return errors when there is something wrong, not 
crash. Remember that on multithreaded server you are taking other 
requests down too. The server, php, some extenssion might have been 
miscompiled, wrong versions of libraries are used, there is a bug, 
anything. But you should not be able to take server down from a script 
language.
Take a look at extenssions used, if any of them is unstable/experimental

Justin French wrote:

Just as an update, the sysadmin definitely thinks it's my code... I'm not
convinced, but I'm faced with the task of finding out :)

 

It appears your site is causing the webserver to segfault (crash), which is
why nothing comes up some times - these crashes are logged in the main Apache
logfile, which is why you saw nothing in your site logfile when this happened.
I don't know exactly what is causing it to crash, but it is definately
something in your PHP code.
   


I asked for a copy of the logfiles she talked about:

 

[Wed Jan 15 08:23:32 2003] [notice] child pid 8153 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:57 2003] [notice] child pid 7702 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:58 2003] [notice] child pid 7366 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:59 2003] [notice] child pid 7511 exit signal Segmentation
fault (11)
[Wed Jan 15 08:35:00 2003] [notice] child pid 7512 exit signal Segmentation
fault (11)

   


Not very helpfull :)


As far as I can tell, the error I receive (basically a "document contained
no data" error) is the result of the server shitting itself because of
ANOTHER script on my site, that was accessed before it.

This makes debugging even worse, because I don't even know what script to
look in!

It could be in any include()'d file in my header or footer, or the guts of
any script on my site!!  Yay!!


The other possibility is that the crash occurs on the actual script I'm
calling, which IS a bit easier to debug... I think!


The sysadmin has pretty much ruled out memory leaks:

 

I checked the httpd processes
to see if any memory was leaking (if the memory usage climbs constantly,
memory is being leaked), but it was all fine.
   



Has any one got any suggestions on how I might track down this bug, or
ascertain which script/include file is causing the server to segfault?


Justin


 



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




Re: [PHP] Speed concerns with OOP and PHP4

2003-01-16 Thread Maxim Maletsky

"John Wells" <[EMAIL PROTECTED]> wrote... :

> I'm working on a large VB/Sql Server to Php/Postgresql conversion (approx.
> 60k lines of code).

First of all, VB is precompiled and PHP is not. This will already be
slower. So, you gonna need to create a logic that loads only the
necessary classes for every request. In VB you wouldn't probably need it.

> I'd like to design this thing as OO as possible, because I think
> ultimately it leads to better, more extendable and readable software. 

Good idea.

> However, since php does the whole copy thing with objects, I'm a little
> concerned.
>
> Is this "deficiency" on the part of PHP 4 something I should be concerned
> about?

Depends al on the logic you will give to it.

> If I have a 60k loc fully object-oriented php app with a large
> amount (approx. 500 or so) queries to a db, am I making a mistake by going
> OO? 

500 queries wan't really matter because it has few to do with OO/PHP.
60k of code, if all together on the same request will be definitely slow.
So, make sure that *only* the required classes are loaded on each
execution.


--
Maxim Maletsky
[EMAIL PROTECTED]



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




[PHP] MIME email...

2003-01-16 Thread Brian McGarvie
All,

I have a problem sending Multipart - MIME (plaintext + html) email

 $bodyPlaintext = " (PLAINTEXT)";

 $bodyHTML = " (HTML CODE)";
 $headers = "";
 $headers .= "From: [EMAIL PROTECTED]\r\n";
 $headers .= "Reply-To: [EMAIL PROTECTED]\r\n";
 $headers .= "X-Mailer: PHP " . phpversion();

 $subject = "Alert! Confirmation!";

 //unique boundary
 $boundary = uniqid("HTMLBODY");
 //add From: header
 //$headers = "From: [EMAIL PROTECTED]\r\n";
 //specify MIME version 1.0
 $headers .= "MIME-Version: 1.0\r\n";
 //tell e-mail client this e-mail contains//alternate versions
 $headers .= "Content-Type: multipart/alternative; boundary =
$boundary\r\n\r\n";
 //message to people with clients who don't
 //understand MIME
 $headers .= "This is a MIME encoded message.\r\n\r\n";
 //plain text version of message
 $headers .= "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
 $headers .= chunk_split(base64_encode($bodyPlaintext));
 //HTML version of message
 $headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
 $headers .= chunk_split(base64_encode($bodyHTML));

sent with:

mail($email, $subject, "", $headers);

Now... the problem I have is some people are reporting they get the
Multi-part stuff as the body... for others it'll work as wanted... i.e.
display Plaintext or render the HTML as wanted.

Anyone had this problem?


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03



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




[PHP] Problem with a for loop...

2003-01-16 Thread Davíð Örn Jóhannsson
I have al for loop that looks something like this:
 
$checkCurrName  = "SELECT imgName FROM $db_img ORDER BY imgName DESC";
$resultCurrName = mysql_query($checkCurrName, $db);
 
 
for ($i = 0; $i < $n; $i++){
list($currName) = mysql_fetch_row($resultCurrName);
$newName = $currName++;
print($newName);
 
//insert $newName into db
} 
 
The problem is that I get the first printout right (the current value in
the database + 1) but all after that equal the first one, it looks
like i’m not getting the newest value from the database after the first
loop.
 
Any Ideas about this
 
Thanks, David



RE: [PHP] File() function and require()

2003-01-16 Thread Mike Tharp
OK, I have a file called page.php that has the following code in it 
(example but same layout and concept).





Page Title


This is the text in the body of the page.



The membercheck.php file contains a login form that is used if a session 
variable doesn't exist, i.e. the user is not logged in. What happens is 
when I run file() to read in the contents of page.php it reads in the code 
that is in the membercheck.php file, and never reads in any code that is 
in the page.php file. What I would need is a way to read in the contents 
of the page.php file without reading the membercheck.php file.

Better explanation?

 
Mike Tharp
Lotus Notes Administrator
Herman Miller Inc.
[EMAIL PROTECTED] 


Re: [PHP] Problem with a for loop...

2003-01-16 Thread 1LT John W. Holmes
Are you sure $n is being set somewhere?

Why not do it like this:

while($row = mysql_fetch_row($resultCurrName))
{
  print $row[0]+1;

  //do rest of whatever...
}

---John Holmes...

- Original Message -
From: "Davíð Örn Jóhannsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 8:39 AM
Subject: [PHP] Problem with a for loop...


I have al for loop that looks something like this:

$checkCurrName  = "SELECT imgName FROM $db_img ORDER BY imgName DESC";
$resultCurrName = mysql_query($checkCurrName, $db);


for ($i = 0; $i < $n; $i++){
list($currName) = mysql_fetch_row($resultCurrName);
$newName = $currName++;
print($newName);

//insert $newName into db
}

The problem is that I get the first printout right (the current value in
the database + 1) but all after that equal the first one, it looks
like i'm not getting the newest value from the database after the first
loop.

Any Ideas about this

Thanks, David


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




Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread Maxim Maletsky

"Dhaval Desai" <[EMAIL PROTECTED]> wrote... :

> Hello ppl,
> 
> I have read many articles by Php guys who think Asp.Net is the 
> future. 

What PHP guys?

> If that's the true case...is it really worth sticking to Php at all?

Definitely yes, unless you love paying the licenses for every single
form you add to your pages :)

--
Maxim Maletsky
[EMAIL PROTECTED]


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




FW: [PHP] Problem with a for loop...

2003-01-16 Thread Davíð Örn Jóhannsson


-Original Message-
From: Davíð Örn Jóhannsson [mailto:[EMAIL PROTECTED]] 
Sent: 16. janúar 2003 13:59
To: '1LT John W. Holmes'
Subject: RE: [PHP] Problem with a for loop...

I only want the last inserted row in the mysql database, and each time
the script goes trough the loop it adds a new row into the database, so
I want to get the newest row from the database when the script goes
throug the loop
The second time. But it dosent look like im geting the new row from the
database even though it is inserted. I'm wondering if mysql_querys don't
work in loops in order to get the newst row but if it works how would I
be able to accomplis that?

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: 16. janúar 2003 13:51
To: Davíð Örn Jóhannsson; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with a for loop...

Are you sure $n is being set somewhere?

Why not do it like this:

while($row = mysql_fetch_row($resultCurrName))
{
  print $row[0]+1;

  //do rest of whatever...
}

---John Holmes...

- Original Message -
From: "Davíð Örn Jóhannsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 8:39 AM
Subject: [PHP] Problem with a for loop...


I have al for loop that looks something like this:

$checkCurrName  = "SELECT imgName FROM $db_img ORDER BY imgName DESC";
$resultCurrName = mysql_query($checkCurrName, $db);


for ($i = 0; $i < $n; $i++){
list($currName) = mysql_fetch_row($resultCurrName);
$newName = $currName++;
print($newName);

//insert $newName into db
}

The problem is that I get the first printout right (the current value in
the database + 1) but all after that equal the first one, it looks
like i'm not getting the newest value from the database after the first
loop.

Any Ideas about this

Thanks, David


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




php-general Digest 16 Jan 2003 14:08:49 -0000 Issue 1826

2003-01-16 Thread php-general-digest-help

php-general Digest 16 Jan 2003 14:08:49 - Issue 1826

Topics (messages 131798 through 131857):

Re: Session Problem
131798 by: Matt

Get the date of the last sunday
131799 by: Renaldo De Silva
131800 by: Daniel Kushner
131804 by: Gladky Anton

MySQL Query - Not PHP Specific
131801 by: Sean Malloy
131802 by: Daniel Kushner
131803 by: Sean Malloy

Re: Security in included PHP files
131805 by: John W. Holmes
131807 by: John W. Holmes
131818 by: Jacob Copsey

Re: File() function and require()
131806 by: John W. Holmes
131854 by: Mike Tharp

Re: OOP
131808 by: John W. Holmes

Re: Calendar problem
131809 by: John W. Holmes

Problems with require() and variables
131810 by: Phil Powell
131837 by: Ford, Mike   [LSS]

Images : Store in dB or disk?
131811 by: Bobby Patel
131813 by: rw.xend.net
131814 by: Bobby Patel
131823 by: Jason Wong
131841 by: Marek Kilimajer

emacs and php markup
131812 by: Larry Brown

temporary DNS lookup in php?
131815 by: Patrick Hsieh
131842 by: Marek Kilimajer

Re: PHP/Flash Dynamic Graphs?
131816 by: SED

execute shell commands
131817 by: Mantas Kriauciunas
131845 by: Marek Kilimajer

Re: Sessions 'funny' and Zone Alarm Pro 3
131819 by: Neil Stirton

Php's future with Asp .NET?
131820 by: Dhaval Desai
131821 by: hitek
131822 by: rw.xend.net
131832 by: Brian McGarvie
131836 by: Sean Malloy
131846 by: Sancar Saran
131849 by: John W. Holmes
131856 by: Maxim Maletsky

Re: All Request to the same script
131824 by: SLanger.spirit21.de

Re: Windows vs Linux
131825 by: Jason Wong

intermittent session loss
131826 by: Justin French

Re: Question about $_GET
131827 by: Frank Keessen

Re: HTTP_REFERER work without a problem
131828 by: Jason Wong

Re: I wanta the PHP doc notes.
131829 by: Jason Wong

Re: Session wierdness...
131830 by: Jason Wong

Why oh Why
131831 by: WMB
131843 by: Jason Wong

Random Row...
131833 by: Brian McGarvie
131835 by: Danny Shepherd

GD version 1.6.2 and resizing images...
131834 by: Marco Alting
131839 by: Jason Wong

Re: Getting a dynamic IP address
131838 by: Marek Kilimajer
131848 by: Chris Hayes

Re: [phplib template] file does not exist
131840 by: Marek Kilimajer

Re: Free web-hosting
131844 by: David T-G

Speed concerns with OOP and PHP4
131847 by: John Wells
131851 by: Maxim Maletsky

Re: "document contained no data"
131850 by: Marek Kilimajer

MIME email...
131852 by: Brian McGarvie

Problem with a for loop...
131853 by: Davíð Örn Jóhannsson
131855 by: John W. Holmes
131857 by: Davíð Örn Jóhannsson

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---
>- Original Message - 
>From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: [PHP] Session Problem


> Can some one pl  explain what this means ...
> Warning: Cannot send session cache limiter - headers already sent 
> (output started at /Users/pgarcha/Sites/edit.php:7) in 
> /Users/pgarcha/Sites/edit.php on line 8

Take a look here for an explanation: http://www.php-faq.com/#3


--- End Message ---
--- Begin Message ---
how can i easily get the date of the last sunday. php or javascript code to
do this would be appreciated.



--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/function.strtotime.php
strtotime ("last Sunday");


Regards,
Daniel Kushner
_
Need hosting? http://thehostingcompany.us 


-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 10:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Get the date of the last sunday


how can i easily get the date of the last sunday. php or javascript code to
do this would be appreciated.



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



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


RDS> how can i easily get the date of the last sunday. php or javascript code to
RDS> do this would be appreciated.





Gladky Anton



   mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
I know this isn't a PHP question per se, but it does relate to PHP
development.

Every day I work with MySQL as my PHP database, I become more dissalusioned
with its ability as a database server. Yes its fast, but its mis

RE: [PHP] Problem with a for loop...

2003-01-16 Thread Matt Schroebel
> -Original Message-
> From: Davíð Örn Jóhannsson [mailto:[EMAIL PROTECTED]] 
> Sent: 16. janúar 2003 13:59
> Subject: RE: [PHP] Problem with a for loop...
> 
> I only want the last inserted row in the mysql database, and each time
> the script goes trough the loop it adds a new row into the 
> database ...

If you only want the most recent row, why read all of the roww in the table? Why not 
add a auto_increment column, or a timestamp, sorting on that column with a limit of 
0,1?

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




[PHP] Re: MIME email...

2003-01-16 Thread Manuel Lemos
Hello,

On 01/16/2003 11:37 AM, Brian McGarvie wrote:

Now... the problem I have is some people are reporting they get the
Multi-part stuff as the body... for others it'll work as wanted... i.e.
display Plaintext or render the HTML as wanted.

Anyone had this problem?


It looks like one of those bugs of mail() function that affect mail 
systems differently.

You may want to try this class that has workarounds for some of the 
mail() function bugs. It also makes it simple to compose 
multipart/alternative messages:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos


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



Re: [PHP] intermittent session loss

2003-01-16 Thread 1LT John W. Holmes
Is there any kind of load balancing on your server? If you watch the session
files in /tmp, are they getting erased?

---John Holmes...

- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 2:55 AM
Subject: [PHP] intermittent session loss


> Hi,
>
> I think I may have made some headway with my server problems.  I loaded
the
> site onto another account within the same machine, and I can't seem to
> replicate the "document contained no data" error at all.
>
> BUT I did notice that once I login (it says "you are logged in as justin"
> across the top of the screen), if I refresh the same page a few times, it
> will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click
> here to login"...
>
> The server does use trans-sid, but in my case, it's using cookies... the
> session doesn't get LOST (because it's "back" next time I refresh), but I
do
> appear to be "logged out" until I refresh again.
>
> VERY strange.
>
> To investigate further, I turned off cookies, and tried again... after 5
or
> so refreshes, I lost the session ID out of the URL.
>
>
> Whilst I can't repeat the problem on the original account, I have a
feeling
> these two issues are related.
>
>
> What's likely to cause this?
>
>
> Here's the Session section of phpinfo():
>
> --
> Session Support enabled
> Directive   Local Value Master Value
> session.auto_start  Off Off
> session.cache_expire180 180
> session.cache_limiter   nocache nocache
> session.cookie_domain   no valueno value
> session.cookie_lifetime 0   0
> session.cookie_path /   /
> session.cookie_secure   Off Off
> session.entropy_file/dev/urandom/dev/urandom
> session.entropy_length  256 256
> session.gc_maxlifetime  900 900
> session.gc_probability  1   1
> session.namePHPSID  PHPSID
> session.referer_check   no valueno value
> session.save_handlermm  mm
> session.save_path   /tmp/tmp
> session.serialize_handler   php php
> session.use_cookies On  On
> session.use_trans_sid   1   1
> --
>
> My LAN server's values (not compiled with trans-sid) are:
> --
> Session Support enabled
> Directive   Local Value Master Value
> session.auto_start  Off Off
> session.cache_expire180 180
> session.cache_limiter   nocache nocache
> session.cookie_domain   no valueno value
> session.cookie_lifetime 0   0
> session.cookie_path /   /
> session.cookie_secure   Off Off
> session.entropy_fileno valueno value
> session.entropy_length  0   0
> session.gc_maxlifetime  14401440
> session.gc_probability  1   1
> session.namePHPSESSID   PHPSESSID
> session.referer_check   no valueno value
> session.save_handlerfiles   files
> session.save_path   /tmp/tmp
> session.serialize_handler   php php
> session.use_cookies On  On
> --
>
> Biggest difference I can see (not that I really know what I'm looking for)
> is that locally, the save_handler is 'mm' (memory?), and on the server,
it's
> files.  And the entropy stuff, which I don't understand :)
>
>
> So, what could cause the session to drop (then kick back in again) by
simply
> refreshing the page a few times?
>
>
> Many thanks in advance,
>
> Justin French
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] File() function and require()

2003-01-16 Thread 1LT John W. Holmes
> OK, I have a file called page.php that has the following code in it
> (example but same layout and concept).
>
>
>  require("membercheck.php");
> ?>
> 
> 
> Page Title
> 
> 
> This is the text in the body of the page.
> 
> 
>
> The membercheck.php file contains a login form that is used if a session
> variable doesn't exist, i.e. the user is not logged in. What happens is
> when I run file() to read in the contents of page.php it reads in the code
> that is in the membercheck.php file, and never reads in any code that is
> in the page.php file. What I would need is a way to read in the contents
> of the page.php file without reading the membercheck.php file.
>
> Better explanation?

Yeah, kind of, but you should show your actual code. I have a feeling your
using a command like

file('http://www.yourdomain.com/page.php');

to read your data, instead of

file('/path/to/file/on/system/htdocs/page.php');

---John Holmes...


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




[PHP] system(): access denied

2003-01-16 Thread lastnumberone
Hello All, I have a script which uploads a mysqldump file into the server
and use system("mysql -uroot -p < the_dump_file.sql") to restore the
database. While, it does not go through and the apache error_log shows:

Enter password: Enter password: ERROR 1045: Access denied for user:
'root@localhost' (Using password: YES)

The passwords for mysql account "root" is "", but when I remove the -p from
the command, everything is fine.

The wired thing is, when I use system("mysqldump -uroot -p
>the_dump_file.sql"), it is also fine.

Anybody has experience of this? or any suggestions? Thanks a lot.



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




Re: [PHP] [phplib template] file does not exist

2003-01-16 Thread roel
Thank you, this helped me to find the problem. It seemed that i had to set
the $root variable in the templated class, although i never had to do this
on the other server, but it works now. Thanks!!


"Marek Kilimajer" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> First go to the file that generates the error and find out how it knows
> the template file does not exists
>
> roel wrote:
>
> > Hi,
> >
> >i'm having a problem. I just installed a webserver with mysql and php. I
> >copied my files that i had stored on another webserver to my new. I
didn't
> >change anything to these files and the files worked fine on the other
> >server.
> >
> >Now in this server i get this error with a template:
> >Template Error: filename: file ./templates/nav_left_body.tpl.php does
> >not exist.
> >Halted
> >
> >But that file does exist. I can see it through ftp an i can get to it via
> >http browser.
> >
> >What could be wrong? Could it be a config failure in my php.ini? Or in
> >httpd.conf? In case it is the config, what could it be?
> >
> >Thanks in advance!!
> >
> >
> >
> >
> >
>



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




[PHP] Warning: OCIFetchInto: ORA-01002: ????

2003-01-16 Thread ys_zhu
hello all:

XP+IIS5.1+PHP4.3+ORACLE9.2(client)

ERROR REPORT as follow:

Warning: OCIFetchInto: ORA-01002:  in C:\MyPHP\test.php on line 18
Error - no rows returned!


test.php:

ERROR - Could not connect to Oracle";
exit;
}
$sql = "Select count(*) from t1";
$stmt = OCIParse($conn, $sql);
if(!$stmt)

echo "ERROR - Could not parse SQL statement.";
exit;
}
OCIExecute($stmt);
OCIFetchInto($stmt, &$total_rows);
if ( !$total_rows[0] )

echo "Error - no rows returned!";
exit;
}
echo "There are $total_rows[0] results.\n";
echo "Now showing results $begin to $end.\n";
OCIFreeStatement($stmt);
?>

please help me, thanks!




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




Re: [PHP] system(): access denied

2003-01-16 Thread Marek Kilimajer
There is nothing wrong with it, with the -p switch, you specify you want 
to supply a password, but you don't give any, hence access denied

[EMAIL PROTECTED] wrote:

Hello All, I have a script which uploads a mysqldump file into the server
and use system("mysql -uroot -p < the_dump_file.sql") to restore the
database. While, it does not go through and the apache error_log shows:

Enter password: Enter password: ERROR 1045: Access denied for user:
'root@localhost' (Using password: YES)

The passwords for mysql account "root" is "", but when I remove the -p from
the command, everything is fine.

The wired thing is, when I use system("mysqldump -uroot -p
 

the_dump_file.sql"), it is also fine.
   


Anybody has experience of this? or any suggestions? Thanks a lot.



 



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




Re: [PHP] system(): access denied

2003-01-16 Thread lastnumberone
But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?
thanks
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> There is nothing wrong with it, with the -p switch, you specify you want
> to supply a password, but you don't give any, hence access denied
>
> [EMAIL PROTECTED] wrote:
>
> >Hello All, I have a script which uploads a mysqldump file into the server
> >and use system("mysql -uroot -p < the_dump_file.sql") to restore the
> >database. While, it does not go through and the apache error_log shows:
> >
> >Enter password: Enter password: ERROR 1045: Access denied for user:
> >'root@localhost' (Using password: YES)
> >
> >The passwords for mysql account "root" is "", but when I remove the -p
from
> >the command, everything is fine.
> >
> >The wired thing is, when I use system("mysqldump -uroot -p
> >
> >
> >>the_dump_file.sql"), it is also fine.
> >>
> >>
> >
> >Anybody has experience of this? or any suggestions? Thanks a lot.
> >
> >
> >
> >
> >
>



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




Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread Khalid El-Kary
leave PHP, work with ASP .NET and let Microsoft gain more domination and say 
bye bye for your freedom, then let develpment go and work as a machine that 
does like Microsoft wants

oh, i forgot, remember to submit ASP .NET bug reports to their site, to get 
a reply after 5 months :)

Open-Source Regards,
Khalid Al-Kary





_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] Re: Php's future with Asp .NET?

2003-01-16 Thread Maxim Maletsky

"Brian McGarvie" <[EMAIL PROTECTED]> wrote... :

> The 'problem' with ASP is that it really requires a Windows platform... 

Depends where. C# has a Linux platform called `mono'. It is not as good
as MS' native enviroment, but can work.

> and
> while Unix is still primarily the OS of choice for web-servers then ASP &
> PHP will 'co-exist' there will always be a PHP and ASP camp... 

Microsoft now works hard on porting their applicaytions to Linux
enviroment. Guess why? Because Linux is a better server for web while
ASP has some tricks that many would like to pay and use. At that point
MS decided to also work on Linux.

> I have very little ASP experiance, but that has cost me the oppertinity to
> apply for several well-paying jobs, as there is very few PHP positions
> around - I'm speaking for the UK market here.

Not that few, even in UK (as far as I know).


--
Maxim Maletsky
[EMAIL PROTECTED]



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




RE: RE: [PHP] Problems with require() and variables

2003-01-16 Thread Ford, Mike [LSS]
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2003 14:35
> To: [EMAIL PROTECTED]

Copying this back to the list, in case anyone else can contribute (although I think 
the attachments will be stripped -- can you make them available on a URL?).

> 
> Ok, there they are, but they are quite large in size, I warn you.
> 
> Basic concept is this:
> 
> view.php: It will require display.php
> display.php: It will open a file (profile.xml), perform xml 
> parsing into a
> 3-dim array of content, $profileArray
> view.php: will parse contents of $profileArray and display 
> flagged profile
> set up by $profileArray[$index]

Yes, I understand (although no having used the XML functions, I can't vouvh for the 
validity of your parsing strategy!).

> 
> The problem is that $profileArray and $index both seem to vanish upon
> exiting the required code of display.php unless I store them 
> in a session
> variable.

Well, as you're using old-style $HTTP_SESSION_VARS session variables, these should act 
identically to any other variables in your script vis-a-vis the include file.  And I 
can't see any reason why your $profileArray shouldn't be exactly what you want it to 
be in view.php.  So, let's try a bit of simple debugging:  what do you see if you put

   echo 'var_dump=';
   var_dump($index, $profileArray[$index]);
   echo "\n";

as the very last bit of PHP in display.php, and the same in view.php immediately after 
the include statement (before the echo "4profileUserID...")?  You should get identical 
results (even if wrong ones!) -- if not, something *very* weird is happening.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] system(): access denied

2003-01-16 Thread Marek Kilimajer
I suppose because if you use

mysqldump -uroot -p 
But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?
thanks
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 

There is nothing wrong with it, with the -p switch, you specify you want
to supply a password, but you don't give any, hence access denied

[EMAIL PROTECTED] wrote:

   

Hello All, I have a script which uploads a mysqldump file into the server
and use system("mysql -uroot -p < the_dump_file.sql") to restore the
database. While, it does not go through and the apache error_log shows:

Enter password: Enter password: ERROR 1045: Access denied for user:
'root@localhost' (Using password: YES)

The passwords for mysql account "root" is "", but when I remove the -p
 

from
 

the command, everything is fine.

The wired thing is, when I use system("mysqldump -uroot -p


 

the_dump_file.sql"), it is also fine.


   

Anybody has experience of this? or any suggestions? Thanks a lot.





 




 



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




Re: [PHP] system(): access denied

2003-01-16 Thread lastnumberone
no, i use mysqldump -uroot -p > my_dump_file.sql
 it is not '<' but '>'


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I suppose because if you use
>
> mysqldump -uroot -p 
> the password is read from my_dump_file.sql
>
> [EMAIL PROTECTED] wrote:
>
> >But why it is ok when i use system("mysqldump -uroot -p
>my_dump_file.sql")?
> >thanks
> >"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>There is nothing wrong with it, with the -p switch, you specify you want
> >>to supply a password, but you don't give any, hence access denied
> >>
> >>[EMAIL PROTECTED] wrote:
> >>
> >>
> >>
> >>>Hello All, I have a script which uploads a mysqldump file into the
server
> >>>and use system("mysql -uroot -p < the_dump_file.sql") to restore the
> >>>database. While, it does not go through and the apache error_log shows:
> >>>
> >>>Enter password: Enter password: ERROR 1045: Access denied for user:
> >>>'root@localhost' (Using password: YES)
> >>>
> >>>The passwords for mysql account "root" is "", but when I remove the -p
> >>>
> >>>
> >from
> >
> >
> >>>the command, everything is fine.
> >>>
> >>>The wired thing is, when I use system("mysqldump -uroot -p
> >>>
> >>>
> >>>
> >>>
> the_dump_file.sql"), it is also fine.
> 
> 
> 
> 
> >>>Anybody has experience of this? or any suggestions? Thanks a lot.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
> >
>



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




[PHP] No constants being set. HUH?

2003-01-16 Thread Mako Shark
I just JUST installed PHP onto a new server (my
first--kinda scary, new foray) and my pre-defined
constants (HTTP_SERVER, SCRIPT_NAME, etc.) aren't
being set. Any ideas? What switch do I have to flick?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] intermittent session loss

2003-01-16 Thread Chris Shiflett
--- Justin French <[EMAIL PROTECTED]> wrote:
> I did notice that once I login (it says "you are
> logged in as justin" across the top of the screen),
> if I refresh the same page a few times, it will
> MOSTLY say "you are logged in as..." but
> OCCASIONALLY it says "click here to login"...

> What's likely to cause this?

As I'm sure you're aware, this type of session problem can
be difficult to resolve. :-)

I am assuming that you are not using any type of load
balancing? If you are, that's probably your answer.

Short of that, can you replicate this in Mozilla? The
reason I ask is that there is now a project on mozdev.org
for viewing the HTTP protocol
(http://livehttpheaders.mozdev.org/). Otherwise, if you
have a tool to view the HTTP transactions, use that. I am
particularly curious to see if the HTTP request fails to
include the cookie or URL variable (depending on which
method you are testing) for the instance when you lose
session.

If the browser is correctly identifying itself on each
request, the requests are going to the same server, and the
session file never vanishes, I can see no way you would
lose session like that.

If all else fails, try using a database for your session
store instead of /tmp to see if the behavior changes.

Good luck, and let us know what you find out.

Chris

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




Re: [PHP] system(): access denied

2003-01-16 Thread Chris Boget
> But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?

As alluded to by the last user (who got the command wrong), when you 
do:

system("mysql -uroot -p < the_dump_file.sql")

it doesn't know where the command ends and the input begins.  So what's
going on is that the command thinks that the password is coming from the
"the_dump_file.sql".  So while you think that is the data you are passing to
the "mysql" executable, the system call thinks it's what you are passing
to the "-p" option.

Try doing this instead and see if it doesn't work:

system( "cat the_dump_file.sql | mysql -uroot -p" );

Chris


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




Re: [PHP] system(): access denied

2003-01-16 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote:
> no, i use mysqldump -uroot -p > my_dump_file.sql
> it is not '<' but '>'

That syntax is fine, and it should prompt you for a
password.

My suggestion is to give the root account a password and
don't worry about all of this. I think I read that it is
currently empty, right? Just assign it a proper password,
and move on to the next problem. :-)

Chris

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




RE: [PHP] No constants being set. HUH?

2003-01-16 Thread Ford, Mike [LSS]
> -Original Message-
> From: Mako Shark [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2003 15:26
> To: [EMAIL PROTECTED]
> Subject: [PHP] No constants being set. HUH?
> 
> 
> I just JUST installed PHP onto a new server (my
> first--kinda scary, new foray) and my pre-defined
> constants (HTTP_SERVER, SCRIPT_NAME, etc.)

Not predefined constants, predefined *global variables* -- and there's the clue.

>  aren't
> being set. Any ideas? What switch do I have to flick?

Almost certainly register_globals -- but don't!  (Unless you have legacy code that 
must run asap.)  Much better to leave register_globals=Off and get used to using the 
superglobal arrays -- in this case, you will want (iirc) $_SERVER['HTTP_SERVER'] and 
$_SERVER['SCRIPT_NAME'].

For more on this topic, refer to the manula page on Predefined variables: 
http://www.php.net/manual/en/language.variables.predefined.php 

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: SPAM: Re: [PHP] intermittent session loss

2003-01-16 Thread Justin French
on 17/01/03 1:24 AM, 1LT John W. Holmes ([EMAIL PROTECTED]) wrote:

> Is there any kind of load balancing on your server?

It's a single server, so to the best of my knowledge, no.


> If you watch the session
> files in /tmp, are they getting erased?

No, because they reappear and page or two later.  I confirmed this with a
simple incrementing session counter, and the results were bizarre.  You
would expect the number to increase in sequence:

0,1,2,3,4,5,6,7,8,9,10...50

But instead, I got:

0,1,2,3,0,4,5,1,6,7,2,8,9,3,10,11,12,13,14,15,16,17,18,4

I can see two sessions in there... one that gets to 18, the other getting to
4.

Again, this is NOT a repeatable bug... right now, it just counted perfectly
up to 25 before I got bored... :)


Justin



> ---John Holmes...
> 
> - Original Message -
> From: "Justin French" <[EMAIL PROTECTED]>
> To: "php" <[EMAIL PROTECTED]>
> Sent: Thursday, January 16, 2003 2:55 AM
> Subject: [PHP] intermittent session loss
> 
> 
>> Hi,
>> 
>> I think I may have made some headway with my server problems.  I loaded
> the
>> site onto another account within the same machine, and I can't seem to
>> replicate the "document contained no data" error at all.
>> 
>> BUT I did notice that once I login (it says "you are logged in as justin"
>> across the top of the screen), if I refresh the same page a few times, it
>> will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click
>> here to login"...
>> 
>> The server does use trans-sid, but in my case, it's using cookies... the
>> session doesn't get LOST (because it's "back" next time I refresh), but I
> do
>> appear to be "logged out" until I refresh again.
>> 
>> VERY strange.
>> 
>> To investigate further, I turned off cookies, and tried again... after 5
> or
>> so refreshes, I lost the session ID out of the URL.
>> 
>> 
>> Whilst I can't repeat the problem on the original account, I have a
> feeling
>> these two issues are related.
>> 
>> 
>> What's likely to cause this?
>> 
>> 
>> Here's the Session section of phpinfo():
>> 
>> --
>> Session Support enabled
>> Directive   Local Value Master Value
>> session.auto_start  Off Off
>> session.cache_expire180 180
>> session.cache_limiter   nocache nocache
>> session.cookie_domain   no valueno value
>> session.cookie_lifetime 0   0
>> session.cookie_path /   /
>> session.cookie_secure   Off Off
>> session.entropy_file/dev/urandom/dev/urandom
>> session.entropy_length  256 256
>> session.gc_maxlifetime  900 900
>> session.gc_probability  1   1
>> session.namePHPSID  PHPSID
>> session.referer_check   no valueno value
>> session.save_handlermm  mm
>> session.save_path   /tmp/tmp
>> session.serialize_handler   php php
>> session.use_cookies On  On
>> session.use_trans_sid   1   1
>> --
>> 
>> My LAN server's values (not compiled with trans-sid) are:
>> --
>> Session Support enabled
>> Directive   Local Value Master Value
>> session.auto_start  Off Off
>> session.cache_expire180 180
>> session.cache_limiter   nocache nocache
>> session.cookie_domain   no valueno value
>> session.cookie_lifetime 0   0
>> session.cookie_path /   /
>> session.cookie_secure   Off Off
>> session.entropy_fileno valueno value
>> session.entropy_length  0   0
>> session.gc_maxlifetime  14401440
>> session.gc_probability  1   1
>> session.namePHPSESSID   PHPSESSID
>> session.referer_check   no valueno value
>> session.save_handlerfiles   files
>> session.save_path   /tmp/tmp
>> session.serialize_handler   php php
>> session.use_cookies On  On
>> --
>> 
>> Biggest difference I can see (not that I really know what I'm looking for)
>> is that locally, the save_handler is 'mm' (memory?), and on the server,
> it's
>> files.  And the entropy stuff, which I don't understand :)
>> 
>> 
>> So, what could cause the session to drop (then kick back in again) by
> simply
>> refreshing the page a few times?
>> 
>> 
>> Many thanks in advance,
>> 
>> Justin French
>> 
>> 
>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> ---
> [This E-mail scanned for viruses]
> 
> 


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




Re: [PHP] "document contained no data"

2003-01-16 Thread Justin French
on 16/01/03 11:59 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

> If the server crashes, it is definetly NOT fault of your scripts, the
> server/php should return errors when there is something wrong, not
> crash. Remember that on multithreaded server you are taking other
> requests down too. The server, php, some extenssion might have been
> miscompiled, wrong versions of libraries are used, there is a bug,
> anything. But you should not be able to take server down from a script
> language.
> Take a look at extenssions used, if any of them is unstable/experimental

Well, I know *I* aren't using any extensions that you wouldn't find in a
base install.

Thanks for the words of encouragement though :)

Justin




> Justin French wrote:
> 
>> Just as an update, the sysadmin definitely thinks it's my code... I'm not
>> convinced, but I'm faced with the task of finding out :)
>> 
>> 
>> 
>>> It appears your site is causing the webserver to segfault (crash), which is
>>> why nothing comes up some times - these crashes are logged in the main
>>> Apache
>>> logfile, which is why you saw nothing in your site logfile when this
>>> happened.
>>> I don't know exactly what is causing it to crash, but it is definately
>>> something in your PHP code.
>>> 
>>> 
>> 
>> I asked for a copy of the logfiles she talked about:
>> 
>> 
>> 
>>> [Wed Jan 15 08:23:32 2003] [notice] child pid 8153 exit signal Segmentation
>>> fault (11)
>>> [Wed Jan 15 08:34:57 2003] [notice] child pid 7702 exit signal Segmentation
>>> fault (11)
>>> [Wed Jan 15 08:34:58 2003] [notice] child pid 7366 exit signal Segmentation
>>> fault (11)
>>> [Wed Jan 15 08:34:59 2003] [notice] child pid 7511 exit signal Segmentation
>>> fault (11)
>>> [Wed Jan 15 08:35:00 2003] [notice] child pid 7512 exit signal Segmentation
>>> fault (11)
>>> 
>>> 
>>> 
>> 
>> Not very helpfull :)
>> 
>> 
>> As far as I can tell, the error I receive (basically a "document contained
>> no data" error) is the result of the server shitting itself because of
>> ANOTHER script on my site, that was accessed before it.
>> 
>> This makes debugging even worse, because I don't even know what script to
>> look in!
>> 
>> It could be in any include()'d file in my header or footer, or the guts of
>> any script on my site!!  Yay!!
>> 
>> 
>> The other possibility is that the crash occurs on the actual script I'm
>> calling, which IS a bit easier to debug... I think!
>> 
>> 
>> The sysadmin has pretty much ruled out memory leaks:
>> 
>> 
>> 
>>> I checked the httpd processes
>>> to see if any memory was leaking (if the memory usage climbs constantly,
>>> memory is being leaked), but it was all fine.
>>> 
>>> 
>> 
>> 
>> Has any one got any suggestions on how I might track down this bug, or
>> ascertain which script/include file is causing the server to segfault?
>> 
>> 
>> Justin
>> 
>> 
>> 
>> 
> 


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




Re: [PHP] system(): access denied

2003-01-16 Thread Adam Voigt




This is infact not the case, using the < operator does not make the mysqldump

program read that file and interpret the data in the file as the password, if you have

a proper password set and use the -p option (even with a < operator) it will still ask

you for a password.



On Thu, 2003-01-16 at 10:33, Chris Boget wrote:

> But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?



As alluded to by the last user (who got the command wrong), when you 

do:



system("mysql -uroot -p < the_dump_file.sql")



it doesn't know where the command ends and the input begins.  So what's

going on is that the command thinks that the password is coming from the

"the_dump_file.sql".  So while you think that is the data you are passing to

the "mysql" executable, the system call thinks it's what you are passing

to the "-p" option.



Try doing this instead and see if it doesn't work:



system( "cat the_dump_file.sql | mysql -uroot -p" );



Chris





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP] system(): access denied

2003-01-16 Thread Chris Shiflett
--- Chris Boget <[EMAIL PROTECTED]> wrote:
> system("mysql -uroot -p < the_dump_file.sql")
> 
> it doesn't know where the command ends and the input
> begins. So what's going on is that the command thinks
> that the password is coming from the "the_dump_file.sql".


It knows exactly where the command ends and the input
begins. It is the < symbol. :-)

Also, in your example (which strays from the poster's
example), the_dump_file.sql is simply executed by mysql
once you provide the password (which it prompts for). It
does not try to use it for the password as you seem to be
thinking.

Anyway, the reason the poster wrote it like this:

mysqldump -uroot -p > the_dump_file.sql

is so that the output of mysqldump (the dump file) is sent
to the_dump_file.sql rather than stdout.

Chris

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




[PHP] nl2br too?

2003-01-16 Thread Cesar Aracena
Hi all,

When I make a form in a web site for a visitor to send me some comments,
I use nl2br() to put things like line breaks and see what the visitor
wants me to see.

But what happens if I have a web form to input some text into a TEXT
cell in MySQL and want to retrieve it like I wrote it? Should I use
nl2br too? How should I use it and What's gonna end up stored in the DB?

Thanks in advance,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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




[PHP] experience in OOP & PHP combination needed

2003-01-16 Thread Hannes Smit
Hello,

I want to build an object oriented application and i don't know how to do
it. Should i store everything in class instances and let those object
communicate with each other? I think that would be the real OOP.
I need some articles, tutorials or just people with experience in building
OO-applications with PHP.

Please help!

Hannes Smit




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




Re: [PHP] intermittent session loss

2003-01-16 Thread Marek Kilimajer
Check the cookies you have stored in your browser. I once had similar 
problem, when I had 2 cookies of the same name set, but different in 
path, one had "/directory" the other one "/directory/"

Justin French wrote:

on 17/01/03 1:24 AM, 1LT John W. Holmes ([EMAIL PROTECTED]) wrote:

 

Is there any kind of load balancing on your server?
   


It's a single server, so to the best of my knowledge, no.


 

If you watch the session
files in /tmp, are they getting erased?
   


No, because they reappear and page or two later.  I confirmed this with a
simple incrementing session counter, and the results were bizarre.  You
would expect the number to increase in sequence:

0,1,2,3,4,5,6,7,8,9,10...50

But instead, I got:

0,1,2,3,0,4,5,1,6,7,2,8,9,3,10,11,12,13,14,15,16,17,18,4

I can see two sessions in there... one that gets to 18, the other getting to
4.

Again, this is NOT a repeatable bug... right now, it just counted perfectly
up to 25 before I got bored... :)


Justin



 

---John Holmes...

- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 2:55 AM
Subject: [PHP] intermittent session loss


   

Hi,

I think I may have made some headway with my server problems.  I loaded
 

the
   

site onto another account within the same machine, and I can't seem to
replicate the "document contained no data" error at all.

BUT I did notice that once I login (it says "you are logged in as justin"
across the top of the screen), if I refresh the same page a few times, it
will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click
here to login"...

The server does use trans-sid, but in my case, it's using cookies... the
session doesn't get LOST (because it's "back" next time I refresh), but I
 

do
   

appear to be "logged out" until I refresh again.

VERY strange.

To investigate further, I turned off cookies, and tried again... after 5
 

or
   

so refreshes, I lost the session ID out of the URL.


Whilst I can't repeat the problem on the original account, I have a
 

feeling
   

these two issues are related.


What's likely to cause this?


Here's the Session section of phpinfo():

--
Session Support enabled
Directive   Local Value Master Value
session.auto_start  Off Off
session.cache_expire180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_file/dev/urandom/dev/urandom
session.entropy_length  256 256
session.gc_maxlifetime  900 900
session.gc_probability  1   1
session.namePHPSID  PHPSID
session.referer_check   no valueno value
session.save_handlermm  mm
session.save_path   /tmp/tmp
session.serialize_handler   php php
session.use_cookies On  On
session.use_trans_sid   1   1
--

My LAN server's values (not compiled with trans-sid) are:
--
Session Support enabled
Directive   Local Value Master Value
session.auto_start  Off Off
session.cache_expire180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_fileno valueno value
session.entropy_length  0   0
session.gc_maxlifetime  14401440
session.gc_probability  1   1
session.namePHPSESSID   PHPSESSID
session.referer_check   no valueno value
session.save_handlerfiles   files
session.save_path   /tmp/tmp
session.serialize_handler   php php
session.use_cookies On  On
--

Biggest difference I can see (not that I really know what I'm looking for)
is that locally, the save_handler is 'mm' (memory?), and on the server,
 

it's
   

files.  And the entropy stuff, which I don't understand :)


So, what could cause the session to drop (then kick back in again) by
 

simply
   

refreshing the page a few times?


Many thanks in advance,

Justin French





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

 

---
[This E-mail scanned for viruses]


   



 



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




Re: [PHP] system(): access denied

2003-01-16 Thread Chris Boget
> > system("mysql -uroot -p < the_dump_file.sql")
> > it doesn't know where the command ends and the input
> > begins. So what's going on is that the command thinks
> > that the password is coming from the "the_dump_file.sql".
> It knows exactly where the command ends and the input
> begins. It is the < symbol. :-)

Ok, I wasn't sure.  It just seemed like it could go either way.
 
> Also, in your example (which strays from the poster's
> example), 

No.  They both do the same thing.  They take the data from
the .sql file and make mysql use it.

> once you provide the password (which it prompts for). It
> does not try to use it for the password as you seem to be
> thinking.

Again, it seemed like it could go either way. :p
 
> Anyway, the reason the poster wrote it like this:
> mysqldump -uroot -p > the_dump_file.sql
> is so that the output of mysqldump (the dump file) is sent
> to the_dump_file.sql rather than stdout.

Right.  And the problem the original poster had was getting 
mysql use that data that mysqldump dumped.  This is the
problmatic command:

system("mysql -uroot -p < the_dump_file.sql")

and that is the same thing as this:

system( "cat the_dump_file.sql | mysql -uroot -p" );

just doing it a different way.  It just clears up any kind of
ambiguity w/r/t what the "the_dump_file.sql" is being used
for.

Chris


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




Re: [PHP] nl2br too?

2003-01-16 Thread Chris Shiflett
--- Cesar Aracena <[EMAIL PROTECTED]> wrote:
> When I make a form in a web site for a visitor to
> send me some comments, I use nl2br() to put things
> like line breaks and see what the visitor wants me
> to see.
> 
> But what happens if I have a web form to input some
> text into a TEXT cell in MySQL and want to retrieve
> it like I wrote it?

My advice is to store in MySQL exactly what the user types.
This way, you can decide when you retrieve this data
whether you want to display it on a page (in which case you
would use nl2br) or display it in a text field for editing
(in which case you would leave the data raw).

Chris

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




Re: [PHP] "document contained no data"

2003-01-16 Thread Marek Kilimajer
Someone else might be, you just happened to request a page from the same 
server process

Justin French wrote:

on 16/01/03 11:59 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

 

If the server crashes, it is definetly NOT fault of your scripts, the
server/php should return errors when there is something wrong, not
crash. Remember that on multithreaded server you are taking other
requests down too. The server, php, some extenssion might have been
miscompiled, wrong versions of libraries are used, there is a bug,
anything. But you should not be able to take server down from a script
language.
Take a look at extenssions used, if any of them is unstable/experimental
   


Well, I know *I* aren't using any extensions that you wouldn't find in a
base install.

Thanks for the words of encouragement though :)

Justin




 

Justin French wrote:

   

Just as an update, the sysadmin definitely thinks it's my code... I'm not
convinced, but I'm faced with the task of finding out :)



 

It appears your site is causing the webserver to segfault (crash), which is
why nothing comes up some times - these crashes are logged in the main
Apache
logfile, which is why you saw nothing in your site logfile when this
happened.
I don't know exactly what is causing it to crash, but it is definately
something in your PHP code.


   

I asked for a copy of the logfiles she talked about:



 

[Wed Jan 15 08:23:32 2003] [notice] child pid 8153 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:57 2003] [notice] child pid 7702 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:58 2003] [notice] child pid 7366 exit signal Segmentation
fault (11)
[Wed Jan 15 08:34:59 2003] [notice] child pid 7511 exit signal Segmentation
fault (11)
[Wed Jan 15 08:35:00 2003] [notice] child pid 7512 exit signal Segmentation
fault (11)



   

Not very helpfull :)


As far as I can tell, the error I receive (basically a "document contained
no data" error) is the result of the server shitting itself because of
ANOTHER script on my site, that was accessed before it.

This makes debugging even worse, because I don't even know what script to
look in!

It could be in any include()'d file in my header or footer, or the guts of
any script on my site!!  Yay!!


The other possibility is that the crash occurs on the actual script I'm
calling, which IS a bit easier to debug... I think!


The sysadmin has pretty much ruled out memory leaks:



 

I checked the httpd processes
to see if any memory was leaking (if the memory usage climbs constantly,
memory is being leaked), but it was all fine.


   

Has any one got any suggestions on how I might track down this bug, or
ascertain which script/include file is causing the server to segfault?


Justin




 



 



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




Re: [PHP] Getting a dynamic IP address

2003-01-16 Thread Danny Shepherd
$_SERVER['SERVER_ADDR'] gives the address of the server running the php
script
$_SERVER['REMOTE_ADDR'] gives the client address or the proxy address. (be
careful here, storing a proxy's IP is next to useless)
$_SERVER[' HTTP_X_FORWARDED_FOR'] gives the client address if they're behind
a proxy (if this isn't set then they probably aren't behind a proxy so you
can use the remote_addr instead)

HTH

Danny.


- Original Message -
From: "Kyle Lampkin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 11:41 PM
Subject: [PHP] Getting a dynamic IP address


>Hello all,
> Newbie here I need to know if there is a way I can get my dynamic IP
> address for use in a php script?
> --
> Your favorite stores, helpful shopping tools and great gift ideas.
> Experience the convenience of buying online with Shop@Netscape!
> http://shopnow.netscape.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Redirecting

2003-01-16 Thread Denis L. Menezes
Hello friends.

I want ot redirect users to another page after successful login. Can someone please 
help me with the PHP code for redirecting? Or point me to some help page?

thanks
denis


[PHP] Re: Security in included PHP files

2003-01-16 Thread Philippe Saladin
> directly. My main question is if all of the code inside an included PHP
file
> is put inside one or more functions this should prevent anyone from
running
> any of that code by directly calling that PHP file correct? There is no
way
> for them to invoke a function just from a URL assuming I have no code at
all
> outside the functions.
Just a small tip : to be *sure* that no one runs directly my included files,
they begin with

if (basename($_ENV["SCRIPT_NAME"]) != 'index.php') {
 // redirection
}

So, even if the code is not in a function or class, I'm safe.
Am I wrong or do you think it could be ok?
Regards,
Philippe



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




Re: [PHP] Redirecting

2003-01-16 Thread Andrew Brampton
php.net/header
check out the examples

Andrew
- Original Message -
From: "Denis L. Menezes" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 4:21 PM
Subject: [PHP] Redirecting


Hello friends.

I want ot redirect users to another page after successful login. Can someone
please help me with the PHP code for redirecting? Or point me to some help
page?

thanks
denis


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




Re: [PHP] nl2br too?

2003-01-16 Thread gamin

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Cesar Aracena <[EMAIL PROTECTED]> wrote:
> > When I make a form in a web site for a visitor to
> > send me some comments, I use nl2br() to put things
> > like line breaks and see what the visitor wants me
> > to see.
> >
> > But what happens if I have a web form to input some
> > text into a TEXT cell in MySQL and want to retrieve
> > it like I wrote it?
>
> My advice is to store in MySQL exactly what the user types.
> This way, you can decide when you retrieve this data
> whether you want to display it on a page (in which case you
> would use nl2br) or display it in a text field for editing
> (in which case you would leave the data raw).
>
> Chris

Condier using mysql_escape_string() before inserting into your table to
protect your database server from simple attacks

g



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




Re: [PHP] Redirecting

2003-01-16 Thread Chris Shiflett
--- "Denis L. Menezes" <[EMAIL PROTECTED]> wrote:
> I want ot redirect users to another page after successful
> login. Can someone please help me with the PHP code for
> redirecting?

You have many options:

1. After a successful login, display the proper page to the
user instead of redirecting. This is my preference.
2. Use a Location header to cause a protocol-level
redirect. For example, header("Location:
http://www.google.com/";);
3. Use an HTML meta tag for redirecting.

Chris

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




[PHP] Ever complained about lousy PHP programmers?

2003-01-16 Thread Peter Hutnick
Well, here's your chance to criticize a newbie.

As an exercise in learning PHP I have written a rot-13 script.  It is at
http://hutnick.com/rot13/index.html?show_content=1 .

I'm soliciting comments on style, technique, etc.  Be brutal, but don't
get your feelings hurt if I don't take your comments as gospel. 
References will help me take comments to heart.

It will be easier on me if you send or CC comments to [EMAIL PROTECTED]

Thanks a million!

-Peter



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




Re: [PHP] Send email when some action

2003-01-16 Thread Miguel Brás
thx for the replies

Miguel
"Maxim Maletsky" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

mail() function @ http://php.net/mail


--
Maxim Maletsky
[EMAIL PROTECTED]



"Miguel Brás" <[EMAIL PROTECTED]> wrote... :

> Hi gents,
>
> i have a script to manage the registered users on my site.
> have also a table with id, name, uname, passwrd, email, datejoined, level
> and status
>
> my question is...
> it there any possibility to inform a member by mail that his (let'say)
> current status changed from inactive to active, or from active to
inactive?
> I mean, whenever a change occur on member's details, a mail is sent to him
> telling what was changed. Any posssibility?
>
> Miguel
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




[PHP] get the $email string

2003-01-16 Thread Miguel Brás
Hi,

i made a page to display some user details and then clicking on the user
name it goes to another page to send a mail via mail() function.

here is the line of the first page
name;
?>

when click on user name, it goes to the mail_active.php?[EMAIL PROTECTED]

on the mail_active.php page, how do I get the e-mail address to send?
I mean, the mail function is mail ("$to","$subject","$message","From:
$sender");
How can I take the $to string to be [EMAIL PROTECTED]?

Miguel



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




[PHP] Redirecting - here is the code

2003-01-16 Thread Denis L. Menezes
I tried. But I get an error as follows :

Warning: Cannot add header information - headers already sent by (output
started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in
/usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

My code is as follows:




Untitled Document




  

  Site
maintenance page\n";
 }
 $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators
where
  AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'";
  if ($result=mysql_query($sql)) {
   $numofrows=mysql_num_rows($result);
if ($numofrows==0){
 header("Location: http://www.php-faq.com/";);
Print "We are
sorry.";
}
  if ($numofrows==1){
 Print "Welcome
".$AdminFirstName."";
}
 if ($numofrows>1){
 Print "Something wrong";
 }
 while($row=mysql_fetch_array($result)){
 Print"$row[AdminFirstName]";
 }

 }
 ?>
  





Unquote.

Line no. 30 is the one with the line : header("Location:
http://www.php-faq.com/";);

Can you please tell me what is wrong?

thanks
denis



Re: [PHP] Redirecting - here is the code

2003-01-16 Thread Jason Wong
On Friday 17 January 2003 01:07, Denis L. Menezes wrote:
> I tried. But I get an error as follows :
>
> Warning: Cannot add header information - headers already sent by (output

Try searching the archives on the above error.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Stenderup's Law:
The sooner you fall behind, the more time you will have to catch up.
*/


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




[PHP] Re: Images : Store in dB or disk?

2003-01-16 Thread Bobby Patel
With regards to Marek,
I don't see how there would be two queries, because there row conisists of
image properties and image data. So when i select the required row(s), I
will have properties and images. So it will be 1 query, of course it is a
big (size-wise) query.

With regards to Jason,
Your approach is reasonable. I guess I will have to judge for myself!



"Bobby Patel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I have the Images table setup with columns (width, height, size, type,
> etc...) the question is should I have the image data stored in this table
or
> disk?
>
> I know, alot of people have said it is faster in disk, which is 1 page
I/O.
> But I need these images for displaying product pages, and I believe that
it
> would be faster to just pluck the properties from the dB (including the
> image file) .
>
> Usually I will need to pull 6 or 10 images per page, this is my rational
for
> this situation:
>
> If all stored on db:
> One query  - will take about 4-5 page I/O (assumiing index on filename)
>
> If just properties stored on dB and image on disk:
> One query to grab the rows of properties - 2-3 page I/O
> to grab 6 or 10 images - 6 or 10 page I/O
> Total - 8 - 13 Page I/O's
>
> If all images stored on disk, no dB whatso ever:
> to grab 6 or 10 images - 6 or 10 page I/O
> cpu time to run getimagesize()  for each image - CPU time unknown?
>
> I assume that "page I/O" is that same as "disk access".
>
> I AGREE that storing images strored on disk is a valid approach PROVIDED
> that you only need 1 image per page, but if you need to grab a bunch at a
> time, I do beleieve that storing the actual file on the dB is faster.
>
> I would like to hear from the list, of people that have worked with images
> and PHP. I just started with images, so I just want to take the right
path.
>
>



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




RE: [PHP] Re: Images : Store in dB or disk?

2003-01-16 Thread Daniel Kushner
You must remember that Images are embedded in HTML using the  tag. Each
image displayed on a Webpage is a result of a seperate HTTP request to the
server; i.e. a PHP call in this case. Unless you are cache the SQL result,
at least one query is needed per image.

Regards,
Daniel Kushner
_
Need hosting? http://thehostingcompany.us


> -Original Message-
> From: Bobby Patel [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 16, 2003 12:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Images : Store in dB or disk?
>
>
> With regards to Marek,
> I don't see how there would be two queries, because there row conisists of
> image properties and image data. So when i select the required row(s), I
> will have properties and images. So it will be 1 query, of course it is a
> big (size-wise) query.
>
> With regards to Jason,
> Your approach is reasonable. I guess I will have to judge for myself!
>
>
>
> "Bobby Patel" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> > I have the Images table setup with columns (width, height, size, type,
> > etc...) the question is should I have the image data stored in
> this table
> or
> > disk?
> >
> > I know, alot of people have said it is faster in disk, which is 1 page
> I/O.
> > But I need these images for displaying product pages, and I believe that
> it
> > would be faster to just pluck the properties from the dB (including the
> > image file) .
> >
> > Usually I will need to pull 6 or 10 images per page, this is my rational
> for
> > this situation:
> >
> > If all stored on db:
> > One query  - will take about 4-5 page I/O (assumiing index on filename)
> >
> > If just properties stored on dB and image on disk:
> > One query to grab the rows of properties - 2-3 page I/O
> > to grab 6 or 10 images - 6 or 10 page I/O
> > Total - 8 - 13 Page I/O's
> >
> > If all images stored on disk, no dB whatso ever:
> > to grab 6 or 10 images - 6 or 10 page I/O
> > cpu time to run getimagesize()  for each image - CPU time unknown?
> >
> > I assume that "page I/O" is that same as "disk access".
> >
> > I AGREE that storing images strored on disk is a valid approach PROVIDED
> > that you only need 1 image per page, but if you need to grab a
> bunch at a
> > time, I do beleieve that storing the actual file on the dB is faster.
> >
> > I would like to hear from the list, of people that have worked
> with images
> > and PHP. I just started with images, so I just want to take the right
> path.
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Strange behavior on backtick operator execution environment

2003-01-16 Thread Marc Cluet
Hi guys
I have upgraded from PHP 4.2.2 to PHP 4.3.0 and some of my php script 
got broken due to that.
This scripts use backticks to execute functions, the problem is the 
environment where that functions are executed.

I have this test code:

$dir=`pwd`;
echo "I am on directory: $dir";
?>

If I execute this code using PHP 4.2.2 I get this result:

root@test:/root# php /var/www/html/test.php
I am on directory: /var/www/html

If I execute this code using PHP 4.3.0 I get this different result:
root@test:/root# php /var/www/html/test.php
I am on directory: /root

I have not touched php.ini from one version to the other (I'm still 
using my one), I'm with safe_mode = Off so it should not affect this.

Anybody have a clue about if this is a bug or is a feature of the new 
version? I'm really confused about it.

Best Regards



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



Re: [PHP] Redirecting - here is the code

2003-01-16 Thread Denis L. Menezes
I ahve tried everything jason. It says that there should be no output before
the header().

I cannot still find the error. Can you please help in locating the error?

thanks
Denis
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 1:10 AM
Subject: Re: [PHP] Redirecting - here is the code


> On Friday 17 January 2003 01:07, Denis L. Menezes wrote:
> > I tried. But I get an error as follows :
> >
> > Warning: Cannot add header information - headers already sent by (output
>
> Try searching the archives on the above error.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Stenderup's Law:
> The sooner you fall behind, the more time you will have to catch up.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] imageCreate() error

2003-01-16 Thread Ed
I'm running PHP 4.3 and W2k with IIS 5.0.  I have enabled php_gd and it does
show up when I do a phpinfo.  The php_gd.dll is in the winnt/system32
directory (I've also tried it in almost every other directory too) and I get
these error messages:

Cannot add header information - headers already sent by (output started at
C:\Inetpub\wwwroot\template\index.php:1) in
C:\Inetpub\wwwroot\template\index.php on line 3

Fatal error:  Call to undefined function:  imagecreate() in
C:\Inetpub\wwwroot\template\index.php on line 4

Here's the code:

Any help would be appreciated.



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




Re: [PHP] Redirecting - here is the code

2003-01-16 Thread Mike Morton
You cannot have ANY output b4 sending a header unless you are buffering your
output.  In your example you are sending HTML before your redirect - the
redirect has to happen before you do any kind of HTML or any characters that
would get output to the browser.

On 1/16/03 12:40 PM, "Denis L. Menezes" <[EMAIL PROTECTED]> wrote:

> I ahve tried everything jason. It says that there should be no output before
> the header().
> 
> I cannot still find the error. Can you please help in locating the error?
> 
> thanks
> Denis
> - Original Message -
> From: "Jason Wong" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 17, 2003 1:10 AM
> Subject: Re: [PHP] Redirecting - here is the code
> 
> 
>> On Friday 17 January 2003 01:07, Denis L. Menezes wrote:
>>> I tried. But I get an error as follows :
>>> 
>>> Warning: Cannot add header information - headers already sent by (output
>> 
>> Try searching the archives on the above error.
>> 
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.biz
>> Open Source Software Systems Integrators
>> * Web Design & Hosting * Internet & Intranet Applications Development *
>> 
>> /*
>> Stenderup's Law:
>> The sooner you fall behind, the more time you will have to catch up.
>> */
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


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




Re: [PHP] Redirecting - here is the code

2003-01-16 Thread Joci
Hi!

>From manual (http://www.php.net/manual/en/function.header.php):
Remember that header() must be called before any actual output is sent,
either by normal HTML tags, blank linek in a file, or from PHP.
You need to start with header()...

Example:
http://www.example.com/');
?>


or you can use ob_start and ob_end_flush();

Best Regards

- Original Message -
From: "Denis L. Menezes" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 6:07 PM
Subject: [PHP] Redirecting - here is the code


I tried. But I get an error as follows :

Warning: Cannot add header information - headers already sent by (output
started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in
/usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

My code is as follows:




Untitled Document




  

  Site
maintenance page\n";
 }
 $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators
where
  AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'";
  if ($result=mysql_query($sql)) {
   $numofrows=mysql_num_rows($result);
if ($numofrows==0){
 header("Location: http://www.php-faq.com/";);
Print "We are
sorry.";
}
  if ($numofrows==1){
 Print "Welcome
".$AdminFirstName."";
}
 if ($numofrows>1){
 Print "Something wrong";
 }
 while($row=mysql_fetch_array($result)){
 Print"$row[AdminFirstName]";
 }

 }
 ?>
  





Unquote.

Line no. 30 is the one with the line : header("Location:
http://www.php-faq.com/";);

Can you please tell me what is wrong?

thanks
denis



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




RE: [PHP] Redirecting - here is the code

2003-01-16 Thread Marios Adamantopoulos
I think your problem is with the  tag
 <--
header

Also I'm not sure but the 
might cause problems too

Try the if statement at the top of the document.

One more thing. I think that you can't add header info after , but I'm
not sure about this.

What I usually use for redirection is something like:
(a page after the LOGIN page that check for correct/incorrect logins)

top.location=\"cms_home.php\"

";
// IF NOT (you can display HTML here instead of redirecting)
} else {
echo"

top.location=\"cms_index.php\"

";
 }
?>  

I hope that helps

Mario
_
Marios Adamantopoulos
Senior Developer

Tonic
+44 (0)20 7691 2227
+44 (0)7970 428 372
www.tonic.co.uk

Recent projects
www.polydor.co.uk
www.adcecreative.org
www.sony-europe.com/pocketlife


Opinions, conclusions and other information in this message that do not
relate to the official business of Tonic Design Limited shall be
understood as neither given nor endorsed by them.




-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] 
Sent: 16 January 2003 17:07
To: PHP general list
Subject: [PHP] Redirecting - here is the code


I tried. But I get an error as follows :

Warning: Cannot add header information - headers already sent by (output
started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in
/usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

My code is as follows:

 
 Untitled Document   

  

  Site
maintenance page\n";
 }
 $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators
where
  AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'";
  if ($result=mysql_query($sql)) {
   $numofrows=mysql_num_rows($result);
if ($numofrows==0){
 header("Location: http://www.php-faq.com/";);
Print "We are
sorry.";
}
  if ($numofrows==1){
 Print "Welcome
".$AdminFirstName."";
}
 if ($numofrows>1){
 Print "Something wrong";
 }
 while($row=mysql_fetch_array($result)){
 Print"$row[AdminFirstName]";
 }

 }
 ?>
  





Unquote.

Line no. 30 is the one with the line : header("Location:
http://www.php-faq.com/";);

Can you please tell me what is wrong?

thanks
denis



Re: [PHP] Strange behavior on backtick operator execution environment

2003-01-16 Thread Jason Wong
On Friday 17 January 2003 01:37, Marc Cluet wrote:
> Hi guys
> I have upgraded from PHP 4.2.2 to PHP 4.3.0 and some of my php script
> got broken due to that.
> This scripts use backticks to execute functions, the problem is the
> environment where that functions are executed.
>
> I have this test code:
>  $dir=`pwd`;
> echo "I am on directory: $dir";
> ?>
>
> If I execute this code using PHP 4.2.2 I get this result:
>
> root@test:/root# php /var/www/html/test.php
> I am on directory: /var/www/html
>
> If I execute this code using PHP 4.3.0 I get this different result:
> root@test:/root# php /var/www/html/test.php
> I am on directory: /root
>
> I have not touched php.ini from one version to the other (I'm still
> using my one), I'm with safe_mode = Off so it should not affect this.
>
> Anybody have a clue about if this is a bug or is a feature of the new
> version? I'm really confused about it.

You're probably using the CLI version of PHP (which is built by default 
starting with 4.3) as opposed to the earlier CGI versions.

  manual > "Using PHP from the command line" 

tells you the differences between CLI and CGI, one of them being "it does not 
change the working directory to that of the script".


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Can you buy friendship?  You not only can, you must.  It's the
only way to obtain friends.  Everything worthwhile has a price.
-- Robert J. Ringer
*/


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




RE: [PHP] Adding HTTP URL Code

2003-01-16 Thread ELLIOTT,KATHERINE A (HP-FtCollins,ex1)
Thanks for all your help with my URL code problem!

I have come up with a solution that seems to half work and I can't
figure out what I need to do to get it fully functional.  Given my
data string (text) from my database, this is what I do to replace the
URL text with a functioning link.  I am asking folks that, if they 
include a URL in their results to surround it by [] so that I can search
for the brackets.  This is what my text replace line looks like:

$data_str = eregi_replace ("(\[http://)([^]]*)", "\\0", $data_str);

So, if the URL is (for example) [http://www.cleanrun.com] (in plain text),
it will show up for viewing in my browser as http://www.cleanrun.com
but the URL associated with it will be that of the directory in the browser
"Location" (i.e. http://wrong.url.com/Test_Results).

I've tried all sorts of things with the call to eregi_replace but can't
figure out what is going on.

What the hec???  Can someone help?

Many thanks!!

Katherine Elliott

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 2:05 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Adding HTTP URL Code


On Thursday 09 January 2003 04:07, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) 
wrote:
> OK, so I've gotten NO responses to my query below so I
> thought I'd ask for something slightly different and see what
> I get.

With regards to your original query, the answer is in the archives. Try 
searching for something like "regex url" or "regex hyperlink" etc.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
NOTICE: alloc: /dev/null: filesystem full
*/


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

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




Re: [PHP] OOP

2003-01-16 Thread Jordan Elver
Thanks Greg,
I know a bit of PHP but the OOP is a bit harder to understand I think :)
I'll check out the PEAR classes.

Cheers,
Jordan

On Thursday 16 Jan 2003 12:25 am, Greg Beaver wrote:
> Hi Jordan,
>
> If you are doing this to learn PHP, that is great, keep plugging.  If you
> want to see working examples of the things you've described, there are a
> number of scripts out there, both in pear (pear.php.net) and at other
> repositories like phpbuilder.com and phpclasses.org.  You would benefit
> from examining how other authors have solved the same problems even if you
> are simply trying to learn php
>
> Take care,
> Greg

-- 
Jordan Elver
Statistics are like a lamp-post to a drunken man - more for leaning on than 
illumination. -- David Brent (The Office)


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




Re: [PHP] OOP

2003-01-16 Thread Jordan Elver
Thanks John,

> Inheriting would probably be the most modular.

I thought this would be the way to go. Ill need to read up on this.

> > I haven't found any clear examples of this kind of OOP, only the real
> > basics
> > (which I still need help with by the way :) ).
>
> Use google. Do some more studying before you try to tackle this, or look
> on phpclasses.org for some examples.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/

Nice work on php archittect by the way :)
Thanks again,
Jordan
-- 
Jordan Elver
The office is like an army, and I'm the field general. You're my footsoldiers 
and customer quality is the WAR!!! -- David Brent (The Office)


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




[PHP] Re: get the $email string

2003-01-16 Thread Rafael Rodrigo - NSI
I don't know how do you get this answer, but try this:
name;
?>

Rafael Rodrigo

> Hi,
>
> i made a page to display some user details and then clicking on the user
> name it goes to another page to send a mail via mail() function.
>
> here is the line of the first page
>  color="#808080">name;
> ?>
>
> when click on user name, it goes to the mail_active.php?[EMAIL PROTECTED]
>
> on the mail_active.php page, how do I get the e-mail address to send?
> I mean, the mail function is mail ("$to","$subject","$message","From:
> $sender");
> How can I take the $to string to be [EMAIL PROTECTED]?
>
> Miguel
>
>



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




[PHP] Apache 2.0.43 and PHP 4.3.0 on Windows - Problems

2003-01-16 Thread Beauford.2002
Here we go again.

I installed Apache and it works fine, I then installed PHP and all tests
show it works fine - but when I try to get the PHP modules loaded for Apache
in httpd.conf, the Apache server won't start again. The only error I get is
a Windows error box that says "The requested operation has failed". The
event viewer shows:

The Apache service named reported the following error:
>>> Cannot load E:/Apache2/bin/php4apache.dll into server. The specified
module could not be found.

Well, the file(s) are in the appropriate place(s) as outlined in the PHP
install guide (below). So I'm at a loss as to where to go next. This is a
perfect testement as to why not to use Windows.I guess I am just a
sucker for punishment.
Any help is appreciated.

TIA

  Installing PHP for Apache as module
  ~~~

  Now that version 4.1 introduces a safer sapi module, we recommend
  that you configure PHP as a module in Apache.

  To accomplish this, you have to load the php4apache.dll in your
  Apache httpd.conf.

  !! NOTE !!
  Whereever you load php4apache.dll from, php4apache.dll also
  needs the php4ts.dll also included in the PHP4 distribution.
  php4apache.dll depends on php4ts.dll which is loaded as soon as
  Apache loads php4apache.dll. If php4ts.dll can't be found, you
  usually get an error like (also see the "Problems?" section at
  the end of the file):

Cannot load c:/php/sapi/php4apache.dll into server

  So where does php4ts.dll has to be to be properly loaded ?
  php4ts.dll is searched in the following order:

  1) in the directory where apache.exe is start from
  2) in the directory where php4apache.dll is loaded from
  3) in your %SYSTEMROOT%\System32, %SYSTEMROOT%\system and
 %SYSTEMROOT% directory.
 Note: %SYSTEMROOT%\System32 only applies to Windows NT/2000/XP)
  4) in your whole %PATH%

  Note: What is %SYSTEMROOT% ? Depending on your Windows
installation this may be for example c:\winnt or C:\windows

  Usually you would just copy it over to %SYSTEMROOT%\System32.
  But if you want to have multiple PHP installations (for
  whatever reason) this is a bad idea. For this circumstance the
  safest thing is to let php4ts.dll reside in the same directory
  where php4apache.dll is loaded from (see point 2 above).


  After you've set up the file layout properly, you're ready to
  finally configure Apache to load the PHP4 module. Just add the
  following lines to your httpd.conf:

   LoadModule php4_module c:/php/sapi/php4apache.dll
   AddModule mod_php4.c
   AddType application/x-httpd-php .php

  Note: Especially newer versions of Apache do not need the
AddModule directive anymore, your milage may vary.


  Where do I have to put the php.ini ?
   The php.ini files is only searched in two places:
   1) in your Apache installation directory (e.g. c:\apache\apache)
   2) in your %SYSTEMROOT% directory.



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




RE: [PHP] Re: get the $email string

2003-01-16 Thread Brian T. Allen
Hi,

If you have a URL like:
http://www.whatever.com/page.php?[EMAIL PROTECTED]

Then in your script $email will already be set to "[EMAIL PROTECTED]".

This depends on register_globals being on, if I remember correctly, and
you'll want to be aware of the order for variable assignment (for POST,
GET, cookie, and session variables).

Thanks,
Brian Allen


> -Original Message-
> From: Rafael Rodrigo - NSI [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 16, 2003 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: get the $email string
> 
> 
> I don't know how do you get this answer, but try this:
> name;
> ?>
> 
> Rafael Rodrigo
> 
> > Hi,
> >
> > i made a page to display some user details and then 
> clicking on the user
> > name it goes to another page to send a mail via mail() function.
> >
> > here is the line of the first page
> >  > color="#808080"> echo $row->name;
> > ?>
> >
> > when click on user name, it goes to the 
> mail_active.php?[EMAIL PROTECTED]
> >
> > on the mail_active.php page, how do I get the e-mail 
> address to send?
> > I mean, the mail function is mail 
> ("$to","$subject","$message","From:
> > $sender");
> > How can I take the $to string to be [EMAIL PROTECTED]?
> >
> > Miguel
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




[PHP] Re: Ever complained about lousy PHP programmers?

2003-01-16 Thread Leon Mergen

"Peter Hutnick" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm soliciting comments on style, technique, etc.  Be brutal, but don't
> get your feelings hurt if I don't take your comments as gospel.
> References will help me take comments to heart.

Heck, I don't have anything better to do at the moment anyway. All I can say
in first, I will not judge your style - it's all up to you.

Now, first of all, why did you this:

"); ?>

and not just:



? Less parsing for PHP :P

But other than that, I couldn't find anything very wrong about it... only
that I personally prefer to call a print() statement for everything, and
don't use PHP as an embedded language but just as a normal programming
language... But that's just me :P

Hope this helps you a little bit...

Regards,

Leon Mergen
http://www.antrophia.com/




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




[PHP] Any "Web Application Development Studio" available?

2003-01-16 Thread Steve Magruder
I realize that Zend produces a PHP development studio, but I'm looking for
something that helps the programmer use PHP (along with Javascript, CSS,
"web GUI" languages, etc.) to develop enterprise web _applications_ (like
for production data entry).  I'd also like this studio to make available a
set of UI widgets like that found in common Windows IDEs, and further make
it easy to utilize J2EE objects (including EJB's) within an application
design.  As an added bonus, I'd like something that produces apps that work
across many different "brands" of browsers, although that's probably not
absolutely necessary for my requirements.

Any ideas?

Regards,
  Steve



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




Re: [PHP] Re: Ever complained about lousy PHP programmers?

2003-01-16 Thread Peter Hutnick
Leon Mergen said:

> Now, first of all, why did you this:
>
> "); ?>
>
> and not just:
>
> 

Because short tags are evil ;-)  My provider has short tags enabled, so
there is no getting around this bit of ugliness.

> only that I personally prefer to call a print() statement for
> everything

Do you mean as opposed to echo?

If so, would you mind saying a few word as to why?

I read that echo is a "language construct."  It seems like it would be
preferable to print() for this reason.  On top of that, it will take
multiple strings as input.  I think I will remove the parentheses, though.

-Peter



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




[PHP] mail via php. 2 questions...

2003-01-16 Thread Øystein Håland
The first problem I cannot solve on my own:
I get the mail content from a cookie. Quite a big cookie since it is a
collection of 30 - 40 form values from another page. When recieving the
mail, the content come in ONE long string, and in some places with a \.
Of course, i dont want this to be printed (but I want the function, a line
break). So, how can I get a line break in my javascript cookie (yeah, I have
already tried \n).
The second problem:
I want the mail to be sent automatically when the visitor have filled in all
the forms in the document and goes to the next document.



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




[PHP] Passing Arrays Through Forms

2003-01-16 Thread @ Nilaab
Hello Everyone,

I've attempted this many times, but have failed to understand it each time.
I want to make it easier for myself to deal with passing variables through a
form. So I thought, why not use a single array variable to do that. If I do
such a thing, what steps do I need to take to ensure that the values in the
array are intact just as the user entered it? How do I serialize array data
from an initial form? Here's a simple example of what I might have:


   
   
   
   
   
   


Now, how do I ensure that the values in the associated array, that will be
sent over to some_page.php, are the values entered by the user? How do I
serialize this array from this form? Or if I cannot do that, what other
steps do I need to take to ensure the preservation of the values passed to
another page as an array?


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




[PHP] Imagecreatefromjpeg()

2003-01-16 Thread Sara Keesler
Hi,

  I've seen this bounced around on the archives a bit,
but none of the advice on there is working for me.
I'm trying to do something very simple:



  The file is in the folder, it has execute and write
permissions set, and the error given is "The image
cannot be displayed, because it contains errors.",
which is not very useful.  Anyone have any suggestions?

Thanks,
Sara Keesler


[PHP] Re: Fw: HTTP_REFERER work without a problem....

2003-01-16 Thread Joel Boonstra
On Wed, 15 Jan 2003, Kevin Stone wrote:
> Chris I appreciate your response but please read my post again.  I did not
> suggest using the IP for user identification.  I suggested using it as a
> temporary id.  I went on further to suggest to use sessions to identify
> individual users behind a proxy server.

But he also mentioned a round-robin proxy messing things up.  I've had
personal experience with IP addresses from AOL clients changing with
each new connection.  If your AOL users click through your site a few
times, it's possible that their IP address will change between those
clicks, thus making even a temporary id based on the IP address
unreliable, and perhaps frustrating if your site keeps 'forgetting'
things about the user.

Joel

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


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




RE: [PHP] Imagecreatefromjpeg()

2003-01-16 Thread Matt Schroebel
> 
>  Header("Content-type: image/jpeg");
> $im = ImageCreateFromJpeg('1234_1.jpg');
> ImageJpeg($im);?>
> 
>   The file is in the folder, it has execute and write
> permissions set, and the error given is "The image
> cannot be displayed, because it contains errors.",
> which is not very useful.  Anyone have any suggestions?

Comment out the header statement and see if gd tells you anything.

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




[PHP] List items in table with a hypertext link

2003-01-16 Thread Mike Tuller
I have been looking for an example of how to create a listing of items 
in a table where you have the first item in the list have a link so 
that when you click on it, it will open a page for editing the contents 
of that item. So for instance you have a list of employees, and you 
want to change their phone number you could go to the list and click on 
the employee id number and it would open a page where you can edit the 
employee information.

I haven't been able to find a good example of this, so if anyone knows 
where I could find one, please let me know.

Mike


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



[PHP] Set element closeness measure

2003-01-16 Thread typea
Give about 1 MILLION sets of 1 to ~20 integers such as:

(15, 42, 57, 314, 1024)

I need to be able to compare any two sets and determine if any of their
elements are within, say, 20 of each other.

Example:

(10, 100, 1000) CLOSETO (50, 150, 1050) ==> FALSE
(10, 100, 1000) CLOSETO (15, 150, 1050) ==> TRUE   [abs(15 - 10) < 20]
(10, 100, 1000) CLOSETO (115, 1050) ==> TRUE   [abs(115 - 110) < 20]

The sets are actually ordered sets, monotonicly increasing, if that helps.

Each set has another 36 bytes of associated data, of which 32 (two int4)
can be composed for a unique ID.  Or I could just assign an ID to each
one.

I could, of course, create a table of about 10 MILLION rows and be
searching through that...  But my gut says there should be an easier way.

I've look at the ~/contrib/array and even considered converting each set
to a built-in "path" datatype -- But neither of those seems to provide a
"any_vertex_near" function for comparing two objects.

Any ideas?...




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




[PHP] session_destroy have strange effect....

2003-01-16 Thread Scott Fletcher
session_destroy() do work when I logged out of the website.  But if I'm
logged in and open a 2nd browser and try to log in.  This where the script I
use to detect exisitng session and destroy it before generating a new one.
Problem is that session_destroy does not work on the 2nd browser...

So, my question is what is the workaround to using session_destroy() 
How do I unset it  Etc

I tried this one but it had no effect if I'm the 2nd user...

---

$_SESSION = array();
session_destroy();

---



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-16 Thread Scott Fletcher
IP address is not an effective solution.  Anyone can use a 2nd browser on
the same machine.  Also, if for a company with 1000 machine behind the
firewall, they all get one and the same IP address outside the firewall.


"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
00a701c2bcdd$316349a0$6601a8c0@kevin">news:00a701c2bcdd$316349a0$6601a8c0@kevin...
> You can never fully rely on any information given to you by the browser.
> You can't rely it being accurate or even being there at all.  What I
suggest
> to you is code a solution around the IP address.  The IP address of
course,
> like any information coming from the client, can be tampered with but more
> than likely it's not going to change while the user is browsing your
> website.  Right?  So you just use it as a temporary ID.  Log the IP to the
> database, track the IP's movements on your website, log those actions to a
> database.  That's the best way to do it without having to force the user
to
> login.  If you're concerned about people browsing from network IP then
code
> a solution using Sessions and track the session id.  And finally if you
need
> to know that a client has 'returned' to your website set a cookie on their
> computer.  I'm sure you'll find ways to elaborate from there.  You can do
> all of this without requiring the user to "login".
> -Kevin
>
> - Original Message -
> From: "Scott Fletcher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 2:07 PM
> Subject: Re: [PHP] HTTP_REFERER work without a problem
>
>
> > It's not a PHP bug.  Many PHP programmer tried to their best to use
> > HTTP_REFERER so they can keep track of which webpages on the current
> website
> > did the user last visited.  That way, they can keep out the unauthorized
> > access to the website without first logging in to the website.
> >
> > Well, my company's website use both SSL and Session ID.  They are good
for
> > starter but they aren't any secure if anyone can make a direct access
> > without logging in.  That's where I use HTTP_REFERER to see what last
page
> > did he or she visited, if the last page being visited is outside of my
> > company's website then php moved the end user to the login page.  It is
> > pretty effective.
> >
> > The common problem with the browsers is that they aren't compactible so
> > HTTP_REFERER don't alway work right and sometime return a blank if those
> > three are being used.  I had been observing it for a few years.  Those
> three
> > are  1) HierMenus, 2) location.replace('') and 3) location.href=''.
When
> > either one of these are in use, some browsers return with a blank in
> > HTTP_REFERER.
> >
> > Cheers
> >
> > "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > > Here's what I found so interesting
> > > >
> > > > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > > > problem when I use the latest Mozilla build. It even work
> > > > with the HierMenus,
> > > location.replace('http://whatever.com'),
> > > > and location.href = http://whatever.com...
> > > >
> > > > This is a good news for PHP everywhere.
> > > >
> > > > Unfortunately, Internet Explorer still have this
> > > > bug...
> > >
> > > What bug is that?
> > >
> > > Is there a question here somewhere? I think I am having a
> > > hard time interpreting it.
> > >
> > > Chris
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>



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




[PHP] Re: Security in included PHP files

2003-01-16 Thread Jacob Copsey
This should work as long as you are only including your include files from
scripts named index.php.

--Jacob


"Philippe Saladin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > directly. My main question is if all of the code inside an included PHP
> file
> > is put inside one or more functions this should prevent anyone from
> running
> > any of that code by directly calling that PHP file correct? There is no
> way
> > for them to invoke a function just from a URL assuming I have no code at
> all
> > outside the functions.
> Just a small tip : to be *sure* that no one runs directly my included
files,
> they begin with
>
> if (basename($_ENV["SCRIPT_NAME"]) != 'index.php') {
>  // redirection
> }
>
> So, even if the code is not in a function or class, I'm safe.
> Am I wrong or do you think it could be ok?
> Regards,
> Philippe
>
>



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




[PHP] Re: session_destroy have strange effect....

2003-01-16 Thread Scott Fletcher
Oh never mind.  I found a work around to it.  I can use the passthru
command.  Like this...

--clip--
passthru("rm -f /tmp/sess_*")
--clip--

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> session_destroy() do work when I logged out of the website.  But if I'm
> logged in and open a 2nd browser and try to log in.  This where the script
I
> use to detect exisitng session and destroy it before generating a new one.
> Problem is that session_destroy does not work on the 2nd browser...
>
> So, my question is what is the workaround to using session_destroy() 
> How do I unset it  Etc
>
> I tried this one but it had no effect if I'm the 2nd user...
>
> ---
>
> $_SESSION = array();
> session_destroy();
>
> ---
>
>



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




  1   2   >