[PHP] PHP.ini Session section

2002-04-09 Thread Mauricio Sthandier

Does anybody have a Session section of the php.ini working on Windows 2000 ?
I'm not able to make my session persistent along pages... perhaps a bad
configuration of IIS ?
Should I move to Linux ? :)



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




[PHP] Re: session problem?

2002-04-09 Thread Mauricio Sthandier

I have the same problem... I thought it was for a different reason... If you
got a solution please email me !!!

Bob [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 1.php?2.php
 session_start(); session_start();
 .. ..
 $_SESSION['a'] =$a;echo $_SESSION['a'];
 $_SESSION['b'] =$b; echo $_SESSION['b'];
 header(location: 2.php);

 there is an warning: undefined index a ,b.


 after  change

 1.php 2.php
 session_start(); session_start();
 .. ..
 $_SESSION['a'] =$a;echo $_SESSION['a'];
 $_SESSION['b'] =$b; echo $_SESSION['b'];
 a href='2.php' go on /a

 it works well?
 why?


 thanks!



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




[PHP] How can I persist a session ?

2002-04-08 Thread Mauricio Sthandier

Hi... i'm trying to authenticate users in my pages. But every time it gives
me a different session_id ! And I can't use my previously registered
variables...
I started sessions with this code :



  session_start();
   include config.php;
   $db_handler = mysql_connect($db_server,$db_username,$db_password);
   mysql_select_db($db_database,$db_handler);
   $resultado = mysql_query(SELECT password FROM $db_table WHERE login =
'$login';,$db_handler);
   If (mysql_num_rows($resultado) == 1){
  If (mysql_result($resultado, 0) == $password){
   session_name(taag);
session_register(login);



which I use in other pages like this :



// to continue session, I know I don't have to use it when its on
session_autostart
session_start();
 echo Registrada: .session_is_registered(login);
 echo Sesion : .session_id();
echo Login : .$login;
 echo Login :.$_SESSION[login];
 echo Login :.$HTTP_SESSION_VARS[login];

// al of them are empty
// I also used isset and isempty but neither works.

If (!session_is_registered(login)) {
  die(You don't exist !);
}
else
{
header(Location : products.htm);
}

---

  This is my php.ini config :

[Session]
session.save_handler = files
session.save_path = C:\PHP\pruebas\taag\sesiones
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path =
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check = 1
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 20
session.use_trans_sid = 0
url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry

I also use register_globals=on.

What's wrong 



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




[PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I guess thist must be really silly... but how can I append text to the
beginning of a file ???
I've been trying since a while... but all I get is overwriting !.



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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I already seen it... I used r+ and aw.
I saw and example in www.php.net, in the fopen function description, but it
is incomplete...
this is taking me hours !!!.
Well, if I can preappend... how can I read, for example, the first 8 chars
of the last line I inserted ?. They have no fixed length.
I'm starting to feel silly :(.

Chris Boget [EMAIL PROTECTED] escribió en el mensaje
news:01bd01c1d0f6$3fc51f60$[EMAIL PROTECTED]...
  I guess thist must be really silly... but how can I append text to the
  beginning of a file ???
  I've been trying since a while... but all I get is overwriting !.

 Check out fopen().  There is an argument that you can use in that function
 call to determine how the data is sent to the file.

 Chris




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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

I guess I should do that.
I need the plain file because is just a log of users registering in a Club,
in a csv format.
Using a database is just too much and not intended for this page... even
when I would prefer using mysql. At least, I can handle that rather than the
fopen and fwrite !.
I could append but then I need to read the first 8 chars of the last line I
appended... neither something I know how to do.
If they were fixed I could... maybe I can fill it with blank chars the line
until a given size ?

Thanxs everyone for your replies.

Miguel Cruz [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
  I guess thist must be really silly... but how can I append text to the
  beginning of a file ???
  I've been trying since a while... but all I get is overwriting !.

 Open a temporary file, write your new data to it, copy the old file on to
 the end of it, remove the old file, rename the temporary file with the old
 file's name.

 Obviously this is not very efficient. Explore whether you really need to
 prepend. Perhaps you can append and then read the file backwards a la tac?
 Or perhaps a database is more useful. Or multiple files.

 miguel




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




Re: [PHP] Append to the beginning of a file...

2002-03-21 Thread Mauricio Sthandier

Well, here's a lousy solution to a lousy problem :
(please don't crucify my code since I know it's not depurated)


---
$archivo = fopen(./registrados.txt, a+);
if ($archivo) {

$posicion = fseek($archivo, -512, SEEK_END);
$datos = fread($archivo, 7);
$entero = intval(substr($datos, 2, 5));
If (empty($entero) || !is_int($entero)) {
$entero = 1000;
}
$entero++;
$socio = str_repeat(0, 5 - strlen(strval($entero))).strval($entero);

$linea = \n\$socio\;\$fecha\;\$nombre
$apellido\;\$rut\;\$fono\;\$direccion\;\$comuna\;\$ciudad\;\$pai
s\;\$edad\;\$email\;\$select_familiares\;\$select_lugar_compra\;\$
cocina\;\$select_personas_cocinan\;\$recetario\;
$linea = $linea . str_repeat( , 512 - strlen($linea));
fseek($archivo, 0, SEEK_END);
fwrite ($archivo, $linea, 512);
fclose($archivo);

-

It does works... sounds amazing after this hours... helps everybody, you are
fine people !!!



Miguel Cruz [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
  I could append but then I need to read the first 8 chars of the last
line I
  appended... neither something I know how to do.

 Seek to the end of the file minus typical record length, read,
 look for the penultimate end-of-record delimiter (\n, probably) in there,
 and you've found your final record. If you don't find a delimiter, read
 some more and tack it onto the beginning of your string, then check again.
 Repeat until batter contains no large lumps.

 miguel




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




Re: [PHP] Email Attachment

2002-02-04 Thread Mauricio Sthandier

Thanxs... I couldn't use your script (because of my lack of experiencie
maybe) but you gave me a very good hint about what to look for.
I sent an attachment (with a class located in this URL :
http://renoir.vill.edu/~ylee/mailfile.txt), but that wasn't what my boss was
thinking of.
(Now he tells !)
Anyway, is useful and I repeat my gratitude.

Frank Hertogs [EMAIL PROTECTED] escribió en el mensaje
000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp">news:000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp...
 This should do the trick, experiment wit hit;

 function mail_attachment($email, $buffer)
  {
 //subject
 $subject = Testing pdf attachment..
 //sender
 $x_sender = F. Hertogs;
 //extra (optional) headers
 $x_headers = From: [EMAIL PROTECTED]\n;
 $x_headers .= PHP mailer\n;
 $x_headers .= MIME-version: 1.0\n;
 //tell mail program it's multipart/mixed
 $x_headers .= Content-type: multipart/mixed; ;
 //tell mail program what boundary looks like
 $x_headers .= boundary=\Message-Boundary\\n;
 //encoding
 $x_headers .= Content-transfer-encoding: 7BIT\n;
 //to prevent error in case email is empty (I only use this for testing
 //normally; use php or javascript to check forms before submitting
 if(!IsSet($email))
  $email = [EMAIL PROTECTED];
 //first boundary
 $body = --Message-Boundary\n;
 //start text message
 $body .= Content-type: text/plain; charset=US-ASCII\n;
 $body .= Content-transfer-encoding: 7BIT\n;
 $body .= Content-description: Mail message body\n\n;
 //text for message
 $body .= Dear sir,\n\nHere is the requested file blabla
 //end text message
 $body .= \n\n--Message-Boundary\n;
 //start application pdf in this example
 $body .= Content-type: application/pdf name=\attach.pdf\\n;
 $body .= Content-Transfer-Encoding: base64\n;
 $body .= Content-disposition: attachment; filename=\attach.pdf\\n\n;
 $enc_pdf = chunk_split(base64_encode($buffer));
 $body .= $enc_pdf . \n; }
 $body .= --Message-Boundary--\n;
 //mail actual message
 mail($email, $subject, $body, $x_headers);
 }

 I hope this helps you.

 Frank.

 -Oorspronkelijk bericht-
 Van: Mauricio Sthandier [mailto:[EMAIL PROTECTED]]
 Verzonden: vrijdag 1 februari 2002 20:45
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Email Attachment

 Hello, I'm new in php development... I was wondering how can I attach a
 Word
 (.doc) Document in an email sent with the mail() function (if I can do
 it
 just with it).

 I know it has to see with the additional headers of the email, but I
 would
 be grateful If anyone could tell where can i go to for this specific
 information.

 I couldn't find it in PHP manual (.pdf version).

 Thanxs !




 --
 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, visit: http://www.php.net/unsub.php




[PHP] Email Attachment

2002-02-01 Thread Mauricio Sthandier

Hello, I'm new in php development... I was wondering how can I attach a Word
(.doc) Document in an email sent with the mail() function (if I can do it
just with it).

I know it has to see with the additional headers of the email, but I would
be grateful If anyone could tell where can i go to for this specific
information.

I couldn't find it in PHP manual (.pdf version).

Thanxs !




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