Re: [PHP] class inside class

2003-01-13 Thread Hatem Ben
Assuming you have

class WebPage {
var $property1;
function get_property1()
{
return $this->$property1;
}
}


class Sample extends WebPage{
}

To access $property1 from your WebPage class just do

$page = new Sample;
$prop1 = $page->get_property1();

Otherwise try to send a snippets of code to see exactly what's you'r doing
:)

Regards,
Hatem

- Original Message -
From: "Michael Hall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 7:19 AM
Subject: [PHP] class inside class


> --
>
> G'day:
>
> I am using a 'wrapper' class to create all the boilerplate HTML on a
website,
> plus do stuff like authentication and print menus etc according to
properties
> set dynamically within the class.
>
> The actual content of each page is generated by seperate 'content'
classes.
> These classes are 'embedded' within and instantiated within the wrapper
class,
> but are otherwise independent of it.
>
> This system allows for something approaching a PHP "object publishing"
> application, which is where I'm heading.
>
> My problem is that now I need to get at the values of some wrapper class
> properties from within a content class: in other words, I need to access
the
> dynamically assigned values of the properties of one class, from inside
another
> class (which is embedded within the first, though I'm not sure that really
> matters).
>
> I can't use the $this-> mechanism because the value is inside a different
> class.
> I can't use the first class's handle (eg $page , from $page = new
WebPage())
> because the embedded class doesn't know about it.
> I have been playing around with declaring globals, and with PHP's
class/object
> functions, but have got nowhere yet.
>
>
> Is this possible, and if so, does anyone have any pointers? Hope my
description
> of the problem makes sense.
>
> TIA
> Mick
>
> 
> MICHAEL HALL Web Development Officer
> Batchelor Institute of Indigenous Tertiary Education
> W: [EMAIL PROTECTED](08) 8951 8352
> H: [EMAIL PROTECTED](08) 8953 1442
> 
>
> --
> 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] True type font errors . Help me

2003-01-13 Thread Breno Cardoso Perucchi
Hello,

I am one week recompiling source of php-4.2.3 to put support TTF
I am having problem with gd true type font .
I've been trying execute this php. But, always show me this error

Warning: Could not find/open font in
/usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php
on line 5
?PNG  IHDRj+¹¦ËPLTEÎÁ´Ï¿­ÊÈÈTÌÁ_%Y)IDATxocP"0(" ~"
"I×e¨Ä@º&cãQ]£ºFuê¢".*Y"â@uPIEND®B`,

This is my phpinfo
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with freetype

I found a webhosting that function my php.This is php configuration of
webhosting
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library

Thanks for help me.
Breno
[EMAIL PROTECTED]



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




Re: [PHP] True type font errors . Help me

2003-01-13 Thread Torsten Rosenberger
Hello

> Warning: Could not find/open font in
> /usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php
> on line 5

You must give the absolute path to your font dir 

for example /usr/home/hosting/b4u/fontsdir

BR/Torsten


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




[PHP] stupid question (Back Function)

2003-01-13 Thread Remon Redika
hi everyone, 

It's Possible We used Php Scripting to Back the client Browser
Like This Below :
(ussualy I make it with java script) : 

"javascript:history.back(1)" 

but right now, i need using the 'header's function', functionaly to back
the page to previouse page. 

sorry before :) 


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



RE: [PHP] stupid question (Back Function)

2003-01-13 Thread Sean Malloy
You could grab the referring page and send the user back to it, but some
proxies/software stop your browser from sending that information, so it
might not work in all situations

Back

however, quoting the docs on using the referrer:

This is set by the user agent (client browser). Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted.

-Original Message-
From: Remon Redika [mailto:[EMAIL PROTECTED]]
Sent: Monday, 13 January 2003 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] stupid question (Back Function)


hi everyone,

It's Possible We used Php Scripting to Back the client Browser
Like This Below :
(ussualy I make it with java script) :

"javascript:history.back(1)"

but right now, i need using the 'header's function', functionaly to back
the page to previouse page.

sorry before :)


--
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] "document contained no data"

2003-01-13 Thread Justin French
Hi gang,

I'm encountering a strange, random, sporadic error on a new server.
Basically, sometimes, in a non-repeatable fashion, a page will not load.

In NN7 Mac, the error is "the page contained no data".  In IE5.x Mac, the
error is along the lines of "host not found" or "could not access URL ...".

Until 5 minutes ago, I was pretty damn sure it was the host, and have been
complaining constantly for about a week, but I was just using some non-PHP
stuff on the server without any problems, which leads me to believe it may
be a problem with my code, or perhaps with a portion of the installation or
PHP, or a combination.

Problem is, this will be like finding a needle in a haystack.  For starters,
I can't repeat the problem on my server.  I also can't repeat the problem on
another server.  It's also random -- I can go a day without seeing the
error, and then get stuck with them for half an hour or more.  It's also on
any and every script, not just *a script* or *some scripts*.

I'm also not inclined to post any code, because the application is quite
large and complex, with many include files and modules.


I guess what I'm hoping for is some wild stabs in the dark as to what the
problem might be, and where I might start looking.


I have no idea where to start.  It seems to me that if it IS my code, it
must be something high up at the start of my scripts, in the include()'d
files.

The code does make a "persistent" connection to the DB in an auto-prepend
file at the beginning of each and every script:


The code also:

- (occasionally) makes use of header() redirects
- makes use of trans_sid for users without cookies (I have them enabled, so
pretty much rules that out), but I thought it was worth mentioning,
especially since this feature is unique to this server (my local test server
doesn't have it for example)
- inserts a row into the database for my statics/counters
- calls session_start();


Any ideas?


You're probably all laughing and shaking your head with a "no", but it's
worth a shot, I'm all out of ideas!!


Justin


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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-13 Thread Marek Kilimajer
This has been solved - the extra characters are stored in session,
otherwise attacker can repeat it too. Password can be stored on
the server using one way has - on the client the script hashes
twice, first to get hashed password, then together with random
string

Gerald Timothy Quimpo wrote:


On Saturday 11 January 2003 12:12 am, Scott Fletcher wrote:
 

The only thing that is important to me is that the password get 
encrypted before transmitting across the internet.
   


from other posts further in the thread it looks like you aren't
ready to use https.  that's too bad.  that would really be the
right solution.

but since you must hash, one problem with hashing is, it is still
necessary  to have the hash vary from one invocation to another.  
otherwise, if the hash is the same every time the user logs in
(i.e., if all you do is take the password and run it through md5), 
then anyone who can sniff the hash will be able to replay a login.

unfortunately, if you want the hash to be different from one
invocation to the next, then the password cannot be stored
on the server as a one-way hash.  instead, it would be either
plaintext or encrypted on the server.  this way, when you
want to send the hash over the internet, instead of just hashing
the password, you can generate a few extra characters.  append
(or prepend) the characters to the password.  then hash the
whole thing.

then, when you send the hash over, send the extra characters
too.  on the server side, you would then take the password from
the database (or wherever), decrypt it (if it's encrypted), append
or prepend the extra characters, hash the whole thing, and
compare the hashes.

tiger

 



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




Re: [PHP] occasional mcrypt problems

2003-01-13 Thread Marek Kilimajer
As you have magic_quotes on, automatically happens *addslashes*, now you
need to reverse the proces

Steve Yates wrote:


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 

try
$_POST['Credit_Card_Number']=stripslashes($_POST['Credit_Card_Number']);
   


   But if magic_quotes_gpc=on shouldn't that happen automatically?

- Steve Yates
- Brainstorm?  No, but I had a braindrizzle once.

~ Taglines by Taglinator - www.srtware.com ~



 



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




[PHP] Can I Copy a directory using PHP?

2003-01-13 Thread Alex Ciurea
Hello,

I want to write a script that makes a backup of a database directory.

Actually, to copy all database files to another directory.
I've figured that I have to use the "copy" function of the PHP, but the
function doesn't works only with files?



Is it possible to copy the entire directory to another location, using PHP?
I presume that is more "resource-friendly" than to copy the directory
file-by-file.


Thanks and best regards,
Alexoiul


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




Re: [PHP] Loading Information into an array.

2003-01-13 Thread Marek Kilimajer
while($img1=mysql_fetch_array($result)){
   $img2=mysql_fetch_array($result);
// now you have $img1 and $img2
echo "$img1[comment]$img2[comment]
}

Philip J. Newman wrote:

I have a table with images and comments.

if i have $x amout of images that each have a comment.

the comments are displayed in the center colum of the table with the images loading left and right of each comment.

http://www.philipnz.com/example.jpg

I can get the images to load in their left and right position, how ever i can't get the right array to print each comment with the image.

Any help would be cool.

Phil

 



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




RE: [PHP] Can I Copy a directory using PHP?

2003-01-13 Thread Timothy Hitchens \(HiTCHO\)
If you are using Unix simply call out the shell using back ticks `mv xxx
xxx` or check out.

http://www.php.net/manual/en/function.exec.php



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Alex Ciurea [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 7:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Can I Copy a directory using PHP?
> 
> 
> Hello,
> 
> I want to write a script that makes a backup of a database directory.
> 
> Actually, to copy all database files to another directory.
> I've figured that I have to use the "copy" function of the 
> PHP, but the function doesn't works only with files?
> 
> 
> 
> Is it possible to copy the entire directory to another 
> location, using PHP? I presume that is more 
> "resource-friendly" than to copy the directory file-by-file.
> 
> 
> Thanks and best regards,
> Alexoiul
> 
> 
> -- 
> 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] Session wierdness...

2003-01-13 Thread Duncan Abbott
I can't seem to be able to set a session var from within a function in an
include file

I have a call to a function at the top of my doc (but after session_start())
and if I write the line:
$_SESSION['userData'] = test1;
in the function body - it does nothing...

... but if I put this statement on the line above or below the call to the
function, it works

I've tried using session_register() instead but the same thing happens.
The block of code is definitely being executed.

Someone please please help me, I'm going insane. Thanks...



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




RE: [PHP] Session wierdness...

2003-01-13 Thread Timothy Hitchens \(HiTCHO\)
Do this for me:

print_r($GLOBALS);

and see if you have the $_SESSIONS array visible.. you will need to view
the output
in a text editor as the print_r won't look good rendered in the browser.


Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Duncan Abbott [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 1:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session wierdness...
> 
> 
> I can't seem to be able to set a session var from within a 
> function in an include file
> 
> I have a call to a function at the top of my doc (but after 
> session_start()) and if I write the line: 
> $_SESSION['userData'] = test1; in the function body - it does 
> nothing...
> 
>  but if I put this statement on the line above or below 
> the call to the function, it works
> 
> I've tried using session_register() instead but the same 
> thing happens. The block of code is definitely being executed.
> 
> Someone please please help me, I'm going insane. Thanks...
> 
> 
> 
> -- 
> 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] Can I Copy a directory using PHP?

2003-01-13 Thread rw
Careful!

use cp instead of mv

Quoting "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>:

### If you are using Unix simply call out the shell using back ticks `mv xxx
### xxx` or check out.
### 
### http://www.php.net/manual/en/function.exec.php
### 
### 
### 
### Timothy Hitchens (HiTCHO)
### Open Platform Consulting
### e-mail: [EMAIL PROTECTED]
### 
### > -Original Message-
### > From: Alex Ciurea [mailto:[EMAIL PROTECTED]] 
### > Sent: Monday, 13 January 2003 7:53 PM
### > To: [EMAIL PROTECTED]
### > Subject: [PHP] Can I Copy a directory using PHP?
### > 
### > 
### > Hello,
### > 
### > I want to write a script that makes a backup of a database directory.
### > 
### > Actually, to copy all database files to another directory.
### > I've figured that I have to use the "copy" function of the 
### > PHP, but the function doesn't works only with files?
### > 
### > 
### > 
### > Is it possible to copy the entire directory to another 
### > location, using PHP? I presume that is more 
### > "resource-friendly" than to copy the directory file-by-file.
### > 
### > 
### > Thanks and best regards,
### > Alexoiul
### > 
### > 
### > -- 
### > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] class inside class

2003-01-13 Thread @ Nilaab
If these two classes are in separate files then you will need to include one
of the classes in with the other class using the include() or require()
functions. Have you also used the extends keyword to extend the main class?
When you use inheritance properties, you can use the $this-> mechanism
within the classes to reference all functions of both classes. Read about
inheritance of classes for more information. If you already knew the above
and it doesn't help you, then just ignore it. I'm just trying to narrow down
your problem. Good luck.


> -Original Message-
> From: Michael Hall [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 12:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] class inside class
>
>
> --
>
> G'day:
>
> I am using a 'wrapper' class to create all the boilerplate HTML
> on a website,
> plus do stuff like authentication and print menus etc according
> to properties
> set dynamically within the class.
>
> The actual content of each page is generated by seperate
> 'content' classes.
> These classes are 'embedded' within and instantiated within the
> wrapper class,
> but are otherwise independent of it.
>
> This system allows for something approaching a PHP "object publishing"
> application, which is where I'm heading.
>
> My problem is that now I need to get at the values of some wrapper class
> properties from within a content class: in other words, I need to
> access the
> dynamically assigned values of the properties of one class, from
> inside another
> class (which is embedded within the first, though I'm not sure
> that really
> matters).
>
> I can't use the $this-> mechanism because the value is inside a different
> class.
> I can't use the first class's handle (eg $page , from $page = new
> WebPage())
> because the embedded class doesn't know about it.
> I have been playing around with declaring globals, and with PHP's
> class/object
> functions, but have got nowhere yet.
>
>
> Is this possible, and if so, does anyone have any pointers? Hope
> my description
> of the problem makes sense.
>
> TIA
> Mick
>
> 
> MICHAEL HALL Web Development Officer
> Batchelor Institute of Indigenous Tertiary Education
> W: [EMAIL PROTECTED](08) 8951 8352
> H: [EMAIL PROTECTED](08) 8953 1442
> 
>
> --
> 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] "document contained no data"

2003-01-13 Thread Marek Kilimajer
Couple things you can try:
- if you are using output buffer, try turning it off
- check other virtual hosts on the server when these problems occur
- if you have access to the logs, check them if the server is not dying

Justin French wrote:


Hi gang,

I'm encountering a strange, random, sporadic error on a new server.
Basically, sometimes, in a non-repeatable fashion, a page will not load.

In NN7 Mac, the error is "the page contained no data".  In IE5.x Mac, the
error is along the lines of "host not found" or "could not access URL ...".

Until 5 minutes ago, I was pretty damn sure it was the host, and have been
complaining constantly for about a week, but I was just using some non-PHP
stuff on the server without any problems, which leads me to believe it may
be a problem with my code, or perhaps with a portion of the installation or
PHP, or a combination.

Problem is, this will be like finding a needle in a haystack.  For starters,
I can't repeat the problem on my server.  I also can't repeat the problem on
another server.  It's also random -- I can go a day without seeing the
error, and then get stuck with them for half an hour or more.  It's also on
any and every script, not just *a script* or *some scripts*.

I'm also not inclined to post any code, because the application is quite
large and complex, with many include files and modules.


I guess what I'm hoping for is some wild stabs in the dark as to what the
problem might be, and where I might start looking.


I have no idea where to start.  It seems to me that if it IS my code, it
must be something high up at the start of my scripts, in the include()'d
files.

The code does make a "persistent" connection to the DB in an auto-prepend
file at the beginning of each and every script:

$db = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db("db_name",$db);
?>

The code also:

- (occasionally) makes use of header() redirects
- makes use of trans_sid for users without cookies (I have them enabled, so
pretty much rules that out), but I thought it was worth mentioning,
especially since this feature is unique to this server (my local test server
doesn't have it for example)
- inserts a row into the database for my statics/counters
- calls session_start();


Any ideas?


You're probably all laughing and shaking your head with a "no", but it's
worth a shot, I'm all out of ideas!!


Justin


 



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




[PHP] Session wierdness

2003-01-13 Thread Duncan Abbott
I can't seem to be able to set a session var from within a function in an
include file

I have a call to a function at the top of my doc (but after session_start())
and if I write the line:
$_SESSION['userData'] = test1;
in the function body - it does nothing...

... but if I put this statement on the line above or below the call to the
function, it works

I've tried using session_register() instead but the same thing happens.
The block of code is definitely being executed.

Someone please help me, I'm going insane. Thanks...



-- 
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-13 Thread Jason Wong
On Monday 13 January 2003 17:46, Justin French wrote:
> Hi gang,
>
> I'm encountering a strange, random, sporadic error on a new server.
> Basically, sometimes, in a non-repeatable fashion, a page will not load.
>
> In NN7 Mac, the error is "the page contained no data".  In IE5.x Mac, the
> error is along the lines of "host not found" or "could not access URL ...".

That looks like a network problem. Check the server logs to confirm whether a 
request was logged.

a) if the request is not logged then
  i) you have network problems OR
 ii) your webserver is severely ill

b) if in all cases, the request is logged but you get that error then you 
could try putting some simple code at the beginning of your page to confirm 
that the page _is_ being executed. Something like writing a line to a file.

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

/*
Success is relative: It is what we can make of the mess we have made of 
things.
-- T.S. Eliot, "The Family Reunion"
*/


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




[PHP] Windows - PHP.INI

2003-01-13 Thread Naqashzade, Sadeq
Hi,
I'm using Win2K Prof. and installed Apache 1.3.2 as my web server plus PHP
4.0.6 as module.
I have several sie on my computer. for one of them I need to include certain
file before any thing. I know that there is auto_prepend_file in php.ini but
this will run for all of my sites :-(
Is there any way?
I know that in Linux I must be able to use .httaccess but do not know how?
and in Windows I do not know at all.

Any one can help me?

Tnx
Sadeq



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




[PHP] pls help with session

2003-01-13 Thread James Tan
Dear Sir/Madam,

I've been coding session for quite sometime, but this is the first time i
encounter such problem...

index.php(login form) -> login.php (verifies and set session userkey=1) ->
main.php (check session userkey)
if check session userkey fail, gets redirected back to index.php

in the login.php page, i've tested out
session_is_registered("userkey");

it was TRUE.

but when i redirect it to main.php
and did a checking on session_is_registered("userkey");
it return FALSE...

i've session_start(); at every start of the php page...

what's wrong?
I've output session not set on main.php when the userkey session is not set.
when i click on back button and retry login, it works!!! what happened?

please check my code again...

==login.php==
include "lib/mysql.php";
include "lib/u007lib.php";

// connecting to mysql db , my own lib...
$rs = getdb("");
$rs->query("select * from ct_user where companyid like '" .
$HTTP_POST_VARS["companyid"] .  "'");
$rs2 = getdb("");

$erron = "";

if(!$rs->eof)
{

// if company records found...
$rs2->query("select * from ct_login where loginid like '" .
$HTTP_POST_VARS["loginid"] . "' and userid=" . $rs->fields("id") . " and
pass like '" . $HTTP_POST_VARS["password"] . "'");

if(!$rs2->eof)
{
// if loginid and password match...

session_start();
// session key to be checked...
$userkey = $rs2->fields("lvl");

$userid = $rs2->fields("id");
$userloginid = $rs2->fields("loginid");

$usercomid = $rs->fields("id");
$usercompany = $rs->fields("company");
$usercompanyid = $rs->fields("companyid");

// registering session key
session_register("userkey");
session_register("usercomid");
session_register("usercompany");
session_register("usercompanyid");

session_register("userid");
session_register("userloginid");


setcookie("companyid", $HTTP_POST_VARS["companyid"], time()+(60*60*24*30));
setcookie("loginid", $HTTP_POST_VARS["loginid"], time()+(60*60*24*30));

//redirecting to main.php
//header("location: main.php"); exit();
if (session_is_registered("userkey")) { header("location: main.php");
return;  }
else { echo "session not set!"; } //  always return TRUE...

}
else
{
$erron = "Invalid User / Password";
}

}
else
{
$erron = "No Such Company ID";
}

?>
=end of login code

=beginning code of main.php=

==end of main.php code=



best regards,
--
James Tan
IT Technical Specialist

NextMove Technology Sdn. Bhd.
[EMAIL PROTECTED]
Tel: 03-5192 1366
Fax: 03-5192 1280
Lot 2-2, Jalan SU6A,
Persiaran Tengku Ampuan,
Lion Industrial Park, Section 22,
4 Shah Alam, Selangor D.E.



-- 
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-13 Thread Justin French
on 13/01/03 9:34 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

> Couple things you can try:
> - if you are using output buffer, try turning it off

nope, not using any ob :)

> - check other virtual hosts on the server when these problems occur

can't tell for sure... without constantly surfing a site for hours "hoping"
to get an error... I do, however, occasionally check other sites on the same
server (one using the same library of code), and haven't spotted a problem
yet.

> - if you have access to the logs, check them if the server is not dying

I have access to the logs, but it's a bit tricky -- I have to wait until I
spot an error, then download a 10+meg log, and try and find my request...
but I'll work on that next for sure.


Justin




> Justin French wrote:
> 
>> Hi gang,
>> 
>> I'm encountering a strange, random, sporadic error on a new server.
>> Basically, sometimes, in a non-repeatable fashion, a page will not load.
>> 
>> In NN7 Mac, the error is "the page contained no data".  In IE5.x Mac, the
>> error is along the lines of "host not found" or "could not access URL ...".
>> 
>> Until 5 minutes ago, I was pretty damn sure it was the host, and have been
>> complaining constantly for about a week, but I was just using some non-PHP
>> stuff on the server without any problems, which leads me to believe it may
>> be a problem with my code, or perhaps with a portion of the installation or
>> PHP, or a combination.
>> 
>> Problem is, this will be like finding a needle in a haystack.  For starters,
>> I can't repeat the problem on my server.  I also can't repeat the problem on
>> another server.  It's also random -- I can go a day without seeing the
>> error, and then get stuck with them for half an hour or more.  It's also on
>> any and every script, not just *a script* or *some scripts*.
>> 
>> I'm also not inclined to post any code, because the application is quite
>> large and complex, with many include files and modules.
>> 
>> 
>> I guess what I'm hoping for is some wild stabs in the dark as to what the
>> problem might be, and where I might start looking.
>> 
>> 
>> I have no idea where to start.  It seems to me that if it IS my code, it
>> must be something high up at the start of my scripts, in the include()'d
>> files.
>> 
>> The code does make a "persistent" connection to the DB in an auto-prepend
>> file at the beginning of each and every script:
>> > $db = mysql_connect($dbhost, $dbuser, $dbpass);
>> mysql_select_db("db_name",$db);
>> ?>
>> 
>> The code also:
>> 
>> - (occasionally) makes use of header() redirects
>> - makes use of trans_sid for users without cookies (I have them enabled, so
>> pretty much rules that out), but I thought it was worth mentioning,
>> especially since this feature is unique to this server (my local test server
>> doesn't have it for example)
>> - inserts a row into the database for my statics/counters
>> - calls session_start();
>> 
>> 
>> Any ideas?
>> 
>> 
>> You're probably all laughing and shaking your head with a "no", but it's
>> worth a shot, I'm all out of ideas!!
>> 
>> 
>> Justin
>> 
>> 
>> 
>> 
> 


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




[PHP] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
Hi all,

this is my situation:
I want to execute some comands using 'shell_exec':

$command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
/usr/dest_dir;cd /usr/dest_dir;ls -la");
echo "$command";

Actually, these commands:
1)ls -la /usr/dest_dir
2)cp -R /usr/source_dir/1.php /usr/dest_dir
3)cd /usr/dest_dir
4)ls -la

This is what I get:

total 8
drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
total 8
drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..

the first 3 lines, before the 'cp' command
the last 3 lines, after the 'cp' command.

As you can see, no changes.

I've looked in the logs of the apache webserver and i've found this line:

cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied

Note: source_dir and dest_dir are both owned by mysql

Another thing :

cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied

The path begin with a back tick . Is that normal?










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




Re: [PHP] pls help with session

2003-01-13 Thread Jason k Larson
It looks to me like you are losing the session id.
Try something along the lines of this for the redirect:

header("location: main.php?PHPSESSID=".Session_Id());

This could/should be being pushed via cookies, but it appears as though 
it is not.  The best way to troubleshoot is to print the before and 
after session ids, if they change, you are just creating new empty 
sessions, which should explain the lacking session variables.

HTH,
Jason k Larson


James Tan wrote:

Dear Sir/Madam,

I've been coding session for quite sometime, but this is the first time i
encounter such problem...

index.php(login form) -> login.php (verifies and set session userkey=1) ->
main.php (check session userkey)
if check session userkey fail, gets redirected back to index.php

in the login.php page, i've tested out
session_is_registered("userkey");

it was TRUE.

but when i redirect it to main.php
and did a checking on session_is_registered("userkey");
it return FALSE...

i've session_start(); at every start of the php page...

what's wrong?
I've output session not set on main.php when the userkey session is 
not set.
when i click on back button and retry login, it works!!! what happened?

please check my code again...

==login.php==
include "lib/mysql.php";
include "lib/u007lib.php";

// connecting to mysql db , my own lib...
$rs = getdb("");
$rs->query("select * from ct_user where companyid like '" .
$HTTP_POST_VARS["companyid"] .  "'");
$rs2 = getdb("");

$erron = "";

if(!$rs->eof)
{

// if company records found...
$rs2->query("select * from ct_login where loginid like '" .
$HTTP_POST_VARS["loginid"] . "' and userid=" . $rs->fields("id") . " and
pass like '" . $HTTP_POST_VARS["password"] . "'");

if(!$rs2->eof)
{
// if loginid and password match...

session_start();
// session key to be checked...
$userkey = $rs2->fields("lvl");

$userid = $rs2->fields("id");
$userloginid = $rs2->fields("loginid");

$usercomid = $rs->fields("id");
$usercompany = $rs->fields("company");
$usercompanyid = $rs->fields("companyid");

// registering session key
session_register("userkey");
session_register("usercomid");
session_register("usercompany");
session_register("usercompanyid");

session_register("userid");
session_register("userloginid");


setcookie("companyid", $HTTP_POST_VARS["companyid"], 
time()+(60*60*24*30));
setcookie("loginid", $HTTP_POST_VARS["loginid"], time()+(60*60*24*30));

//redirecting to main.php
//header("location: main.php"); exit();
if (session_is_registered("userkey")) { header("location: main.php");
return;  }
else { echo "session not set!"; } //  always return TRUE...

}
else
{
$erron = "Invalid User / Password";
}

}
else
{
$erron = "No Such Company ID";
}

?>
=end of login code

=beginning code of main.php=

==end of main.php code=



best regards,
--
James Tan
IT Technical Specialist

NextMove Technology Sdn. Bhd.
[EMAIL PROTECTED]
Tel: 03-5192 1366
Fax: 03-5192 1280
Lot 2-2, Jalan SU6A,
Persiaran Tengku Ampuan,
Lion Industrial Park, Section 22,
4 Shah Alam, Selangor D.E.


--
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-13 Thread Justin French
on 13/01/03 10:05 PM, Jason Wong ([EMAIL PROTECTED]) wrote:

> On Monday 13 January 2003 17:46, Justin French wrote:
>> Hi gang,
>> 
>> I'm encountering a strange, random, sporadic error on a new server.
>> Basically, sometimes, in a non-repeatable fashion, a page will not load.
>> 
>> In NN7 Mac, the error is "the page contained no data".  In IE5.x Mac, the
>> error is along the lines of "host not found" or "could not access URL ...".
> 
> That looks like a network problem. Check the server logs to confirm whether a
> request was logged.
> 
> a) if the request is not logged then
> i) you have network problems OR
> ii) your webserver is severely ill

This is harder than it sounds :)  because the error is so random and
intermittent, I might have to click around the site for a whole day before I
get the error... then I've gotta download a 10meg log file, and try and find
my request somewhere down the bottom.

> b) if in all cases, the request is logged but you get that error then you
> could try putting some simple code at the beginning of your page to confirm
> that the page _is_ being executed. Something like writing a line to a file.

Again, I'm not sure how I'd distinguish MY request from the others... given
that it might take a minute, or an hour, or a day for an error to occur... I
*wish* I could repeat the error reliably, so that I could get to the bottom
of it.

perhaps I could log page,date,time,IP address for a few days, then I could
at least find my IP in the log, and the rough time of the error...


Justin


-- 
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-13 Thread Marek Kilimajer



perhaps I could log page,date,time,IP address for a few days, then I could
at least find my IP in the log, and the rough time of the error...
 

Or log only requests from your IP.



Justin


 



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




RE: [PHP] class inside class

2003-01-13 Thread Michael Hall
Thankyou Nilaab and Hatem for the replies.

I can see that extending classes is probably the way to go. I was kind of 
aware of how it works, but didn't see it as an obvious solution. But looking 
at it more closely, I think I should be able to put most common stuff in a 
basic class. Different kinds of pages can then be created by extension classes
with one or two unique functions, and the rest inherited ... pretty obvious 
really :)

Mick


Quoting "@ Nilaab" <[EMAIL PROTECTED]>:

> If these two classes are in separate files then you will need to include
> one
> of the classes in with the other class using the include() or require()
> functions. Have you also used the extends keyword to extend the main class?
> When you use inheritance properties, you can use the $this-> mechanism
> within the classes to reference all functions of both classes. Read about
> inheritance of classes for more information. If you already knew the above
> and it doesn't help you, then just ignore it. I'm just trying to narrow
> down
> your problem. Good luck.
> 
> 
> > -Original Message-
> > From: Michael Hall [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 13, 2003 12:20 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] class inside class
> >
> >
> > --
> >
> > G'day:
> >
> > I am using a 'wrapper' class to create all the boilerplate HTML
> > on a website,
> > plus do stuff like authentication and print menus etc according
> > to properties
> > set dynamically within the class.
> >
> > The actual content of each page is generated by seperate
> > 'content' classes.
> > These classes are 'embedded' within and instantiated within the
> > wrapper class,
> > but are otherwise independent of it.
> >
> > This system allows for something approaching a PHP "object publishing"
> > application, which is where I'm heading.
> >
> > My problem is that now I need to get at the values of some wrapper class
> > properties from within a content class: in other words, I need to
> > access the
> > dynamically assigned values of the properties of one class, from
> > inside another
> > class (which is embedded within the first, though I'm not sure
> > that really
> > matters).
> >
> > I can't use the $this-> mechanism because the value is inside a different
> > class.
> > I can't use the first class's handle (eg $page , from $page = new
> > WebPage())
> > because the embedded class doesn't know about it.
> > I have been playing around with declaring globals, and with PHP's
> > class/object
> > functions, but have got nowhere yet.
> >
> >
> > Is this possible, and if so, does anyone have any pointers? Hope
> > my description
> > of the problem makes sense.
> >
> > TIA
> > Mick
> >
> > 
> > MICHAEL HALL Web Development Officer
> > Batchelor Institute of Indigenous Tertiary Education
> > W: [EMAIL PROTECTED](08) 8951 8352
> > H: [EMAIL PROTECTED](08) 8953 1442
> > 
> >
> > --
> > 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
> 



Michael Hall Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
Work: [EMAIL PROTECTED] (08) 8951 8352
Home: [EMAIL PROTECTED]  (08 8953 1442



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




[PHP] attachment problem

2003-01-13 Thread Lars Olsson
Hi all!

I'm writing a webmail application in PHP and most basic things are 
working now. However, I've recently run into a problem concerning mail 
attachments. This is the situation right now:

When the user opens a letter there are links to all attachments. The 
links looks like this:
http://www.lassoweb.nu/webmail/attachment.php/mailbox=INBOX&msguid=218&part=2

Mailbox is the mailbox name, msguid is the message number and part 
corresponds to the part of the letter that is an attachment. When the 
user clicks the link the attachment data is extracted from the message 
and displayed in the browser (if possible). This works nice, but here 
comes the problem. Since the document is named 'attachment.php', that's 
the name that comes up in the save box whenever the user tries to save 
the file. Iv'e tried setting the Content-Disposition header to tell the 
browser what to call the attachment, but to no avail. The browser still 
insists on calling all attachments 'attachment.php'!

I've been trying to figure this out for a couple of days now, but no 
luck yet. Perhaps someone out there have had the same problem (and 
solved it)?

I'm thankful for any hints


/Lars 'lasso' Olsson ([EMAIL PROTECTED])


PS. One solution might be to 'trick' the browser by creating a fake URL 
(like http://www.lassoweb.nu/webmail/void/bob.gif), but in order for 
this to work I need to tell Apache to send all requests to the 'void' 
directory to a single PHP file. Anyone knows how to set this up? DS.


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



Re: [PHP] Need some help in "exec"-attack

2003-01-13 Thread Jason Wong
On Monday 13 January 2003 19:53, Alex Ciurea wrote:
> Hi all,
>
> this is my situation:
> I want to execute some comands using 'shell_exec':
>
> $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
> /usr/dest_dir;cd /usr/dest_dir;ls -la");
> echo "$command";
>
> Actually, these commands:
> 1)ls -la /usr/dest_dir
> 2)cp -R /usr/source_dir/1.php /usr/dest_dir
> 3)cd /usr/dest_dir
> 4)ls -la
>
> This is what I get:
>
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
>
> the first 3 lines, before the 'cp' command
> the last 3 lines, after the 'cp' command.
>
> As you can see, no changes.
>
> I've looked in the logs of the apache webserver and i've found this line:
>
> cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
>
> Note: source_dir and dest_dir are both owned by mysql

Presumably you're trying to backup a mysql database. In a standard setup the 
database files are only accessible to the 'mysql' user. Your webserver, under 
normal circumstances, would not be able to access those files. Once you get 
over this hurdle, the second problem is that your destination directory is 
not writeable by any user other than mysql.

In short you're better off using mysqldump to backup your databases.

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

/*
"Consequences, Schmonsequences, as long as I'm rich."
-- "Ali Baba Bunny" [1957, Chuck Jones]
*/


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




RE: [PHP] attachment problem

2003-01-13 Thread Timothy Hitchens \(HiTCHO\)
So you have tried as per the manual:

header("Content-Disposition: attachment; filename=downloaded.pdf");

I use this all the time without issue.. do you have a shell that you can
use to "wget -S" and see if the correct headers are coming out??



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Lars Olsson [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 11:05 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] attachment problem
> 
> 
> Hi all!
> 
> I'm writing a webmail application in PHP and most basic things are 
> working now. However, I've recently run into a problem 
> concerning mail 
> attachments. This is the situation right now:
> 
> When the user opens a letter there are links to all attachments. The 
> links looks like this: 
> http://www.lassoweb.nu/webmail/attachment.php/mailbox=INBOX&ms
guid=218&part=2

Mailbox is the mailbox name, msguid is the message number and part 
corresponds to the part of the letter that is an attachment. When the 
user clicks the link the attachment data is extracted from the message 
and displayed in the browser (if possible). This works nice, but here 
comes the problem. Since the document is named 'attachment.php', that's 
the name that comes up in the save box whenever the user tries to save 
the file. Iv'e tried setting the Content-Disposition header to tell the 
browser what to call the attachment, but to no avail. The browser still 
insists on calling all attachments 'attachment.php'!

I've been trying to figure this out for a couple of days now, but no 
luck yet. Perhaps someone out there have had the same problem (and 
solved it)?

I'm thankful for any hints


/Lars 'lasso' Olsson ([EMAIL PROTECTED])


PS. One solution might be to 'trick' the browser by creating a fake URL 
(like http://www.lassoweb.nu/webmail/void/bob.gif), but in order for 
this to work I need to tell Apache to send all requests to the 'void' 
directory to a single PHP file. Anyone knows how to set this up? DS.


-- 
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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
Hi,

I think I've solved the problem

group owner of the dest_dir must be apache !!! 



- Original Message - 
From: "Alex Ciurea" <[EMAIL PROTECTED]>
To: "php mailing" <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 1:53 PM
Subject: [PHP] Need some help in "exec"-attack


> Hi all,
> 
> this is my situation:
> I want to execute some comands using 'shell_exec':
> 
> $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
> /usr/dest_dir;cd /usr/dest_dir;ls -la");
> echo "$command";
> 
> Actually, these commands:
> 1)ls -la /usr/dest_dir
> 2)cp -R /usr/source_dir/1.php /usr/dest_dir
> 3)cd /usr/dest_dir
> 4)ls -la
> 
> This is what I get:
> 
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> 
> the first 3 lines, before the 'cp' command
> the last 3 lines, after the 'cp' command.
> 
> As you can see, no changes.
> 
> I've looked in the logs of the apache webserver and i've found this line:
> 
> cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> 
> Note: source_dir and dest_dir are both owned by mysql
> 
> Another thing :
> 
> cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> 
> The path begin with a back tick . Is that normal?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
:( Yes I've realised that.

It seemed to me that is more efficient to make a copy of that files, rather
than a mysqldump.

but Yes, in order to access files of the mysql directory, I have to give to
the webserver all the rights, solution that I don't aproove, for security
reasons.





- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 3:08 PM
Subject: Re: [PHP] Need some help in "exec"-attack


> On Monday 13 January 2003 19:53, Alex Ciurea wrote:
> > Hi all,
> >
> > this is my situation:
> > I want to execute some comands using 'shell_exec':
> >
> > $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
> > /usr/dest_dir;cd /usr/dest_dir;ls -la");
> > echo "$command";
> >
> > Actually, these commands:
> > 1)ls -la /usr/dest_dir
> > 2)cp -R /usr/source_dir/1.php /usr/dest_dir
> > 3)cd /usr/dest_dir
> > 4)ls -la
> >
> > This is what I get:
> >
> > total 8
> > drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> > drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> > total 8
> > drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> > drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> >
> > the first 3 lines, before the 'cp' command
> > the last 3 lines, after the 'cp' command.
> >
> > As you can see, no changes.
> >
> > I've looked in the logs of the apache webserver and i've found this
line:
> >
> > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> >
> > Note: source_dir and dest_dir are both owned by mysql
>
> Presumably you're trying to backup a mysql database. In a standard setup
the
> database files are only accessible to the 'mysql' user. Your webserver,
under
> normal circumstances, would not be able to access those files. Once you
get
> over this hurdle, the second problem is that your destination directory is
> not writeable by any user other than mysql.
>
> In short you're better off using mysqldump to backup your databases.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> "Consequences, Schmonsequences, as long as I'm rich."
> -- "Ali Baba Bunny" [1957, Chuck Jones]
> */
>
>
> --
> 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] Need some help in "exec"-attack

2003-01-13 Thread Jason Wong
On Monday 13 January 2003 21:13, Alex Ciurea wrote:
> Hi,
>
> I think I've solved the problem
>
> group owner of the dest_dir must be apache !!!

NB if mysql is running whilst you're copying the files then you could end up 
with incorrect backups.

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

/*
Q:  How many marketing people does it take to change a lightbulb?
A:  I'll have to get back to you on that.
*/


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




php-general Digest 13 Jan 2003 13:27:33 -0000 Issue 1820

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

php-general Digest 13 Jan 2003 13:27:33 - Issue 1820

Topics (messages 131382 through 131431):

Free web-hosting
131382 by: Rambler

Does PHP's imap_utf7_en/decode compatible with Microsoft Outlook Express?
131383 by: Hunte Swee

php_network_getaddresses()
131384 by: Stanislav Skrypnik
131385 by: Jason Sheets

Re: Permission Denied
131386 by: Stephen
131387 by: Sean Malloy
131389 by: Timothy Hitchens \(HiTCHO\)

Re: php5 cvs
131388 by: daniel

Favorite Email validation routine?
131390 by: Peter Janett
131391 by: Manuel Lemos
131392 by: Justin French
131393 by: Justin French

Re: Pre-built CMS - Anyone recommend one?
131394 by: Jason Wong

class inside class
131395 by: Michael Hall
131400 by: Hatem Ben
131414 by: . Nilaab
131425 by: Michael Hall

Png Could not find/open font
131396 by: Breno Cardoso Perucchi
131397 by: Timothy Hitchens \(HiTCHO\)
131398 by: Jason k Larson

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

True type font errors . Help me
131401 by: Breno Cardoso Perucchi
131402 by: Torsten Rosenberger

stupid question (Back Function)
131403 by: Remon Redika
131404 by: Sean Malloy

"document contained no data"
131405 by: Justin French
131415 by: Marek Kilimajer
131417 by: Jason Wong
131420 by: Justin French
131423 by: Justin French
131424 by: Marek Kilimajer

Re: Encrypt in Javascript and Decrypt in PHP
131406 by: Marek Kilimajer

Re: occasional mcrypt problems
131407 by: Marek Kilimajer

Can I Copy a directory using PHP?
131408 by: Alex Ciurea
131410 by: Timothy Hitchens \(HiTCHO\)
131413 by: rw.xend.net

Re: Loading Information into an array.
131409 by: Marek Kilimajer

Session wierdness...
131411 by: Duncan Abbott
131412 by: Timothy Hitchens \(HiTCHO\)

Session wierdness
131416 by: Duncan Abbott

Windows - PHP.INI
131418 by: Naqashzade, Sadeq

pls help with session
131419 by: James Tan
131422 by: Jason k Larson

Need some help in "exec"-attack
131421 by: Alex Ciurea
131427 by: Jason Wong
131429 by: Alex Ciurea
131430 by: Alex Ciurea
131431 by: Jason Wong

attachment problem
131426 by: Lars Olsson
131428 by: Timothy Hitchens \(HiTCHO\)

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 ---
Hello everybody!
Can anybody advice me the best free web-hosting with PHP?
Thank you.


--- End Message ---
--- Begin Message ---
Hi all,

It seems true that php's imap_utf7_en/decode does not compatible with
microsoft outlook express.
We create imap folder(include chinese chars) using IMP, all it ok in IMP
problem, but when use OE
to connect to imap server, the folder can't be shown correctly. And vice
versa.

So my problem is what is wrong? PHP or Outlook Express?

Hunte
Thanks





--- End Message ---
--- Begin Message ---
Hi all,
I have the problem with this peace of code.
This code has to include file containing some Javascript functions.
http://mysite/";);
$javascript=PATH."inc/javascript_functions.js";
include ($javascript);
?>

When I run this I got message:

"Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in
name resolution in /physical/location/inc/my_file.php on line 5
Warning: Failed opening 'http://mysite/inc/javascript_functions.js' for
inclusion (include_path='.:/php/includes:/usr/share/php') in
/physical/location/inc/my_file.php on line 5"

I was trying to find info about php_network_getaddresses() but no luck.
Any help would be very appreciated.
Stas.



--- End Message ---
--- Begin Message ---
Include will evaluate the file as PHP code, that most likely is not what
you want it to do.  Take a look at file_get_contents(), manual page
available at http://www.php.net/manual/en/function.file-get-contents.

Jason

phpSun, 2003-01-12 at 19:36, Stanislav Skrypnik wrote:
> Hi all,
> I have the problem with this peace of code.
> This code has to include file containing some Javascript functions.
>  //my_file.php
> define ("PATH", "http://mysite/";);
> $javascript=PATH."inc/javascript_functions.js";
> include ($javascript);
> ?>
> 
> When I run this I got message:
> 
> "Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in
> name resolution in /physical/location/inc/my_file.php on line 5
> Warning: Failed opening 'http://mysite/inc/javascript_functions.js' for
> inclusion (include_path='.:/php/includes:/usr/share/php') in
> /physical/location/inc/my_file.php on line 5"
> 
> I was trying to find inf

RE: [PHP] Problem with Search Engine Friendly URLs under PHP & Windows XP

2003-01-13 Thread Ford, Mike [LSS]
> -Original Message-
> From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
> Sent: 11 January 2003 15:48
> 
> Jonathan Chum wrote:
> 
> >I'm following various tutorials online that uses the 
> PATH_INFO to do this,
> 
> As far as I know, this technique doesn't work under windows...

As far as I know it does, because I'm doing it!  (However, I *am* using
Windows NT4 and a rather old version of PHP.)

My Windows environment is a test-bed for a Sun Solaris environment using the
same version of PHP, and scripts transfer unchanged and work flawlessly in
both environments.

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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea

Oh, I get it Jason,

it's okay the idea of mysqldump


Now i see it's more efficient mysqldump rather than my stupid thought.


10x alot,
Alexoiul


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 3:27 PM
Subject: Re: [PHP] Need some help in "exec"-attack


> On Monday 13 January 2003 21:13, Alex Ciurea wrote:
> > Hi,
> >
> > I think I've solved the problem
> >
> > group owner of the dest_dir must be apache !!!
>
> NB if mysql is running whilst you're copying the files then you could end
up
> with incorrect backups.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Q: How many marketing people does it take to change a lightbulb?
> A: I'll have to get back to you on that.
> */
>
>
> --
> 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] stupid question (Back Function)

2003-01-13 Thread David T-G
Remon, et al --

...and then Remon Redika said...
% 
% hi everyone, 

Hi!


% 
% It's Possible We used Php Scripting to Back the client Browser

Well, yes and no.  There was just a new 'crumb' class released (see 

  http://www.phpclasses.org/browse.html/package/934.html

for more) which will let you track where you've been.  You can then put
up a 'back' link to your last page for the user, or otherwise direct it;
although the user's browser history will actually only be going forward,
you'll get the forward and back that you need.


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!




msg92769/pgp0.pgp
Description: PGP signature


Re: [PHP] session_destroy problem

2003-01-13 Thread Scott Fletcher
Let us know how it goes...  The unload event had been tried also.  The
javascript have been running for a while but the network communication is a
bit tricky, it haven't worked well.


"Víã Ãðã " <[EMAIL PROTECTED]> wrote in message
004701c2b90d$5de0c440$0700a8c0@sp">news:004701c2b90d$5de0c440$0700a8c0@sp...
> > Yes, the JavaScript code can run before the browser is closed but it
would
> > not be finish running because the browser closing had been executed.
> > Someone had tried it before and struggled with it.   But that is a good
> > advice, thanks for jumping in.
> I really doubt that browsers doesn't run the code that is in unload event
of
> the page because the window is closed. That would be a very bad thing.
Isn't
> it what the unload event is for? I mean to run code when the page is
> unloaded, it doesn't matter if the window is being closed or the user is
> going to another page. I think the browser should finish all the opened
> window's unload code and only after that close the application really.
> I made a quick test for it:
> 
> 
> 
> function wait(msec){
>  var enter_date = new Date();
>  var enter_time = enter_date.getTime();
>
>  var leave_date = new Date();
>  var leave_time = leave_date.getTime();
>
>  while (enter_time + msec > leave_time)
>  {
>   leave_date = new Date();
>   leave_time = leave_date.getTime();
>  }
>  alert('unload test');
> }
> 
> 
>
> 
>  unload test
> 
> 
> It works fine for me in ie6 and mozila 0.9.6, it shows the alert message
> after about 5 seconds.
>
> Arpi
>
>
>



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




RE: [PHP] Why T_error?

2003-01-13 Thread Ford, Mike [LSS]
> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED]]
> Sent: 10 January 2003 21:04
> 
> I, once I found out that register_globals isn't always one, 
> have always done HTTP variables as like $_SESSION for session 
> and $_POST for form vars through post. Why, if you have 
> register_globals off does it return T_error?

Why does *what* return T-error?

If this is an error message, please cut-and-paste the exact error message, and the 
relevant section of code indicating which line is the one on which the error occurs.

>  Should I jsut 
> replace my old ways with $HTTP_SESSION_VARS for sessions and 
> $HTTP_POST_VARS for posted form vars from now on or what?

Probably not.  The $_* versions are the newer ones, and you should use them if you 
have a recent enough version of PHP -- but if your PHP is older than 4.1.0 (in which 
case: why?), you will need to use the $HTTP_*_VARS versions.

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] SESSION variable to pass login ID

2003-01-13 Thread Ford, Mike [LSS]
> -Original Message-
> From: Nova [mailto:[EMAIL PROTECTED]]
> Sent: 12 January 2003 20:04
> 
> This statement doesnt look right to me.
> 
> if(isset($_POST['userid']) && isset($_POST['pword'])){
> $_SESSION['user'] = $_POST['userid'];
> $_SESSION['password'] = $_POST['pword'];
> }

Nowt wong wi' that!

> 
> the if should be:
> 
> if ((statement)&&(statement))

That's not true!  The syntax of "if" is:

  if (expression) statement;

and one possible expression is:

  expression && expression

so this is a valid if condition:

  if (expression && expression)

Now, you *may* need additional parentheses around the expressions if they
contain lower-priority operators than &&, but they are not required.

Also: a statement is *not* an expression, so the if condition can never
include statements!

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




[PHP] Re: Pre-built CMS - Anyone recommend one?

2003-01-13 Thread Tros
I use Ovidentia ( http://www.ovidentia.org ).
You can test it ( and others ) here:
http://www.opensourcecms.com/index.php

Tros

"Nick Wilson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I'm looking for a *free*, pre-built CMS with PHP/MySQL.
>
> I've looked at ezpublish but I'm having trouble installing.
>
> Criteria:
>
> *   Must have SE friendly urls (example.com/4/34/)
> *   Must allow different 'sections' for articles
> *   Must be easy to fix templates for the html/css
>
> Anyone make a recommendation?
>
> Many thanks...
>
> --
> Nick Wilson //  www.tioka.com
>
>
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-13 Thread Scott Fletcher
Yea, the hacker would guess a random number in html & javascript but the
hacker have no way of putting it into php on the server-side.  So, we get
two different random number and a invalid match.

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This has been solved - the extra characters are stored in session,
> otherwise attacker can repeat it too. Password can be stored on
> the server using one way has - on the client the script hashes
> twice, first to get hashed password, then together with random
> string
>
> Gerald Timothy Quimpo wrote:
>
> >On Saturday 11 January 2003 12:12 am, Scott Fletcher wrote:
> >
> >
> >>The only thing that is important to me is that the password get
> >>encrypted before transmitting across the internet.
> >>
> >>
> >
> >from other posts further in the thread it looks like you aren't
> >ready to use https.  that's too bad.  that would really be the
> >right solution.
> >
> >but since you must hash, one problem with hashing is, it is still
> >necessary  to have the hash vary from one invocation to another.
> >otherwise, if the hash is the same every time the user logs in
> >(i.e., if all you do is take the password and run it through md5),
> >then anyone who can sniff the hash will be able to replay a login.
> >
> >unfortunately, if you want the hash to be different from one
> >invocation to the next, then the password cannot be stored
> >on the server as a one-way hash.  instead, it would be either
> >plaintext or encrypted on the server.  this way, when you
> >want to send the hash over the internet, instead of just hashing
> >the password, you can generate a few extra characters.  append
> >(or prepend) the characters to the password.  then hash the
> >whole thing.
> >
> >then, when you send the hash over, send the extra characters
> >too.  on the server side, you would then take the password from
> >the database (or wherever), decrypt it (if it's encrypted), append
> >or prepend the extra characters, hash the whole thing, and
> >compare the hashes.
> >
> >tiger
> >
> >
> >
>



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




Re: [PHP] Re: Pre-built CMS - Anyone recommend one?

2003-01-13 Thread Kevin Myrick
I would recommend phpWebSite @
http://phpwebsite.appstate.edu . 

The newest version coming out is very promising, and
uses the PEAR libraries. It is XML compliant. Better
than the NUKE clones, etc.

Kevin Myrick
www.ultimatealchemy.com <- about to be phpWebSite
based.
www.techrebels.com <- phpWebSite based
--- Tros <[EMAIL PROTECTED]> wrote:
> I use Ovidentia ( http://www.ovidentia.org ).
> You can test it ( and others ) here:
> http://www.opensourcecms.com/index.php
> 
> Tros
> 
> "Nick Wilson" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> >
> > I'm looking for a *free*, pre-built CMS with
> PHP/MySQL.
> >
> > I've looked at ezpublish but I'm having trouble
> installing.
> >
> > Criteria:
> >
> > *   Must have SE friendly urls (example.com/4/34/)
> > *   Must allow different 'sections' for articles
> > *   Must be easy to fix templates for the html/css
> >
> > Anyone make a recommendation?
> >
> > Many thanks...
> >
> > --
> > Nick Wilson //  www.tioka.com
> >
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Kevin Myrick
/etc/KevX45
http://www.ultimatealchemy.com
[EMAIL PROTECTED]
"Screw you guys, I'm going home."-Eric Cartman, South Park
Ultimatealchemy Dotcom!

__
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] Re: Change Date

2003-01-13 Thread Chris Boget
> How can I find time stamp for example 125 next days. 

$oneDay = ( 60 * 60 * 24 );
$timeStamp = date( "U" ) + ( $oneDay * 125 );

> or 03:30 hours next?

$oneHour = ( 60 * 60 );
$timeStamp = date( "U" ) + ( $oneHour * 3.5 );

This is just one of the many different ways it can be done.

Chris


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




Re: [PHP] Sessions 'funny' and Zone Alarm Pro 3

2003-01-13 Thread Mike Mannakee
It does sound like you're right.  Like ZA is perhaps allowing the user's
request to go twice.  This is akin to people who double click on links
because that's what they're used to doing on windows icons.  However, it
seems a bit odd how it selects to do it.  It seems that if it did it twice
on every call, one would expect the count to go immediately to 2 rather than
start at one.  Or does the session only begin after that first item is
clicked?

Have you tested this on several machines?

Mike


"Neil Stirton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I've started developing a shopping cart and was just testing and found
> that I get strange results when Zone Alarm's Cookie Control is set to
> anything other than "Off".
>
> If anything, I would expect the shopping cart to forget its contents
> between pages but instead I am getting weird results.
>
>
> (I have many other files/classes being called from this test.php file)
>
> test.php
> 
> 
> 
>
>  // I include all my necessary files/functions (none of which require the
> session
> // to already be started)
>
> session_start();
> if ( !isset( $_SESSION[ 'cart' ] ) ) {
> $_SESSION[ 'cart' ] = new Cart();
> }
>
> ?>
>
> 
> 
>
>
>  $f_id = isset( $_POST[ 'f_id' ] ) ? $_POST[ 'f_id' ] : 1;
> $f_price = isset( $_POST[ 'f_price' ] ) ? $_POST[ 'f_price' ] : 0;
> $f_qty = isset( $_POST[ 'f_qty' ] ) ? $_POST[ 'f_qty' ] : 1;
> $f_desc = isset( $_POST[ 'f_desc' ] ) ? $_POST[ 'f_desc' ] : '';
>
> // Form action
> $f_act = isset( $_POST[ 'f_act' ] ) ? $_POST[ 'f_act' ] : '';
>
> if ( $f_act == 'add' ) {
> $_SESSION[ 'cart' ] -> add_item( $f_id, $f_qty, $f_desc, $f_price, '' );
> } elseif ( $f_act == 'remove' ) {
> $_SESSION[ 'cart' ] -> remove_item( $f_id );
> } elseif ( $f_act == 'update' ) {
> $_SESSION[ 'cart' ] -> update_item( $f_id, $f_qty, $f_price, false );
> } else {
> echo '';
> print_r ($_SESSION);
> echo '';
> }
>
> ?>
>
>
> 
> 
> Product = CD
> 
> 
> Qty:
> 
> 
> 
> 
>
>
>  echo '';
> print_r ($_SESSION);
> echo '';
>
> ?>
> 
> 
>
> --
>
> This script obviously calls itself (not sure if that is part of the
> problem?)
>
>
> Scenario (with ZA cookie control set to Medium)
> ---
>
> Leave the quantity set to 1 and click add, the session then shows that
there
> is one item in the cart.
>
> Click add again and there are 3 items in the cart.
> Click again and there are 5 items.
>
> If I now change the quantity to say 10, there will be 16 items (the 5 that
> were
> there a minute ago plus the 10 plus what appears to be the value that
> quantity
> was previously set to i.e. 1.
>
> Thus if I then go and set the quantity to 5, it will take the previous
value
> (10)
> plus the new value (5) and add it to the cart (16), giving 31.
>
>
> Turning ZA OFF and all works as expected.
>
> Since my cart is a serious of objects/arrays, I changed the following to
try
> and track
> down the problem.
>
> Changed:
> 
> session_start();
> if ( !isset( $_SESSION[ 'cart' ] ) ) {
> $_SESSION[ 'cart' ] = new Cart();
> }
>
> ?>
>
>
> To:
> ---
> session_start();
> if ( !isset( $_SESSION[ 'cart' ] ) ) {
> $_SESSION[ 'cart' ] = new Cart();
> $_SESSION[ 'count' ] = 0;
> }
>
> $_SESSION[ 'count' ]++;
> echo $_SESSION[ 'count' ];
> ?>
>
>
> The count variable was also going up in the same fashion as the cart items
> which makes me think that the page itself is being called several times
> before
> being displayed.
>
>
> I'm tearing my hair out here and I can't leave it as is and the cart has
to
> go into production and I can't have people buying 31 items when they
wanted
> 3 :)
>
> Anyone any suggestions at all.
>
>
> Regards,
>
> Neil Stiron
>



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




[PHP] session storage

2003-01-13 Thread Mat Harris
i am writing a shopping site for training (just out of interest).

When a user clicks "add to basket" i want to check whether an item with 
that id is already in my session ($ALCOHOLE["items"]), if so, redirect 
them the the view_cart page, if not then append it to the 
$ALCOHOLE["items"] array as $key => $value pairs.

I have played around with all sorts of loops and sorts all day but still 
cannot get it sorted. Can anyone suggest where I am going wrong or has 
anyone got a better method they would care to suggest?

cheers.


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



Re: [PHP] Windows - PHP.INI

2003-01-13 Thread John Nichel
.htaccess isn't a Linux only thing...it's an Apache thing.  Just put a 
file named .htaccess in the document root of the site you want to 
prepend the file too.  Inside the file, put this

php_value auto_prepend_file "/path/to/included/file.php"

Naqashzade, Sadeq wrote:
Hi,
I'm using Win2K Prof. and installed Apache 1.3.2 as my web server plus PHP
4.0.6 as module.
I have several sie on my computer. for one of them I need to include certain
file before any thing. I know that there is auto_prepend_file in php.ini but
this will run for all of my sites :-(
Is there any way?
I know that in Linux I must be able to use .httaccess but do not know how?
and in Windows I do not know at all.

Any one can help me?

Tnx
Sadeq






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


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




Re: [PHP] session storage

2003-01-13 Thread 1LT John W. Holmes
> i am writing a shopping site for training (just out of interest).
>
> When a user clicks "add to basket" i want to check whether an item with
> that id is already in my session ($ALCOHOLE["items"]), if so, redirect
> them the the view_cart page, if not then append it to the
> $ALCOHOLE["items"] array as $key => $value pairs.
>
> I have played around with all sorts of loops and sorts all day but still
> cannot get it sorted. Can anyone suggest where I am going wrong or has
> anyone got a better method they would care to suggest?

Couldn't you use in_array() on your $ALCOHOLE array so see if your "item" is
in it?

If it is, then use header() to redirect, or append the value.

What's the format of your "item" variable and maybe we can help more.

---John Holmes...


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




Re: [PHP] Re: Change Date

2003-01-13 Thread Jan Mikes



hope it'll help

.mtg.

- Original Message -
From: "Chris Boget" <[EMAIL PROTECTED]>
To: "Naqashzade, Sadeq" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 3:59 PM
Subject: Re: [PHP] Re: Change Date


> > How can I find time stamp for example 125 next days.
>
> $oneDay = ( 60 * 60 * 24 );
> $timeStamp = date( "U" ) + ( $oneDay * 125 );
>
> > or 03:30 hours next?
>
> $oneHour = ( 60 * 60 );
> $timeStamp = date( "U" ) + ( $oneHour * 3.5 );
>
> This is just one of the many different ways it can be done.
>
> 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




Re: [PHP] session_destroy problem

2003-01-13 Thread Tamas Arpad
On Monday 13 January 2003 15:14, Scott Fletcher wrote:
> Let us know how it goes...  The unload event had been tried also.  The
> javascript have been running for a while but the network communication is a
> bit tricky, it haven't worked well.
Sorry, maybe I missed or forgot the original problem. If I remember right the 
problem is that the session must be deleted if the visitor closes the 
browser. I think it can be done with the method that "ugly sex" sites use for 
opening ads when their window is closed.
An example:

I know it's not a 100% reliable sollution, but in javascript what is that?
This way you can make a request that'll destroy the session and sends 
javascript code that immediately closes the window.
It works for me in opera but not in mozilla :((
Maybe there's another sollution, the idea is to somehow send a a request when 
the onunload event happens (I'm sure you already knew this Scott). I tried to 
search in google for how to make http request but didn't find anything really 
useful in a few minutes, of course that doesn't mean that it can't work at 
all.
Good luck with it Larry!
Arpi

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




[PHP] form box question

2003-01-13 Thread Anthony Ritter
Hi,
I'm testing the following form on:

MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.

However...when I publish the

.php file

and the

data.txt file

on the ISP's MS IIS server, I get undeclared variables and indexes when the
form page loads.

The script follows.

Any help would be greatly appreciated.
Thank you.
Tony Ritter
.

// form.php




body {background-color:beige;
body
{
scrollbar-base-color: #FCF6DC;
scrollbar-face-color: #E3DBB5;
scrollbar-track-color: #FCF6DC;
scrollbar-arrow-color: #000;
scrollbar-highlight-color: #fff;
scrollbar-3dlight-color: #7B6D29;
scrollbar-shadow-color: #7B6D29;
scrollbar-darkshadow-color: #E3DBB5;
}
border:5px solid black;
}
textarea {border:1pt solid red;
  background-color:white;
  color:black;

  }

textarea p{font-size:12px;

  }

table {border:1pt solid black;
   width:700px;
   font-size:10px;
   background-color:#E3DBB5;
   color:#7B6D29;
   }


input {border:1pt solid solid red;
   background-color:white;
   color:black;}

.submit {
   background-color:#80;
   color:white;}

p {font-family:arial;
   font-size:12px;
  }

hr { color:#80;

}

A:link:{text-decoration:none; color:#7B6D29;}
A:visited:{text-decoration:none; color:#7B6D29;}
A:hover:{text-decoration:underline; color:green}




");

 print("Some of the messages have been:\n");

 $Data=file($TheFile);
  for($n=0; $n");

print("");
print("$getline[0]\n");
print("");
print("");
print("$getline[1]\n");
print("");
print("");
print("mailto:$getline[2]>$getline[2]\n");
print("");
print("");
print("");

  } //end for loop
 fclose($Open);

   } //end if
else
 {
  print("Unable to read data.txt");
 }
} //end function

function createform()
{

print("\n");
print("So...How did you like EagleFest 2003?:  \n");
print("Your name: \n");
print("Your e-mail: \n");
print("\n");
print("\n");
print("\n");

}

function handleform()
{
 global $comments;
 global $yourname;
 global $youremail;
 $comments=stripslashes($comments);
 $yourname=stripslashes($yourname);
 $youremail=stripslashes($youremail);
 $callfunction=WriteToFile($comments,$yourname,$youremail);
  if($callfunction)
   {

print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print("Thank you
for your comments about EagleFest 2003.");

   }//end if
  else
  {
   print("Your submission was not processed.");
  } //end else
}

if($beensubmitted)
 {
  handleform();
 }
else
{
createform();
ReadTheFile();
}
?>


...





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




Re: [PHP] session_destroy problem

2003-01-13 Thread Scott Fletcher
It's no problem.  We're all very interesting in finding out what can work.

Maybe I can help with one of this problem.  The Gecko browser does have the
option of blocking the opening of hte unrequest window which is maybe why
yours doesn't work in Mozilla.  Just wondeirng...


"Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Monday 13 January 2003 15:14, Scott Fletcher wrote:
> Let us know how it goes...  The unload event had been tried also.  The
> javascript have been running for a while but the network communication is
a
> bit tricky, it haven't worked well.
Sorry, maybe I missed or forgot the original problem. If I remember right
the
problem is that the session must be deleted if the visitor closes the
browser. I think it can be done with the method that "ugly sex" sites use
for
opening ads when their window is closed.
An example:

I know it's not a 100% reliable sollution, but in javascript what is that?
This way you can make a request that'll destroy the session and sends
javascript code that immediately closes the window.
It works for me in opera but not in mozilla :((
Maybe there's another sollution, the idea is to somehow send a a request
when
the onunload event happens (I'm sure you already knew this Scott). I tried
to
search in google for how to make http request but didn't find anything
really
useful in a few minutes, of course that doesn't mean that it can't work at
all.
Good luck with it Larry!
Arpi



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




Re: [PHP] Change Date

2003-01-13 Thread Tom Rogers
Hi,

Sunday, January 11, 2004, 10:42:01 PM, you wrote:
NS> Hi,
NS> How can I find time stamp for example 125 next days. or 03:30 hours next?

NS> Regards,
NS> S. Naqashzade
NS> PS: Sorry for my bad english :-(


The simplest way is with strtotime() for example

$stamp = strtotime("+ 125 days");

-- 
regards,
Tom


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




Re: [PHP] Permission Denied

2003-01-13 Thread Stephen
My Full system settings are IIS 6.1, Windows XP Professional, etc. I'll be
publishing the script later and most will have CHMOD settings. Now I guess I
need to know how to fix it on my test server and then what the CHMOD
settings should be...

As for Sean's email, I just did those settings and I'll have the results
later today. I'm only home for lunch, need to get back to school...


- Original Message -
From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
To: "'Stephen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "'PHP List'" <[EMAIL PROTECTED]>
Sent: Sunday, January 12, 2003 11:05 PM
Subject: RE: [PHP] Permission Denied


: Who owns the htdocs root (I know it is Windows) when you right click you
: should should see sharing/security.
:
: Do you if not what OS Ver are you using?
:
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: [EMAIL PROTECTED]
:
: > -Original Message-
: > From: Stephen [mailto:[EMAIL PROTECTED]]
: > Sent: Monday, 13 January 2003 1:36 PM
: > To: [EMAIL PROTECTED]
: > Cc: PHP List
: > Subject: Re: [PHP] Permission Denied
: >
: >
: > Yes, I just added it but same error:
: >
: > Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob)
: > [function.mkdir]: Permission denied in
: > c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 28
: >
: > Here's the part where I try and make the folder:
: >
: > function do_dir($package) {
: >  umask(0);
: >  if(mkdir($this->currentfolder().'packs\\bob', 0777)) {
: > return true;
: >  } else {
: >   echo 'There is already a package by the name of
: > '.$package.'! Delete it and try again.';
: >   return false;
: >  }
: >}
: >
: > Any ideas?
: > - Original Message -
: > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
: > To: "'Stephen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
: > Sent: Sunday, January 12, 2003 6:33 PM
: > Subject: RE: [PHP] Permission Denied
: >
: >
: > : Did you use the umask(0) prior to the mkdir() in your script??
: > :
: > :
: > : Timothy Hitchens (HiTCHO)
: > : Open Platform Consulting
: > : e-mail: [EMAIL PROTECTED]
: > :
: > : > -Original Message-
: > : > From: Stephen [mailto:[EMAIL PROTECTED]]
: > : > Sent: Monday, 13 January 2003 9:09 AM
: > : > To: [EMAIL PROTECTED]
: > : > Subject: Re: [PHP] Permission Denied
: > : >
: > : >
: > : > Ok, I got it to make a directory as a absolute path but I'm
: > : > getting a "Permission Denied" error again. I'm running IIS so
: > : > I can't CHMOD and all the permission options are checked in
: > : > the options box.
: > : >
: > : >
: > : > - Original Message -
: > : > From: "Jason Wong" <[EMAIL PROTECTED]>
: > : > To: <[EMAIL PROTECTED]>
: > : > Sent: Sunday, January 12, 2003 4:03 AM
: > : > Subject: Re: [PHP] Permission Denied
: > : >
: > : >
: > : > : On Sunday 12 January 2003 10:10, Stephen wrote:
: > : > : > There's already a folder named packs but my problem was
: > : > not having the /
: > : > : > before it. One more question. How can I dynamically get
: > : > the path to the
: > : > : > current folder? Like your at
: > : > http://www.bob.com/joe/index.php and you want
: > : > : > to get the
: > : > http://www.bob.com/joe/ bit and do it dynamically?
: > : > :
: > : > : print_r($_SERVER) will show you which bits you can use.
: > : > :
: > : > : --
: > : > : Jason Wong -> Gremlins Associates -> www.gremlins.biz
: > : > : Open Source Software Systems Integrators
: > : > : * Web Design & Hosting * Internet & Intranet Applications
: > : > Development *
: > : > :
: > : > : /*
: > : > : I'll show you MY telex number if you show me YOURS ...
: > : > : */
: > : > :
: > : > :
: > : > : --
: > : > : 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 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] form box question

2003-01-13 Thread Ford, Mike [LSS]
> -Original Message-
> From: Anthony Ritter [mailto:[EMAIL PROTECTED]]
> Sent: 13 January 2003 17:07
> I'm testing the following form on:
> 
> MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.
> 
> However...when I publish the
> 
> .php file
> 
> and the
> 
> data.txt file
> 
> on the ISP's MS IIS server, I get undeclared variables and 
> indexes when the
> form page loads.

This is more than likely a disparity between the error_level settings on
your local server and the ISP's server.  There's a couple of things you can
do about this:

(1) turn error_reporting up on your test server to E_ALL, and rewrite to
eliminate all the warnings; this is technically probably the best solution,
but the most work.

(2) put an error_reporting(E_ALL ^ E_NOTICE) at the start of all your
scripts.

(3) persuade your ISP to turn down the default error reporting on their
server -- there's really no reason to have notice-level messages turned on
on a production site.  (Personally, I'd say that a production site shouldn't
send *any* PHP errors to the browser -- they should either be turned off
completely, or sent to a logfile for you to peruse periodically.)

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




[PHP] imap_open failure

2003-01-13 Thread Jeff Schwartz

I'm using imap_open in PHP 4.3.0 to successfully access every pop server I've tried - 
except 1: "mail.fea.net". I know the mail server, port, login, and password are 
correct because I can successfully log into the pop server with both telnet and 
Outlook.

Here's the code:

if ($pop_inbox = 
imap_open("{".$mailserver."/$mailbox_type:$port/notls}",$login,$password)):

I've tried every variation of the code, such as using "notls" or not. In any event, I 
know the code works because I can log into every other pop server I've tried.

imap_last_error() returns: Can not authenticate to POP3 server

Has anyone else run into this? Is there a way to see more about the interaction 
between imap_open and the pop server?

Jeff



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP] question about 'register_globals' setting

2003-01-13 Thread Don
Hi,

I'm using I.E. 6.  I noticed that register_globals was set ON in my php.ini file so I 
changed it to OFF in as per the security warning.  I've noticed a side effect.  When I 
submit a form via POST and then go back from the results page, my form has been 
cleared, i.e.., as if the page has been reloaded.  Is this a normal effect of setting 
register_globals OFF?  Is there a way to continue caching?

Thanks,
Don


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


Re: [PHP] form box question

2003-01-13 Thread chip . wiegand
Just a suggestion - you might want to disable the ability to input html 
code in the messages, as 
a precautionary messure. I tested the script and was able to make a mess 
of the page after 
submitting.
--
Chip




"Anthony Ritter" <[EMAIL PROTECTED]>
01/13/2003 09:07 AM

To
[EMAIL PROTECTED]
cc

bcc

Subject
[PHP] form box question



Hi,
I'm testing the following form on:

MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.

However...when I publish the

..php file

and the

data.txt file

on the ISP's MS IIS server, I get undeclared variables and indexes when 
the
form page loads.

The script follows.

Any help would be greatly appreciated.
Thank you.
Tony Ritter
..

// form.php




body {background-color:beige;
body
{
scrollbar-base-color: #FCF6DC;
scrollbar-face-color: #E3DBB5;
scrollbar-track-color: #FCF6DC;
scrollbar-arrow-color: #000;
scrollbar-highlight-color: #fff;
scrollbar-3dlight-color: #7B6D29;
scrollbar-shadow-color: #7B6D29;
scrollbar-darkshadow-color: #E3DBB5;
}
border:5px solid black;
}
textarea {border:1pt solid red;
  background-color:white;
  color:black;

  }

textarea p{font-size:12px;

  }

table {border:1pt solid black;
   width:700px;
   font-size:10px;
   background-color:#E3DBB5;
   color:#7B6D29;
   }


input {border:1pt solid solid red;
   background-color:white;
   color:black;}

..submit {
   background-color:#80;
   color:white;}

p {font-family:arial;
   font-size:12px;
  }

hr { color:#80;

}

A:link:{text-decoration:none; color:#7B6D29;}
A:visited:{text-decoration:none; color:#7B6D29;}
A:hover:{text-decoration:underline; color:green}




");

 print("Some of the messages have been:\n");

 $Data=file($TheFile);
  for($n=0; $n");

print("");
print("$getline[0]\n");
print("");
print("");
print("$getline[1]\n");
print("");
print("");
print("mailto:$getline[2]>$getline[2]\n");
print("");
print("");
print("");

  } //end for loop
 fclose($Open);

   } //end if
else
 {
  print("Unable to read data.txt");
 }
} //end function

function createform()
{

print("\n");
print("So...How did you like EagleFest 2003?: 
 \n");
print("Your name: \n");
print("Your e-mail: \n");
print("\n");
print("\n");
print("\n");

}

function handleform()
{
 global $comments;
 global $yourname;
 global $youremail;
 $comments=stripslashes($comments);
 $yourname=stripslashes($yourname);
 $youremail=stripslashes($youremail);
 $callfunction=WriteToFile($comments,$yourname,$youremail);
  if($callfunction)
   {

print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print("Thank you
for your comments about EagleFest 2003.");

   }//end if
  else
  {
   print("Your submission was not processed.");
  } //end else
}

if($beensubmitted)
 {
  handleform();
 }
else
{
createform();
ReadTheFile();
}
?>








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






Re: [PHP] form box question

2003-01-13 Thread Anthony Ritter
Thanks.

Any ideas after looking at the code why I'm having difficulty publishing the
file to a MS IIS server with undeclared indexes and variables if it works on
Apache server?

TR



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




[PHP] Re: occasional mcrypt problems

2003-01-13 Thread J Smith

Try using a different block cipher mode. When encrypting with ECB, as you 
said, your plaintext must have a length that is a multiple of the blocksize 
for the cipher. If it's anything less, you're going to get some garbage at 
the end of the decrypted ciphertext. I believe that mcrypt uses zeroes 
padding for ECB mode.

You might want to try one of the other block cipher modes, like CBC or CFB. 
This will require that you use random IVs for each encryption, but it's 
much more secure than using ECB mode. Even though you create an IV in your 
code below, ECB mode ignores it -- if you encrypt the same plaintext 
multiple times using the same key, you'll end up with the same ciphertext. 
With random IVs and the proper mode, this wouldn't happen. This will 
require that you store the IV for each encryption along with the 
ciphertext, but that's fine, as storing the IV along with the ciphertext is 
not a security problem.

I'm not sure what mcrypt uses for padding on it's various block cipher 
modes, but it might help. It'll be more secure than ECB, at any rate.

J


Steve Yates wrote:

> Hello,
> 
> I recently implemented a database using MySQL that is storing selected
> fields encrypted.  However on a very small number of records the decrypted
> result is not correct for some fields, for example for this credit card
> number:
> 
> -99-ÏF¡hßxø
> 
> It appears in fact the same way as the problem I first experienced, when
> the database field was not big enough to store the encrypted text (which I
> discovered takes a multiple of the blocksize, so it is usually bigger than
> the original string).  However the blocksize is 8 and to provide a safety
> margin all the fields to be encrypted have 10 extra characters in them
> (varchar fields).
> 
> So far this happens on at most one field in a record, perhaps on less than
> 5% of the records.  At first I was thinking maybe the addslashes() was
> adding text but MySQL should be stripping that out before entering it into
> the database, right?  Also I can't seem to duplicate this by entering the
> same values in the form again.
> 
> Any suggestions?  Here is my encryption code:
> 
> $hrkey = '$R^a$nd()M%'; // changed text
> $td = mcrypt_module_open(MCRYPT_TRIPLEDES,'', MCRYPT_MODE_ECB, '');
> $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), 99);
> //changed the number
> $ks = mcrypt_enc_get_key_size ($td);
> $key = substr(md5($hrkey), 0, $ks);
> mcrypt_generic_init($td, $key, $iv);
> $CreditCardNumber = addslashes(mcrypt_generic($td,
> $_POST['Credit_Card_Number']));
> (...post to database here...)
> mcrypt_module_close($td);
> 
> Decryption code:
> 
> function mydecrypt($enc) {
>   global $td;
>   return rtrim(mdecrypt_generic($td, $enc), "\0");
> }
> 
> Thanks for any insight!
> 
>  - Steve Yates
>  - ASCII stupid question, get a stupid ANSI.
> 
> ~ Taglines by Taglinator - www.srtware.com ~


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




[PHP] include_files message question

2003-01-13 Thread Allen Byington
All

I've been trying to compile php4 to run under HP-UX 11 64 bit and I get
errors on documents when trying to include files.  As far as I can tell
everything else works.  The message only appears when I do an include with a
soft path suh as:

require('includes/config.inc.php' );

I do not however, have any problems doing:

require('./includes/config.inc.php' );

The error I get is below.  Can anyone tell me how to fix this or at least
point me in the right direction?

*** Error Begins ***
Fatal error: Failed opening required 'includes/config.inc.php'
(include_path='/usr/local/lib/php') in
/opt/apache/htdocs/admin/includes/auth.inc.php on line 24
*** Error Ends ***

Thanks
Allen
[EMAIL PROTECTED]



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




[PHP] benchmarking used memory

2003-01-13 Thread peio popov
	Hi,
I would like to know if there is way to measure how much memory a script uses during execution.
Althought threre is no such function in the manual,  in my opinion there must be some indication how much memory is used 
because of the memory_limit directive in the php.ini file. So if php is able to determine the maximum level it should be
able and to give indication and for the actual.

	Thanks in advance
	Peio Popov	
--

---
Peio Popov - [EMAIL PROTECTED]
icq# 117130734
http://www.cilaw.org


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



Re: [PHP] question about 'register_globals' setting

2003-01-13 Thread Chris Hewitt
Don wrote:



I'm using I.E. 6.


Its not a browser thing, but a PHP thing.


 I noticed that register_globals was set ON in my php.ini file so I changed it to OFF in as per the security warning.  I've noticed a side effect.  When I submit a form via POST and then go back from the results page, my form has been cleared, i.e.., as if the page has been reloaded.  Is this a normal effect of setting register_globals OFF?  Is there a way to continue caching?


Yes, this is exactly what register_globals does. If you are using the 
recommended setting of off then you get at your variables with the new 
super-globals, that is:
$myvar = $_POST['myvar'];// for POST data.
$myvar = $_GET['myvar'];// for GET data.
$myvar = $_REQUEST['myvar'];// for both POST and GET data.

Hope this helps.

Chris



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



Re: [PHP] form box question

2003-01-13 Thread Chris Hewitt
Anthony Ritter wrote:



Any ideas after looking at the code why I'm having difficulty publishing the
file to a MS IIS server with undeclared indexes and variables if it works on
Apache server?


It will be the error reporting level being set differently between the 
two servers. The IIS one sounds as though it has E_NOTICE set. I feel 
its good practice to initialise variables before using them (then the 
warnings do not occur), but otherwise set error reporting to E_ALL 
~E_NOTICE (from memory as I don't have a computer with php switched on 
at the moment). Its detailed in the manual.

HTH
Chris



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



Re: [PHP] question about 'register_globals' setting

2003-01-13 Thread Don
> Don wrote:
>
> >
> >I'm using I.E. 6.
> >
> Its not a browser thing, but a PHP thing.
>
> >  I noticed that register_globals was set ON in my php.ini file so I
changed it to OFF in as per the security warning.  I've noticed a side
effect.  When I submit a form via POST and then go back from the results
page, my form has been cleared, i.e.., as if the page has been reloaded.  Is
this a normal effect of setting register_globals OFF?  Is there a way to
continue caching?
> >
> Yes, this is exactly what register_globals does. If you are using the
> recommended setting of off then you get at your variables with the new
> super-globals, that is:
> $myvar = $_POST['myvar'];// for POST data.
> $myvar = $_GET['myvar'];// for GET data.
> $myvar = $_REQUEST['myvar'];// for both POST and GET data.
>
> Hope this helps.
>
> Chris

Hi,

Thanks for your response but I don't think this is what I was asking; could
be wrong though.

What I want to know is why is my initial HTML form is empty when I click on
the back browser button.  There is no PHP in my form, just straight HTML.  I
only use PHP to process the form, not to create it.

Order of events

Fill out form
Click submit
PHP processes script and returns confirmation page
User clicks browser BACK button and returns to form
Where have the user's entries vanished to?

Thanks,
Don


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




Re: [PHP] question about 'register_globals' setting

2003-01-13 Thread Chris Hewitt
Don wrote:



Thanks for your response but I don't think this is what I was asking; could
be wrong though.


I re-read your post and, of course, you are right. I mis-read it! I have 
heard of this Back button and data missing and I'm sure its come up 
before, but I don't remember the answer. I can only suggest looking in 
the archives, I'm afraid.

Regards

Chris



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



[PHP] question on Header(location

2003-01-13 Thread Don
When I use ---> header("Location: http://www.somepage.com), it redirects to
my page no problem.  My question is, is there a PHP trick I can use to make
it open in a new browser window?

I'm adverse to using JavaScript as some users may not have it turned on (odd
I know but a reality still).

Thanks,
Don


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




Re: [PHP] question on Header(location

2003-01-13 Thread Jason Wong
On Tuesday 14 January 2003 03:33, Don wrote:
> When I use ---> header("Location: http://www.somepage.com), it redirects to
> my page no problem.  My question is, is there a PHP trick I can use to make
> it open in a new browser window?

No.

> I'm adverse to using JavaScript as some users may not have it turned on
> (odd I know but a reality still).

Only javascript can open new a window.

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

/*
Hotels are tired of getting ripped off.  I checked into a hotel and they
had towels from my house.
-- Mark Guido
*/


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




[PHP] portabily including files

2003-01-13 Thread Tyler BIRD
I'm trying to include
'http://www.myserver.com/conted/me.inc'; 
portably on several mirrored servers like include
'/conted/me.inc'
, I was wondering if there was someway I could include
files and have the implicity connect
and down the load me.inc from the local server whatever
server it happens to be on.

for example:
on web1 box

include '/conted/me.inc'; works fine

for example 
on web2 box
include 'conted/me.inc'; works fine


Tyler Bird
UVSC - Continuing Education



-- 
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-13 Thread Chris Shiflett
--- Justin French <[EMAIL PROTECTED]> wrote:
> In NN7 Mac, the error is "the page contained no data".
> In IE5.x Mac, the error is along the lines of "host
> not found" or "could not access URL ...".

This is a bit off-topic, but I would suggest ignoring any
error messages from IE. It will generally "hide" the real
error and show you some generic page instead. This can be
very misleading. Go with Netscape's assessment of the
problem.

> I guess what I'm hoping for is some wild stabs in the
> dark as to what the problem might be, and where I
> might start looking.

There are a few different ways you can get a "document
contained no data" message:

1. You have an endless loop somewhere in your code, so that
under certain circumstances, the script never completes.
2. You have an endless loop in the form of protocol-level
redirects (using header()), so that the Web client
continues to make HTTP requests without ever receiving a
200 response.
3. The network connection is terminated. This can occur
when the server crashes, among other things.

I can think of no other ways to receive this error (please,
someone chime in if I have left one out). So, you can try
to rule out possibilities one by one.

Endless loops in your code might be difficult to identify
if the logical path through your code required to generate
it is rare. Sometimes looking through your code with this
in mind is the best way to find the problem.

Endless amounts of protocol-level redirects can be detected
pretty easily. If you can reproduce it in any way, tcpdump
or some other debugging tool can reveal the HTTP
transactions. Short of this, many requests within a very
small window of time from the same IP is a good indicator
as well.

If the Web server crashes under certain circumstances to
cause this error, this can be the most difficult to track
down. Your best bet is to be able to at least reproduce the
steps necessary to crash the server. If you believe it
might be only demonstrable under load, you will want to
test the application under heavy load to see if you can
reproduce the error.

> - (occasionally) makes use of header() redirects

I would recommend looking at these first. Make sure there
is no way for the client to enter into an endless loop of
redirects.

Anyway, I hope that helps. Sometimes just knowing some
common cases that result in the same error can help you
identify the problem.

Good luck.

Chris

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




[PHP] problems to get image informations form local harddrive using "getimagesize"

2003-01-13 Thread harald.mohring
isn't it possible to get image informations from the local harddrive?

$fotoinfo=getimagesize("C:\\Files\\Temp\\Image.jpg");

if i use that code, the errormessage is always
Unable to access c:\Files\Temp\Image.jpg
getimagesize: unable to open file for reading

got anybody a solution?



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




Re: [PHP] Permission Denied

2003-01-13 Thread Stephen
Ok, I finally just right clicked on my wwwroot folder  and went to security.
I allowed control to everyone on the network (just me and my brothers) and
it works. Just one last question! What should the CHMOD settings be for when
it goes online?


- Original Message -
From: "Sean Malloy" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Sunday, January 12, 2003 10:40 PM
Subject: RE: [PHP] Permission Denied


: I'm assuming you are using IIS.
:
: If your harddrive is formatted using NTFS, you are going to have to add a
: new entry to the ACL list for the directory to let the IUSR_
: account access the directory.
:
: There are plenty of readmes/articles on managing NTFS permissions. I don't
: have time to go into the details of how to do it, only to tell you that
that
: is what you have to do.
:
: BTW; By default Windows XP (If thats what you are using) enables Simple
: Sharing/File Permisisons. To turn that off
:
: in Windows Explorer;
:
: Tools | Folder Options | View | (Scroll Right Down to bottom) Use simple
: sharing <-- untick
:
:
: -Original Message-
: From: Stephen [mailto:[EMAIL PROTECTED]]
: Sent: Monday, 13 January 2003 2:36 PM
: To: [EMAIL PROTECTED]
: Cc: PHP List
: Subject: Re: [PHP] Permission Denied
:
:
: Yes, I just added it but same error:
:
: Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob) [function.mkdir]:
: Permission denied in c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line
: 28
:
: Here's the part where I try and make the folder:
:
: function do_dir($package) {
:  umask(0);
:  if(mkdir($this->currentfolder().'packs\\bob', 0777)) {
: return true;
:  } else {
:   echo 'There is already a package by the name of '.$package.'! Delete
: it and try again.';
:   return false;
:  }
:}
:
: Any ideas?
: - Original Message -
: From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
: To: "'Stephen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
: Sent: Sunday, January 12, 2003 6:33 PM
: Subject: RE: [PHP] Permission Denied
:
:
: : Did you use the umask(0) prior to the mkdir() in your script??
: :
: :
: : Timothy Hitchens (HiTCHO)
: : Open Platform Consulting
: : e-mail: [EMAIL PROTECTED]
: :
: : > -Original Message-
: : > From: Stephen [mailto:[EMAIL PROTECTED]]
: : > Sent: Monday, 13 January 2003 9:09 AM
: : > To: [EMAIL PROTECTED]
: : > Subject: Re: [PHP] Permission Denied
: : >
: : >
: : > Ok, I got it to make a directory as a absolute path but I'm
: : > getting a "Permission Denied" error again. I'm running IIS so
: : > I can't CHMOD and all the permission options are checked in
: : > the options box.
: : >
: : >
: : > - Original Message -
: : > From: "Jason Wong" <[EMAIL PROTECTED]>
: : > To: <[EMAIL PROTECTED]>
: : > Sent: Sunday, January 12, 2003 4:03 AM
: : > Subject: Re: [PHP] Permission Denied
: : >
: : >
: : > : On Sunday 12 January 2003 10:10, Stephen wrote:
: : > : > There's already a folder named packs but my problem was
: : > not having the /
: : > : > before it. One more question. How can I dynamically get
: : > the path to the
: : > : > current folder? Like your at
: : > http://www.bob.com/joe/index.php and you want
: : > : > to get the
: : > http://www.bob.com/joe/ bit and do it dynamically?
: : > :
: : > : print_r($_SERVER) will show you which bits you can use.
: : > :
: : > : --
: : > : Jason Wong -> Gremlins Associates -> www.gremlins.biz
: : > : Open Source Software Systems Integrators
: : > : * Web Design & Hosting * Internet & Intranet Applications
: : > Development *
: : > :
: : > : /*
: : > : I'll show you MY telex number if you show me YOURS ...
: : > : */
: : > :
: : > :
: : > : --
: : > : 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 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] GD help

2003-01-13 Thread RClark
Does anyone know if there is a newsgroup for help with GD commands?

Thanks,
RC



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




[PHP] Write Image to Cache

2003-01-13 Thread Stephen



I have a chat script that refreshes the chat thing about every 
5 seconds. The problem with it is emoticons. Each refresh, it makes the images 
reload aswell which makes it do sort of a flicker. How could I write the image 
to cache to make this stop happening or is there another method that works 
better?
Thanks,Stephen Cratonhttp://www.melchior.us
 
"What's the point in appearance if your true love, doesn't care about it?" 
-- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Does PHP's imap_utf7_en/decode compatible with Microsoft Outlook Express?

2003-01-13 Thread Jesse Cablek
Hunte Swee [mailto:[EMAIL PROTECTED]] scribbled;

> Hi all,
> 
> It seems true that php's imap_utf7_en/decode does not compatible with
> microsoft outlook express. We create imap folder(include chinese
> chars) using IMP, all it ok in IMP problem, but when use OE
> to connect to imap server, the folder can't be shown correctly. And
> vice versa.
> 
> So my problem is what is wrong? PHP or Outlook Express?
> 

I'd say Outlook Express (untested of course).
The reason:
I once helped a guy that could not send an email to one specific person, it
was because of a Garman character in the persons name in his address book.
Try creating an english IMAP folder and see if OE can read that?

-jesse


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




[PHP] Small Business Suggestion ???

2003-01-13 Thread Daniel Negron/KBE
Does anyone have any good suggestions for small business software
(PHP/MySQL) based ?

basically what I need to do is:

contact management
work order forms
invoicing

TIA

**DAN**


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




Re: [PHP] attachment problem

2003-01-13 Thread Lars Olsson
Yes, I've tried using the Content-Disposition header. It doesn't seem to 
work...here are the relevant parts of my code:


// Change Content-Type so that it matches the MIME-type of the part
header('Content-Type: ' . $type . '/' . $subtype);
		
// Check if there is a name for the part
if (isset($name)) {
	header('Content-Disposition: inline; filename=' . $name);
}
else {
	header('Content-Disposition: inline');
}


I've tried printing $type, $subtype and $name and they all contain 
correct values...still no luck.


As per your suggestion I tried using wget -S to check the headers. Here 
are the results:

C:\WINDOWS\Profiles\Lasso\Skrivbordet>wget -S --spider 
http://localhost/webmail/
attachment.php?mailbox=INBOX&msguid=279&part=2
--21:59:30-- 
http://localhost/webmail/attachment.php?mailbox=INBOX&msguid=279&p
art=2
   => `attachment.php@mailbox=INBOX&msguid=279&part=2'
Resolving localhost... done.
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Date: Mon, 13 Jan 2003 20:59:39 GMT
 3 Server: Apache/1.3.27 (Win32) PHP/4.2.3
 4 X-Powered-By: PHP/4.2.3
 5 Set-Cookie: PHPSESSID=12ab68cb5cd7355b2a63b9007bda0221; path=/
 6 Expires: Thu, 19 Nov 1981 08:52:00 GMT
 7 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0

 8 Pragma: no-cache
 9 Keep-Alive: timeout=15, max=100
10 Connection: Keep-Alive
11 Content-Type: text/html
200 OK


I'm VERY confused about line 11! The type (for this particular request) 
should be image/bmp (Mozillas Page Info tab confirms this). Still, wget 
claims it is text/html...hm...strange...now what?


/Lars Olsson ([EMAIL PROTECTED])



Timothy Hitchens ) wrote:
So you have tried as per the manual:

header("Content-Disposition: attachment; filename=downloaded.pdf");

I use this all the time without issue.. do you have a shell that you can
use to "wget -S" and see if the correct headers are coming out??



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]



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




Re: [PHP] question on Header(location

2003-01-13 Thread Joseph W. Goff
No, I am afraid not.  It will only send a redirection header to the same
page that you are on.
- Original Message -
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 1:33 PM
Subject: [PHP] question on Header(location


> When I use ---> header("Location: http://www.somepage.com), it redirects
to
> my page no problem.  My question is, is there a PHP trick I can use to
make
> it open in a new browser window?
>
> I'm adverse to using JavaScript as some users may not have it turned on
(odd
> I know but a reality still).
>
> Thanks,
> Don
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
>
>
> --
> 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] Looking for advice on a non-profit site development

2003-01-13 Thread White Wolf
Hi All,

I am a C++ guy, who plans to do a site about C++ Idioms.  I would like to
make it into a community site with interactivity.  I have concluded that
PHP would be the right way to go.  However I am "lazy".  I would like first
to be able to start doing the site using some sort of visual environment
where I can concentrate mostly on the site and on the possible minimum on
PHP itself.

What I am thinking of is a well searchable knowledge base with articles,
which has a structure (let's say some standard sections).  I plan to make
it possible to comment on the different articles/its sections just like it
can be done on the php.net site for the documentation.

For that kind of site I am looking for a sort of visual design environment,
preferably free (since it is non-profit) and preferably something for which
I do not need my own server.

If you have any hints how should I start, what should I use, please let me
know!

Ps: I am not looking for a way of not knowing PHP and use it: but I am
looking for a way to create a site ASAP, since I believe that what I plan
to do serves a need.

--
White Wolf aka Attila @ LMF
ICQ#: 26070936
http://wwp.icq.com/26070936
If I'm not online send mail.
NO USENET followups please.
SPAM is not welcome.



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




RE: [PHP] attachment problem

2003-01-13 Thread Timothy Hitchens \(HiTCHO\)
What happens when you change the "inline" to attachment??

Also does this page have any errors in it... eg parsing ones that are
causing PHP to take over the headers and error out??



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Lars Olsson [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 14 January 2003 7:15 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] attachment problem
> 
> 
> Yes, I've tried using the Content-Disposition header. It 
> doesn't seem to 
> work...here are the relevant parts of my code:
> 
> 
> // Change Content-Type so that it matches the MIME-type of the part
> header('Content-Type: ' . $type . '/' . $subtype);
>   
> // Check if there is a name for the part
> if (isset($name)) {
>   header('Content-Disposition: inline; filename=' . $name);
> }
> else {
>   header('Content-Disposition: inline');
> }
> 
> 
> I've tried printing $type, $subtype and $name and they all contain 
> correct values...still no luck.
> 
> 
> As per your suggestion I tried using wget -S to check the 
> headers. Here 
> are the results:
> 
> C:\WINDOWS\Profiles\Lasso\Skrivbordet>wget -S --spider 
> http://localhost/webmail/ 
> attachment.php?mailbox=INBOX&msguid=279&part=2
> --21:59:30-- 
> http://localhost/webmail/attachment.php?mailbox=INBOX&msguid=279&p
> art=2
> => `attachment.php@mailbox=INBOX&msguid=279&part=2'
> Resolving localhost... done.
> Connecting to localhost[127.0.0.1]:80... connected.
> HTTP request sent, awaiting response...
>   1 HTTP/1.1 200 OK
>   2 Date: Mon, 13 Jan 2003 20:59:39 GMT
>   3 Server: Apache/1.3.27 (Win32) PHP/4.2.3
>   4 X-Powered-By: PHP/4.2.3
>   5 Set-Cookie: PHPSESSID=12ab68cb5cd7355b2a63b9007bda0221; path=/
>   6 Expires: Thu, 19 Nov 1981 08:52:00 GMT
>   7 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, 
> pre-check=0
> 
>   8 Pragma: no-cache
>   9 Keep-Alive: timeout=15, max=100
> 10 Connection: Keep-Alive
> 11 Content-Type: text/html
> 200 OK
> 
> 
> I'm VERY confused about line 11! The type (for this 
> particular request) 
> should be image/bmp (Mozillas Page Info tab confirms this). 
> Still, wget 
> claims it is text/html...hm...strange...now what?
> 
> 
> /Lars Olsson ([EMAIL PROTECTED])
> 
> 
> 
> Timothy Hitchens ) wrote:
> > So you have tried as per the manual:
> > 
> > header("Content-Disposition: attachment; filename=downloaded.pdf");
> > 
> > I use this all the time without issue.. do you have a shell 
> that you 
> > can use to "wget -S" and see if the correct headers are coming out??
> > 
> > 
> > 
> > Timothy Hitchens (HiTCHO)
> > Open Platform Consulting
> > e-mail: [EMAIL PROTECTED]
> 


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




RE: [PHP] Write Image to Cache

2003-01-13 Thread Timothy Hitchens \(HiTCHO\)
Use the correct headers for no-cache see manual for starters:
 
http://www.php.net/manual/en/function.header.php  
 
 

Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED] 

-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 14 January 2003 6:50 AM
To: PHP List
Subject: [PHP] Write Image to Cache


I have a chat script that refreshes the chat thing about every 5
seconds. The problem with it is emoticons. Each refresh, it makes the
images reload aswell which makes it do sort of a flicker. How could I
write the image to cache to make this stop happening or is there another
method that works better?


Thanks,
Stephen Craton
http://www.melchior.us
 
"What's the point in appearance if your true love, doesn't care about
it?" -- http://www.melchior.us




[PHP] dumb time question

2003-01-13 Thread Pag

	Ok, this is going to be laughable, but here goes. I am looking at code too 
much to get this one:

	Have 2 text fields on a database called "hours" and "minutes".
	How can i get the current time (hour-minutes) in two digit format and 
apply it to the two variables? Everything i do only gets one digit when the 
minutes are between 00 and 10.
	I know its going to be stupid but anyway, could use your help, i cant see 
anything straight in this code anymore. :-P
	Sorry and thanks.

	Pag



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



Re: [PHP] dumb time question

2003-01-13 Thread Tim Ward
use the date() function, in this case date("i") and date("h") or date("H")

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Pag <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 10:25 PM
Subject: [PHP] dumb time question


>
> Ok, this is going to be laughable, but here goes. I am looking at code too
> much to get this one:
>
> Have 2 text fields on a database called "hours" and "minutes".
> How can i get the current time (hour-minutes) in two digit format and
> apply it to the two variables? Everything i do only gets one digit when
the
> minutes are between 00 and 10.
> I know its going to be stupid but anyway, could use your help, i cant see
> anything straight in this code anymore. :-P
> Sorry and thanks.
>
> Pag
>
>
>
> --
> 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] Trapping PHP errors

2003-01-13 Thread Pieter Claerhout
Hi all,

is there a way to execute a custom function as soon as an error happens in
PHP? I looked at the set_error_handler function, but it doesn't seem to trap
all the errors. What I want to achieve is to execute a function that mails
me the error everytime an error happens.

Cheers,


Pieter



Re: [PHP] attachment problem

2003-01-13 Thread Lars Olsson
It doesn't matter whether I choose 'inline' or 'attachment', browser 
doesn't seem to care...but at least I found out why wget -S got me 
text/html instead of image/bmp. I had some session variables that messed 
things up, but I hacked it a bit and now wget -S is giving me the 
following headers:

C:\WINDOWS\Profiles\Lasso\Skrivbordet>wget -S --spider 
http://localhost/webmail/
attachment.php?mailbox=INBOX&msguid=279&part=2
--00:19:19--  
http://localhost/webmail/attachment.php?mailbox=INBOX&msguid=279&p
art=2
  => `attachment.php@mailbox=INBOX&msguid=279&part=2'
Resolving localhost... done.
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response...
1 HTTP/1.1 200 OK
2 Date: Mon, 13 Jan 2003 23:19:27 GMT
3 Server: Apache/1.3.27 (Win32) PHP/4.2.3
4 X-Powered-By: PHP/4.2.3
5 Set-Cookie: PHPSESSID=e4025c8fb31d0de0b04c7aa0e3afc676; path=/
6 Expires: Thu, 19 Nov 1981 08:52:00 GMT
7 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0

8 Pragma: no-cache
9 Content-Disposition: inline; filename=tomtefan.bmp
10 Keep-Alive: timeout=15, max=100
11 Connection: Keep-Alive
12 Content-Type: image/bmp
200 OK

The Content-Type seems ok, and so does the Content-Disposition. Browser 
still suggests 'attachment.php' whenever I choose File->Save As...

Strange happenings indeed...

/Lars ([EMAIL PROTECTED])



Timothy Hitchens (HiTCHO) wrote:

What happens when you change the "inline" to attachment??

Also does this page have any errors in it... eg parsing ones that are
causing PHP to take over the headers and error out??



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]
 



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




Re: [PHP] attachment problem

2003-01-13 Thread Lars Olsson
Well, I'll be damned...don't know why, but suddenly everything seems to 
work! Guess some little gnome inside my computer finally decided it was 
time for me to get some sleep...

Many thanx for for your help, Timothy!

/Lars ([EMAIL PROTECTED])



Lars Olsson wrote:
It doesn't matter whether I choose 'inline' or 'attachment', browser 
doesn't seem to care...but at least I found out why wget -S got me 
text/html instead of image/bmp. I had some session variables that messed 
things up, but I hacked it a bit and now wget -S is giving me the 
following headers:

C:\WINDOWS\Profiles\Lasso\Skrivbordet>wget -S --spider 
http://localhost/webmail/
attachment.php?mailbox=INBOX&msguid=279&part=2
--00:19:19--  
http://localhost/webmail/attachment.php?mailbox=INBOX&msguid=279&p
art=2
  => `attachment.php@mailbox=INBOX&msguid=279&part=2'
Resolving localhost... done.
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response...
1 HTTP/1.1 200 OK
2 Date: Mon, 13 Jan 2003 23:19:27 GMT
3 Server: Apache/1.3.27 (Win32) PHP/4.2.3
4 X-Powered-By: PHP/4.2.3
5 Set-Cookie: PHPSESSID=e4025c8fb31d0de0b04c7aa0e3afc676; path=/
6 Expires: Thu, 19 Nov 1981 08:52:00 GMT
7 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0

8 Pragma: no-cache
9 Content-Disposition: inline; filename=tomtefan.bmp
10 Keep-Alive: timeout=15, max=100
11 Connection: Keep-Alive
12 Content-Type: image/bmp
200 OK

The Content-Type seems ok, and so does the Content-Disposition. Browser 
still suggests 'attachment.php' whenever I choose File->Save As...

Strange happenings indeed...

/Lars ([EMAIL PROTECTED])



Timothy Hitchens (HiTCHO) wrote:

What happens when you change the "inline" to attachment??

Also does this page have any errors in it... eg parsing ones that are
causing PHP to take over the headers and error out??



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]
 





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




[PHP] pass by reference

2003-01-13 Thread Pupeno
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I did a complex class that works with XML parsing and complex structured where
I used references extensivly and now I'm surprised with:

Warning: Call-time pass-by-reference has been deprecated - argument passed by
value; If you would like to pass it by reference, modify the declaration of
array_push(). If you would like to enable call-time pass-by-reference, you
can set allow_call_time_pass_reference to true in your INI file. However,
future versions may not support this any longer.

I can't modify the php.ini since I'm in a shared but the problem is deeper.
Why was it deprecated ? what replaced it ? is there any work arround ?
My 200 lines of code without references could take much, much longer and be
much, much more messy.
Any ideas ?
Thanks.
- --
Pupeno: [EMAIL PROTECTED]
http://www.pupeno.com
- ---
Help the hungry children of Argentina,
please go to (and make it your homepage):
http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+I02cLr8z5XzmSDQRAs/0AKCyf+UG0uZdbwG30WFU0UUNVWO7BwCgnCn5
2LmOOJi8uX+1dOqUfCTatSE=
=5obN
-END PGP SIGNATURE-


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




[PHP] permission denied

2003-01-13 Thread Anthony Ritter
Using MS Win98 / php 4:

Any ideas on how I can change my permssion settings on a file called
data.txt so it can be read to and written to or do I have to take that up
with my ISP.

I get the following after I submit a form:

Warning: fopen("data.txt", "a+") - Permission denied in
d:\inetpub\www.blahblah.org\formtest.php on line 80
Your submission was not processed.

Thank you for your time and help.
TR







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




Re: [PHP] Looking for advice on a non-profit site development

2003-01-13 Thread Michael Sweeney
Check out phpnuke.org - content management system that seems to answer
most of the criteria you've set out here.

..michael..

On Mon, 2003-01-13 at 13:46, White Wolf wrote:
> Hi All,
> 
> I am a C++ guy, who plans to do a site about C++ Idioms.  I would like to
> make it into a community site with interactivity.  I have concluded that
> PHP would be the right way to go.  However I am "lazy".  I would like first
> to be able to start doing the site using some sort of visual environment
> where I can concentrate mostly on the site and on the possible minimum on
> PHP itself.
> 
> What I am thinking of is a well searchable knowledge base with articles,
> which has a structure (let's say some standard sections).  I plan to make
> it possible to comment on the different articles/its sections just like it
> can be done on the php.net site for the documentation.
> 
> For that kind of site I am looking for a sort of visual design environment,
> preferably free (since it is non-profit) and preferably something for which
> I do not need my own server.
> 
> If you have any hints how should I start, what should I use, please let me
> know!
> 
> Ps: I am not looking for a way of not knowing PHP and use it: but I am
> looking for a way to create a site ASAP, since I believe that what I plan
> to do serves a need.
> 
> 


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




[PHP] Weird Errors

2003-01-13 Thread Mike Bowers
The errors aren't actually generadted inside the PHP but the problem im
having makes no sense to me.
The pages validate.php feed out:
Please veify below that all your details are correct. If there are any
errors, they will be lsited first.
Error 1: Primary e-mail address was left blank.
Error 2: Please specify whether or not your license has ever been
revoked.
Fatal Error: You did not agree to the terms listed.
Errors were found in your submission. Please use your bowsers back
button to go back and fix them.
There were 4 errors found.

The problem lies within the fact that these errors are not actually
being triggered. The errors are told to trigger if the field is left
blank. The problem is are the field are not left blank. The form that
feeds to the file is at http://www.skyfor.planetmodz.com/shsapp.html and
the PHP  script is  http://www.skyfor.planetmodz.com/validate.php .. The
text of both are too long to post in here. I checked myself to make sure
the form fields line up. Could someone please try to see if they can
figure out my error?

Thanks in advace,

Mike Bowers
PlanetModz Gaming Network Webmaster
[EMAIL PROTECTED]
ViperWeb Hosting Server Manager
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002


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




[PHP] Error in variable when looping

2003-01-13 Thread menezesd
Hello friends,

I have made the following table of data and a button on every row to view the details. 
The code is working fine and the table is displayed with the buttons. 

The problem I have is that the $SelectedItemNumber posted to the next page remains the 
same number no matter which row button I click. I have my relevant code below. Please 
help me. I know I am making a mistake somewhere but I cannot figure out where.

Quote :


while($row=mysql_fetch_array($result)){ 

Print "  ";
Print "" ;
Print   "  $row[OrgName] ";
print "   ";
Print "" ;
Print  $row[OrgCountry]; 
print "   ";
Print "" ;
Print  $row[OrgNumber]; 
print "   ";
Print "" ;
Print  $row[Orgaddress]; 
print "   ";
Print "" ;
Print  $row[OrgChief]; 
print "   ";
Print "" ;
Print"";
print "";
Print"";}
  }
?>



Unquote

Thanks
Denis

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




Re: [PHP] question about 'register_globals' setting

2003-01-13 Thread Rasmus Lerdorf
> >Thanks for your response but I don't think this is what I was asking; could
> >be wrong though.
> >
> I re-read your post and, of course, you are right. I mis-read it! I have 
> heard of this Back button and data missing and I'm sure its come up 
> before, but I don't remember the answer. I can only suggest looking in 
> the archives, I'm afraid.

This doesn't have anything to do with PHP.  Whether or not a form will be 
populated or not after hitting the back button completely depends on 
whether or not the browser decided to cache that page or not.  By default, 
a page served up by PHP will not be cached.  You can make it cacheable by 
sending an appropriate cache-control header.  However, in this case I 
think you said that the page was not even a PHP one, just static HTML in 
which case it should have gotten cached.  Have a look at the HTTP headers 
the page generates.

-Rasmus


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




Re: [PHP] question about 'register_globals' setting

2003-01-13 Thread Rasmus Lerdorf
> I'm using I.E. 6.  I noticed that register_globals was set ON in my
> php.ini file so I changed it to OFF in as per the security warning.  
> I've noticed a side effect.  When I submit a form via POST and then go
> back from the results page, my form has been cleared, i.e.., as if the
> page has been reloaded.  Is this a normal effect of setting
> register_globals OFF?  Is there a way to continue caching?

This should in no way be related to register_globals.

-Rasmus


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




Re: [PHP] Trapping PHP errors

2003-01-13 Thread Michael Sims
On Tue, 14 Jan 2003 23:38:11 +0100, you wrote:

>Hi all,
>
>is there a way to execute a custom function as soon as an error happens in
>PHP? I looked at the set_error_handler function, but it doesn't seem to trap
>all the errors. What I want to achieve is to execute a function that mails
>me the error everytime an error happens.

My site has a custom error handler (implemented via set_error_handler)
which sends a nicely formatted email including all of the error
details, a variable dump, the contents of the output buffer before the
error occured, and the contents of a call to debug_backtrace, in
addition to logging the error to a file.  We've used it in some form
or another for nearly a year now and it's been very helpful.

set_error_handler effectively traps every error you're likely to
encounter with the exception of parse errors.  And if you have a
script with a parse error, you'll know it pretty quickly and likely
won't need to be emailed, which means that for all intents and
purposes, set_error_handler traps all errors.

Is there a specific problem you're having with set_error_handler, or a
specific error that you were hoping your custom function would catch
that is isn't?  

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




[PHP] Re: Trapping PHP Errors

2003-01-13 Thread Robert Samuel White
Use the error_reporting function to define which errors you would like 
PHP to report to the error handler.  If you want everything to be mailed 
to you, including warnings, use the E_ALL setting, though you may get a 
lot more "warnings" than you expect this way:

error_reporting(E_ALL);

function ErrorHandler($_ErrorNumber_, $_ErrorString_, $_ErrorFile_, 
$_ErrorLine_)
{
   mail(...);
}

set_error_handler("ErrorHandler");



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



Re: [PHP] pass by reference

2003-01-13 Thread Tom Rogers
Hi,

Tuesday, January 14, 2003, 9:36:57 AM, you wrote:
P> -BEGIN PGP SIGNED MESSAGE-
P> Hash: SHA1

P> I did a complex class that works with XML parsing and complex structured where
P> I used references extensivly and now I'm surprised with:

P> Warning: Call-time pass-by-reference has been deprecated - argument passed by
P> value; If you would like to pass it by reference, modify the declaration of
P> array_push(). If you would like to enable call-time pass-by-reference, you
P> can set allow_call_time_pass_reference to true in your INI file. However,
P> future versions may not support this any longer.

P> I can't modify the php.ini since I'm in a shared but the problem is deeper.
P> Why was it deprecated ? what replaced it ? is there any work arround ?
P> My 200 lines of code without references could take much, much longer and be
P> much, much more messy.
P> Any ideas ?
P> Thanks.
P> - --
P> Pupeno: [EMAIL PROTECTED]
P> http://www.pupeno.com
P> - ---
P> Help the hungry children of Argentina,
P> please go to (and make it your homepage):
P> http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
P> -BEGIN PGP SIGNATURE-
P> Version: GnuPG v1.0.7 (GNU/Linux)

P> iD8DBQE+I02cLr8z5XzmSDQRAs/0AKCyf+UG0uZdbwG30WFU0UUNVWO7BwCgnCn5
P> 2LmOOJi8uX+1dOqUfCTatSE=
P> =5obN
P> -END PGP SIGNATURE-

I am sure array_push accepts the array as a reference so there is no need to use
the & operator in the call. At least thats how it works in a simple class.

-- 
regards,
Tom


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




Re: [PHP] pass by reference

2003-01-13 Thread Pupeno
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 13 January 2003 20:01, Tom Rogers wrote:
> Hi,
>
> Tuesday, January 14, 2003, 9:36:57 AM, you wrote:
> P> -BEGIN PGP SIGNED MESSAGE-
> P> Hash: SHA1
>
> P> I did a complex class that works with XML parsing and complex structured
> where P> I used references extensivly and now I'm surprised with:
>
> P> Warning: Call-time pass-by-reference has been deprecated - argument
> passed by P> value; If you would like to pass it by reference, modify the
> declaration of P> array_push(). If you would like to enable call-time
> pass-by-reference, you P> can set allow_call_time_pass_reference to true in
> your INI file. However, P> future versions may not support this any longer.
>
> P> I can't modify the php.ini since I'm in a shared but the problem is
> deeper. P> Why was it deprecated ? what replaced it ? is there any work
> arround ? P> My 200 lines of code without references could take much, much
> longer and be P> much, much more messy.
> P> Any ideas ?
> P> Thanks.
> P> - --
> P> Pupeno: [EMAIL PROTECTED]
> P> http://www.pupeno.com
> P> - ---
> P> Help the hungry children of Argentina,
> P> please go to (and make it your homepage):
> P> http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
> P> -BEGIN PGP SIGNATURE-
> P> Version: GnuPG v1.0.7 (GNU/Linux)
>
> P> iD8DBQE+I02cLr8z5XzmSDQRAs/0AKCyf+UG0uZdbwG30WFU0UUNVWO7BwCgnCn5
> P> 2LmOOJi8uX+1dOqUfCTatSE=
> P> =5obN
> P> -END PGP SIGNATURE-
>
> I am sure array_push accepts the array as a reference so there is no need
> to use the & operator in the call. At least thats how it works in a simple
> class.
No, I mean, what you're pushing inside the array is a reference:
array_push($anArrayOfReferences, &$thisIsAVariable);
that doesn't work, but I replaced by
$anArrayOfReferences[count($anArrayOfReferences)] = &$thisIsAVariable;
Thanks :)
- -- 
Pupeno: [EMAIL PROTECTED]
http://www.pupeno.com
- ---
Help the hungry children of Argentina,
please go to (and make it your homepage):
http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+I2FvLr8z5XzmSDQRAjjOAKCm0pwkFAVC8vFfF2r8v/enZp4NhwCffIfV
x0ipECbUUmn72eJbEw0eg60=
=oFaa
-END PGP SIGNATURE-


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




Re: [PHP] Error in variable when looping

2003-01-13 Thread Rick Emery
so where is $rowe set?

Show us code that calls this page
- Original Message -
From: "menezesd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 6:21 PM
Subject: [PHP] Error in variable when looping


Hello friends,

I have made the following table of data and a button on every row to view the details. 
The code is
working fine and the table is displayed with the buttons.

The problem I have is that the $SelectedItemNumber posted to the next page remains the 
same number
no matter which row button I click. I have my relevant code below. Please help me. I 
know I am
making a mistake somewhere but I cannot figure out where.

Quote :


while($row=mysql_fetch_array($result)){

Print "  ";
Print "" ;
Print   "  $row[OrgName] ";
print "   ";
Print "" ;
Print  $row[OrgCountry];
print "   ";
Print "" ;
Print  $row[OrgNumber];
print "   ";
Print "" ;
Print  $row[Orgaddress];
print "   ";
Print "" ;
Print  $row[OrgChief];
print "   ";
Print "" ;
Print"";
print "";
Print"";}
  }
?>



Unquote

Thanks
Denis

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

2003-01-13 Thread cj
G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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




Re: [PHP] forms

2003-01-13 Thread Rick Emery
Do you mean like two SUBMIT buttons?  Yes.
- Original Message - 
From: "cj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 7:32 PM
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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

2003-01-13 Thread Cal Evans
yes but it's more of an HTML/JavaScript thing.

use INPUT Type='BUTTON' to put a second button on your form.  Then use the
onClick method to assign an action to it.  If you want it to submit your
form then call document.formName.submit();

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: cj [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] forms


G'day All
Just a quick question
This is really a html more than a php question.

Is it possible to have two buttons and have different actions for each
button in the same form?

Thanks
CJ





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




  1   2   >