Re: [PHP] sessions problem (and spec. Mozilla vs Opera)

2001-04-16 Thread trogers

HI
Opers has a nasty caching behaviour which can cause problems with sessions 
and having different entry points on the same index page. To overcome some 
of the problems any hrefs that don't contain  get variables should be set 
up as:

a href="index.php?entered=yes"/a

Even if you never use the variable "entered" it will stop opera from 
caching the page.
(you can't just use index.php? as this will screw sessions without cookies)

This may or may not be your problem :)
Tom




At 10:41 AM 15/04/01 +0200, Martin =?ISO-8859-4?Q?Skj=F6ldebrand?= wrote:
On my login page (index.php) I have at the top

?
   session_start();
   session_destroy();

The intended function of which is to stop people from hitting the Back
button to reenter the site after having logged out (which bring people to
the page index.php).

Now, hitting BACK on Mozilla results in failed authentication and the app
closes. Hitting BACK on Opera (5.0b7 Linux) you get into the app again but
selecting anything from the menus results in failed authentication.

Which one is behaving correctly? Is it a bug in Opera (hopefully).

If, when logged in you go somewhere else, e.g. www.sunet.se, THEN hit back
you get back in. Is there a way of stopping this?

Martin S.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] no reponse -- Need FTP help

2001-04-12 Thread trogers

Hi
Probably the only way will be with a java applet to do the transfer 
directly to the other host.
Not sure if applets can connect to a host that they did not originate from
(not done much with java yet :)
Tom


At 11:09 PM 12/04/01 -0500, David Minor wrote:
hmm, good idea, but the only access I have to the remote machine is ftp.
Can't put a script on it.  I am getting the feeling that I actually have to
move the file(s) from the user's machine to my server and then transfer them
to the FTP site?  I was hoping there would be a way to transfer directly
from the user to the remote FTP site.  But now that I think about it, I
guess probably not.  so the trick would be to let the form upload them to
/tmp and then move them to the remote site.  Takes twice as long. :(  I'm
talking about 10-15 MB at a time while the user waits for confirmation.
That's a long wait (even moving it once).  Any ideas?

dm

Plutarck wrote:
 
  Or you could just put a PHP script on the target server that will take the
  input via GET and store the data for you. So you don't even have to use 
 FTP.
 
 
  --
  Plutarck
  Should be working on something...
  ...but forgot what it was.
 
 
  "Lindsay Adams" [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  sure.
 
  keep track of the files on the server drive, then open a connection using
  fopen() and fputs the contents of each file.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] URL FROM IP

2001-04-09 Thread trogers

Hi
That means there is no reverse dns setup for that ip so it just returns the 
ip number again.
Try with a few other ip's and it will work (try 129.250.16.102 for example)
Tom

At 10:43 AM 9/04/01 -0300, Renzi, Sebastian wrote:
this code returns the ip too ! i dont know why !!

  -Mensaje original-
  De:   trogers [SMTP:[EMAIL PROTECTED]]
  Enviado el:   lunes 9 de abril de 2001 10:41
  Para: [EMAIL PROTECTED]
  Asunto:   Re: [PHP] URL FROM IP
 
  Hi
 
  Try
 
  $url = getHostByAddr($REMOTE_ADDR);
 
  Tom
 
  At 10:17 AM 9/04/01 -0300, Renzi, Sebastian wrote:
  Having the ip i want to obtain de URL (www.renzi.com.ar)
  
  Thank You very much !
  
  Sebastin Renzi
  Consultora  Desarrollo de Sistemas.
  CODES S.A
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ?xml version=1.0? PHP

2001-04-09 Thread trogers

Hi
I do it this way:

?
echo '?xml version="1.0"?' ;
?

must use single quotes
Tom

At 04:38 PM 9/04/01 -0400, Gary wrote:
Hi All,
   When using the dtd below on a page that has a form with php. I get a 
 parser error for ?xml version="1.0"? am I going to have to go back to a 
 HTML 4.01 dtd or can I do something like escape the ? ?

?xml version="1.0"?
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
TIA Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, 
e-mail: [EMAIL PROTECTED] For additional commands, 
e-mail: [EMAIL PROTECTED] To contact the list administrators, 
e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] what could cause the maximum execution time exceeded?

2001-04-09 Thread trogers

Hi
possibly a loop running endlessly..
Tom

At 11:02 AM 10/04/01 -0500, Jacky wrote:
Hi people
I ran a PHP page and there was an error said below:
Fatal error  Maximum execution time of 30 seconds exceeded in 
include/getRoomDesc.php4
What could cause this??
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHPSESSID sticks to every link after upgrate of Apache/PHP

2001-04-08 Thread trogers

Hi
You will probably need to make clean and rebuild php config and do a new 
make against the new version of apache.
Just a guess
Tom

At 12:28 PM 5/04/01 +0900, Maxim Maletsky wrote:

Hello,

my co-worker has reinstalled Apache and PHP over the last night.

The Apache was upgraded to the new version while PHP was re-installed the
same.
PHP.ini was untouched.

Site uses sessions and, somehow, after this upgrade started carrying
PHPSESSID through HREF.

What should look for to bring the sessions using Cookies?

from PHP-INI:

NOTE : this was untouched.



[Session]
session.save_handler  = files   ; handler used to store/retrieve data
session.save_path = /tmp; argument passed to save_handler
 ; in the case of files, this is the
 ; path where data files are stored
session.use_cookies   = 1   ; whether to use cookies
session.name  = PHPSESSID ; name of the session
 ; is used as cookie name
session.auto_start= 0   ; initialize session on request startup
session.cookie_lifetime   = 0   ; lifetime in seconds of cookie
 ; or if 0, until browser is restarted
session.cookie_path   = /   ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
 ; php is the standard serializer of PHP
session.gc_probability= 1   ; percentual probability that the
 ; 'garbage collection' process is
started
 ; on every session initialization
session.gc_maxlifetime= 1440; after this number of seconds, stored
 ; data will be seen as 'garbage' and
 ; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
 ; externally stored URLs containing ids
session.entropy_length= 0   ; how many bytes to read from the file
session.entropy_file  = ; specified here to create the session
id
; session.entropy_length= 16
; session.entropy_file  = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
 ; determine HTTP caching aspects
session.cache_expire  = 180 ; document expires after n minutes
session.use_trans_sid = 1   ; use transient sid support if enabled
 ; by compiling with --enable-trans-sid
=


Has upgrade of apache (modules, etc) anything to do with it?

I can't really give you any more details since my co-coworker is unreachable
right now, and this is kinda urgent.

Cheers,
Max.



Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/
http://www.japaninc.net http://www.japaninc.net/
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Apache latest + PHP latest + GD latest + Freetype latest + Jpeg latest

2001-04-08 Thread trogers

Hi
I don't think gd uses freetype by default .. seem to remember having to 
edit the makefile
Tom


At 12:12 PM 5/04/01 +0100, Alex Bloor wrote:
Hi,

Firstly, thanks for reading this message.

Has anyone managed to compile and use :

Apache latest + PHP latest + GD latest + Freetype latest + Jpeg latest
= Apache 1.3.19 + PHP 4.0.4pl1 + GD 1.8.4 + Freetype 2.0.1 + Jpeg 6b

I can get it to compile OK with GD but there seem to be problems with 
Freetype (i.e.
everything I try results in a non-working ImageTtfBBox function). I've 
followed as many
guides to getting it working as I can find, but they mostly refer to older 
versions..

I'm pretty sure this is something reasonably obvious but there doesn't 
seem to be a one-stop
guide to getting it all installed *anywhere* (links would be cool though 
if anyone has them)..

My PHP compile line is :

./configure --with-apache=../apache_1.3.19 --
with-mysql --with-gd --with-ttf=/usr/local/include/freetype2 
--with-jpeg-dir=/u
sr/local --enable-freetype-4bit-antialias-hack --enable-gd-imgstrttf

these look relevant :

checking whether to enable truetype string function in gd... no
checking for libjpeg (needed by gd-1.8+)... yes
checking for jpeg_read_header in -ljpeg... (cached) yes
checking for libXpm (needed by gd-1.8+)... no
configure: warning: If configure fails try --with-xpm-dir=DIR
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageColorClosestHWB in -lgd... (cached) yes
checking for compress in -lz... (cached) yes
checking for png_info_init in -lpng... (cached) yes
checking for gdImageColorResolve in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) yes
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) no
checking for gdImageCreateFromXpm in -lgd... (cached) yes
checking whether to include FreeType 1.x support... no
checking for T1lib support... no
checking whether to include GNU gettext support... no

 checking whether to enable truetype string function in gd... no
checking for libjpeg (needed by gd-1.8+)... yes
checking for jpeg_read_header in -ljpeg... (cached) yes
checking for libXpm (needed by gd-1.8+)... no
configure: warning: If configure fails try --with-xpm-dir=DIR
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageColorClosestHWB in -lgd... (cached) yes
checking for compress in -lz... (cached) yes
checking for png_info_init in -lpng... (cached) yes
checking for gdImageColorResolve in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) yes
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) no
checking for gdImageCreateFromXpm in -lgd... (cached) yes
checking whether to include FreeType 1.x support... no
checking for T1lib support... no
checking whether to include GNU gettext support... no

I *think* it is probably something to do with GD not being compiled 
properly, but this (I am
guessing) is to do with it being freetype 2.0.1 as opposed to 1.x ..

Any light anyone can shed would be great.

Many thanks

Alex

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] No-refresh

2001-04-01 Thread trogers

Hi
I do it using sessions with:

//Check for a reload
$hash = mhash(MHASH_SHA1,serialize($HTTP_POST_VARS));
$hash = bin2hex($hash);
if($hash == $Hash):
 $reload = "Yes";
 echo "reload br";
endif;

$Hash is registered in the session.
Tom


At 02:54 AM 31/03/01 +0100, David Hynes wrote:
Does anyone know of a way to stop the user from refreshing a page several
times.

i.e if I add a value to a database using a form and PHP, I don't want the
user to be able to simply press refresh and add the value to the database
again.

Please help,
Dvaid.

---
Fed202 Solutions
www.fed202solutions.com
Mobile : 07779 293368
---


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] comparing dates works sometimes and fails another time!

2001-03-29 Thread trogers

You are doing a string compare not date, convert them to a unix time stamp 
and then compare

$d1 = explode("-",$date1);
$d2 = explode("-",$date2);
$ts1 = mktime(0,0,0,$d1[1],$d1[2],$d1[0]);
$ts2 = mktime(0,0,0,$d2[1],$d2[2],$d2[0]);
if( $ts1  $ts2 ):
 echo "Date 1 is greater than date2";
elseif($ts1 == $ts2):
 echo "date 1 is equal to date 2" ;
else:
 echo " date 2 is greater than date 1";
endif;

should work :)
Tom
At 09:50 AM 28/03/01 +, kaab kaoutar wrote:
Hi!

$date1="2001-1-7";$date2="2001-1-14";
if ($date1=$date2) echo "date1 is greater then date2";
else echo "date2 is greater then date1";
the result is the first :(
but it works for other dates!

Thanks

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] I need an expert to tell me what I am doing wrong

2001-03-25 Thread trogers

Hi
what you need is:
$sql = "INSERT INTO orders (product,name,email)
:VALUES ('$product','$name','$email')";
You will also need to escape any single quotes in the variables
Tom

At 01:05 PM 24/03/01 +1200, YoBro wrote:
I have tried that, and I have been reading all sorts of info and been
copying it exact, but it still doesn't work. I am not receiving any errors,
but the data just doesn't appear in the database. I have the table set up
and it all works fine in phpMyAdmin, but I cant get my own form to work.

There is a page called order.php with a form that on submit goes to the
discussed page. All field variables are correct. Any other ideas.

: You don't say where the failure is, but I'm guessing its when you do the
: mysql_query. Your INSERT statement looks a bit odd.
: Try:
:
:  $sql = "INSERT INTO orders (product,name,email)
:VALUES ($product,$name,$email)";
:
: John
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
: To contact the list administrators, e-mail: [EMAIL PROTECTED]
:



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session not destroying properly

2001-03-05 Thread trogers

Hi
You will need to kill the session data on the exit of your failed login not 
on entry to the login page as the data will already be overwritten by the 
previous session value.
I use
unset($name);
unset($password);
...

Tom


At 04:24 PM 6/03/01 +0900, Yasuo Ohgaki wrote:
Do you use custom session handlers?
Try session_unset() also. It may help.

Regards,
Yasuo Ohgaki


  Got a problem with sessions.
 
  On my index page, there's a place for people to login.  Well, when I test
  with two different user names (ie: mike and jlo) it reverts to the first
  one when login fails.  For example:
  I enter in the username "myuen" and a wrong password.  I get my
  "Password/Username invalid" message which is what I want.
 
  The page refreshes, the username slot already has myuen in it from the
  last entry, I erase it, enter in a new username "jlo" and the correct
  password and it will not log me in.
 
  I know once you attempt to login, it saves the username as a session
  variable.  On my index.php page, I have a script that checks if a session
  exists (particularly the Username), if it exists, destroy it otherwise,
  continue on.  Obviously it's not destroying it once we enter in a wrong
  username and try to login again.
 
  Any ideas on how to fix this?
 
  Here's my coding:
  ?PHP
  if(session_is_registered("CUserName"))
  session_destroy();
 
  session_register("CUserName");
  $CUserNameSession="CUserName";
 
  //SNIP
  ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]