[PHP] Re: Strange Problem: session_set_save_handler

2005-07-08 Thread Thorsten Friedrich
Ok,

i try to describe what i´ve done.

i have written a sql-wrapper-class wich is used to insert and update the
entries in the mysql-table.

the mysql-table has the following columns (types)

id varchar(255) - holds the session-id

data blob - holds the session-data

created timestamp - used to identifiy the creation-date

lastmodify timestamp - used to identifiy the last-change on this row

the wrapper-class is created in the read / write / destroy and
timeout -callbackfunction

in the read-function only the row by the session-id is selected

in the write-function first i check if a row by this session-id exists

if not - insert a new row with the give session-id and session-data

if exists - update the row identified by the given session-id

in the destroy-function i drop the row identified by the session-id and
reset the session_set_save_handler

(i´ve read that this function also destroy the handler-settings)

in the timeout-function which is called in the open-function i check if
there are rows older than the given session-timeout (by default set to 1440
seconds)

now the logging:

in the wrapper-class i´ve implemented a function that is able to log every
query made to any table of the database to a file on the server. i think
this should write ALL queries to the log-file even these one made by the
session-handlers.

(perhaps it should be said that i see the DELETE QUERY made by the
timout-function and also the SELECT Query made by the read-function)





ok. at least i again will describe what happens yesterday.

i got this problem and searched the internet for the solution. i´ve found
some articles in different forums but mostly not the answer i needed to
solve the problem.

to see what realy happens i enabled the error_reporting to log really all
what happens (error_reporting=E_ALL).. restarted the webserver (which i´ve
restart several times during this problem) and then it works again. after
disabling the error_reporting (set to E_ALL  ~E_NOTICE) nothing has
changed. it works like the problem hasn´t been.

i know that this step has nothing to do with it... but i want to see if php
returns an error to identify.

so i´m a little bit confused because i´ve neither edited the config-file nor
changed something in my session-functions.



again the problem i HAD :)

when i´ve started the web-application and turned on (i do this by a flag) my
db-based-session-handling the write-function does nothing (no session-data
is added or removed from session-data in the mysql-table). if i turned on
the logging in the sql-wrapper-class (to write the queries made by the
application and wich is also used and called in the handling functions) php
crashes with no error and no output to the browser. so it is a must that php
crashed before the stream to the client is made.

to check if php gives an error if done the following (this is no joke).

i want to produce an error in the write-function by adding a line like this:

adasdfasdf

without the ; in the end it works (sure the write-function doesn´t update
the db-entry)

adding the ; at the and php crashes

to see if post-streaming a error is displayed i logged in via ssh and call a
script by using the following command:

php -q ./script.php same result.



and again: after i´ve changed the loggin in the php.ini from E_ALL 
~E_NOTICE to E_ALL and than again back to E_ALL  ~E_NOTICE the problem has
gone. it now works like the 2 weeks before i restarted the server.

so i hope the problem (i had *G) is better described as in the news-letter.

i you know what the problem is it would be nice to answer because i want to
know how to fix the problem if it occours the next time.



Thx 4 Help and best greetz

Thorsten Friedrich



Thorsten Friedrich [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Hi, i´ve a strange Problem with the session_set_save_handler-Function.

 Firt of all my config:

 in my intranet i´m using 2 servers

 the first server is the db-server running mysql v. 12.22 dist 4.0.24

 the second server is the webserver

 running apache2 Linux apache 2.6.5-7.147-smp running

 and is using php v. 4.3.4

 i´ve written some function to store session-data in a table on the

 mysql-server.

 because of the fact that i´ll never see if the write-session-function is

 called i´ve placed a write-a-log-to-disk function in all session-function
to

 see if they are called.

 when i use files in the /tmp-directory to store the session-data

 everything works fine, but if i switch to the db-based-system php crashes

 with no error message (crash in this case means that a empty page is

 transfered to the client).

 a sideeffect of this problem is the following:

 i use some wrapper-classes to handle database-insert/select and updates.
if

 i use the file-based-session-handling i can select the content of the

 session-table, but when i use the db-based my wrapper class get a empty

 record-set when i try to select the table where the session-data is
stored.

 

[PHP] Re: Strange Problem

2003-07-14 Thread Anthony
You'll get this in IIS if you request a page that should be parsed by the PHP CGI that 
does not exist.  IIS trys to load the script into the CGI but gets no results since 
there was no page to load.  I think it's an IIS bug i.e.   you go to  
www.domain.com/page1.php
but there is no page1.php file.  So you'd expect to get a 404 error.  but IIS gives 
you the CGI error instead.  Kinda sucks, I just use Apache now anyway, so I never 
spent the time to figure out why.

- Anthony
  Haseeb [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]


Hi all, 
this is a very strange problem. i don't know where i am doing something that 
is causing this. the problem is that i am working on a web portal  entirely in  php. i 
have a few hidden pages. that do the queries to the DB. now when i redirect to any 
page for query i get this error
CGI Error
The specified CGI application misbehaved by not returning a complete set of 
HTTP headers. The headers it did return are:

strangely  when i hit F5 or refresh the page i get redirected to the desired 
page. i have checked for any whitespaces. there are none. i have checked and double 
checked this. i am using win2k,IIS, php 4.3.0

again i have checked all the files for any space left that could be causing 
problem but i found none.

i hope i make my self clear.
Haseeb
   
   
   
  
IncrediMail - Email has finally evolved - Click Here

[PHP] Re: strange problem (user poll)

2003-01-08 Thread - \[ Paul Ferrie \] -
Sorry guys ingore the post, i have narrowed the problem down to a problem
with posting the vairables from flash.
cheers

- - [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can anyone see a problem in this?  When i run the script i am getting this
 error Notice: Undefined variable: action in
 C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

 ?
 // addpoll.php
 // Case Study 1: User Poll - Foundation PHP for Flash

 // If the form has been submitted...
 (line 13) if ($action == add) {
 // Include config file
 include('common.php');

 // Connect to database
 $link = dbConnect();

 // Get date for new poll
 $posted = time();

 // Build query to insert new poll
 $query = INSERT INTO polls (question, option1, option2, option3,
 posted)
   VALUES('$question', '$option1', '$option2', '$option3',
 $posted);

 // Execute query
 $result = @mysql_query($query);

 // If query failed...
 if (!$result) {
 // Display error
 print font color=\#ff\Could not insert
poll/fontbr\n;
 } else {
 print font color=\#ff\Poll added/fontbr\n;
 }

 mysql_close($link);
 }
 ?
 please anyone





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




[PHP] Re: strange problem (user poll)

2003-01-08 Thread - \[ Paul Ferrie \] -
It seem there is some probs with the latest release of php something about
global vars.

Jst checked and it works now.  It was the php thing right enough.  i hope
that my server admin have done the same thing with the php.ini

cheers guys.

- - [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Can anyone see a problem in this?  When i run the script i am getting this
 error Notice: Undefined variable: action in
 C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

 ?
 // addpoll.php
 // Case Study 1: User Poll - Foundation PHP for Flash

 // If the form has been submitted...
 (line 13) if ($action == add) {
 // Include config file
 include('common.php');

 // Connect to database
 $link = dbConnect();

 // Get date for new poll
 $posted = time();

 // Build query to insert new poll
 $query = INSERT INTO polls (question, option1, option2, option3,
 posted)
   VALUES('$question', '$option1', '$option2', '$option3',
 $posted);

 // Execute query
 $result = @mysql_query($query);

 // If query failed...
 if (!$result) {
 // Display error
 print font color=\#ff\Could not insert
poll/fontbr\n;
 } else {
 print font color=\#ff\Poll added/fontbr\n;
 }

 mysql_close($link);
 }
 ?
 please anyone





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




[PHP] Re: Strange problem with MAIL

2003-01-06 Thread Manuel Lemos
Hello,

On 01/06/2003 08:22 AM, Cesar Aracena wrote:

I've been trying to make my way around a complex mailing system for the
past couple of days with no success, but now I noticed that I can't just
send a simple:

mail([EMAIL PROTECTED], My Subject, Line 1\nLine 2\nLine 3);

I used to make this scripts work all the time before using the same
hosting but something changed now... is there a way to see what's going
on using phpinfo.php or other way???


mail() is a problematic function that often fails without a clue. 
Sometimes it is a problem in PHP configuration, some times it is a 
problem in the actual mail implementation and other times it is a mail 
server problem.

I think what is more important to start having an idea is for you to 
tell if you are hosted under Unix/Linux or Windows.




--

Regards,
Manuel Lemos


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



[PHP] Re: Strange problem with MAIL (Correction)

2003-01-06 Thread Manuel Lemos
Hello,

On 01/06/2003 08:33 AM, Cesar Aracena wrote:

I just checked my hotmail account (one of three I'm sending to) and all
the emails arrived correctly (sorry for the re-post) but it's not
reaching the other two. One of them, I know it has a very poor
configuration and can hardly receive e-mails from PHP scripts, but the
other one usually works correct (the one I have with the hosting)... Can
anyone tell me what are the headers sent usually so mostly everyone can
receive the mails?


Sometimes the problem is in the type of hosting platform that you are 
using but you did not tell if it is Windows or Unix/Linux.

Anyway, I do not use or recommend mail() function directly at all. I use 
this class to compose and send messages. It has already some built-in 
workaround to many flaws of the mail() function depending on your 
platform. I do not know if your problem is just headers but this class 
puts all the headers that should be there. It also provides mail() 
function replacement functions that use different delivery methods which 
often is a problem depending on your platform.

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos


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



Re: [PHP] Re: Strange problem with PHP,SSI

2002-12-17 Thread sport4ever
Hello

my page is .SHTML format, so I can't use ?php include('path/to/file') ? or
any PHP coding..

another strange thing, I found that the page source contains the included
PHP content, without executing it!!
I mean, when I use the sentince:

!--#include virtual=sympoll/poll.php?id=2 --

I found the follwoing in the source:

?php

  require './booth.php';
  display_booth($id);

?

which is the content of included file (poll.php)!!!

notice that when ever I put this php INCLUDE before any other php INCLUDE
command, it executed perfectly, but the other INCLUDE's would have this
problem (printing out the contents of included file without execution)

As I said before, this problem happens if and only if I include PHP script,
no problems when including SHTML or HTML pages!

please help :(


- Original Message -
From: conbud [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Sport4ever [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 15, 2002 10:39 AM
Subject: [PHP] Re: Strange problem with PHP,SSI


 Sport4ever wrote:
  PHP version: 4.2.1
  OS: RedHat Linux 8
  Apache version: 2.0
 
  My problem is that I can't execute more than one (SSI include) on my
website JUST for PHP file.. so there is NO problems at all if I include HTML
or SHTML files.
 
  Anyway, if I include 2 PHP files into any page, the first INCLUDE
statement would execute correctly and print out the file output, but the
second INCLUDE statement would NOT execute, and instead, the statement
printed in the page source as it is:
 
  !--#include virtual=sympoll/poll.php?id=2 --
 
  notice that this problem was not exist in my server before I upgrade PHP
from 4.1.2 to 4.2.1 and Apache from 1.3 to 2.0 and Linux from 7.3 to 8.0 !!
 
  any idea?
 
 
--

 Hey, you could try using the PHP include

 ?php include('path/to/file') ?

 or

 ?php require('path/to/file') ?


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


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




[PHP] Re: Strange problem with PHP,SSI

2002-12-14 Thread conbud
Sport4ever wrote:

PHP version: 4.2.1
OS: RedHat Linux 8
Apache version: 2.0

My problem is that I can't execute more than one (SSI include) on my website JUST for PHP file.. so there is NO problems at all if I include HTML or SHTML files.

Anyway, if I include 2 PHP files into any page, the first INCLUDE statement would execute correctly and print out the file output, but the second INCLUDE statement would NOT execute, and instead, the statement printed in the page source as it is:

!--#include virtual=sympoll/poll.php?id=2 --

notice that this problem was not exist in my server before I upgrade PHP from 4.1.2 to 4.2.1 and Apache from 1.3 to 2.0 and Linux from 7.3 to 8.0 !!

any idea?




Hey, you could try using the PHP include

?php include('path/to/file') ?

or

?php require('path/to/file') ?


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




[PHP] Re: Strange problem...

2001-12-01 Thread Edgardo Rossetto

Hola Daniel:

Te escribo en castellano ya que veo que el inglés no es tu idioma natural.

Creo que el error se produce al concatenar las variables, acordate que para
indicar que las variables con cadenas tenés que encerrarlas entre , yo lo
definiría así:

$user_birthdate = $birth_year-$birth_month-$birth_day; // 1982-12-08

Saludos

Edgardo

Daniel alsén [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 i have a strange problem.

 I get a users birthdate with three dropdown menus (year, month and day of
 month). I get these values into one string with:

 $user_birthdate = $birth_year . $birth_month . $birth_day;

 If i echo $user_birthdate after this it is correct (mmdd). But when i
 insert the value of $user_birthdate into MySql it gets the value
'8388607'.
 It doesn´t matter what value $user_birthdate had originally - it always
 inserts as 8388607.

 Any ideas???



 The db question looks like this btw:

 $query = INSERT INTO users ;

 $query .= (user_name, user_birthdate, user_city, user_mail, user_icq,
 user_msn, user_www, user_login, user_password) ;

 $query .=  values('$user_name', '$user_birthdate', '$user_city',
 '$user_mail', '$user_icq', '$user_msn', '$user_www', '$user_login',
 '$user_password');


 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #




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