Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8155 > unrolled thread
| Started by | sferreira1979@gmail.com |
|---|---|
| First post | 2013-01-31 10:11 -0800 |
| Last post | 2013-02-06 00:21 +0100 |
| Articles | 14 — 6 participants |
Back to article view | Back to comp.lang.php
script php with <img scr...../> sferreira1979@gmail.com - 2013-01-31 10:11 -0800
Re: script php with <img scr...../> "J.O. Aho" <user@example.net> - 2013-01-31 20:57 +0100
Re: script php with <img scr...../> Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-31 15:09 -0500
Re: script php with <img scr...../> sferreira1979@gmail.com - 2013-02-02 03:11 -0800
Re: script php with <img scr...../> sferreira1979@gmail.com - 2013-02-02 03:20 -0800
Re: script php with <img scr...../> The Natural Philosopher <tnp@invalid.invalid> - 2013-01-31 20:37 +0000
Re: script php with <img scr...../> Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-31 15:42 -0500
Re: script php with <img scr...../> Christoph Becker <cmbecker69@gmx.de> - 2013-01-31 23:19 +0100
Re: script php with <img scr...../> The Natural Philosopher <tnp@invalid.invalid> - 2013-02-01 00:34 +0000
Re: script php with <img scr...../> Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-31 20:16 -0500
Re: script php with <img scr...../> Scott Johnson <noonehome@chalupasworld.com> - 2013-02-01 12:11 -0800
Re: script php with <img scr...../> Christoph Becker <cmbecker69@gmx.de> - 2013-02-05 23:57 +0100
Re: script php with <img scr...../> The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 23:11 +0000
Re: script php with <img scr...../> Christoph Becker <cmbecker69@gmx.de> - 2013-02-06 00:21 +0100
| From | sferreira1979@gmail.com |
|---|---|
| Date | 2013-01-31 10:11 -0800 |
| Subject | script php with <img scr...../> |
| Message-ID | <8693c99b-2331-4f2a-bc3b-4f30d3d2d819@googlegroups.com> |
Hi,
i'm a portuguese's student and i'm trying to learn php by myself (with books and php.net) but i'm experiencing a problem on one of my test:
i have two files: registar_mail.php and captcha.php
captcha.php display an image witch should appear on my file registar_mail.php using
<img src="captcha.php"/> but the image doesn't appear :(
i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp
////// script registar_mail.php//////////
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MAILING LIST</title>
<style type="text/css">
@import url("estilo_mailinglist.css");
</style>
</head>
<body>
<?php
// Ligação à base de dados
//phpinfo();
include("ligacao_bd.php");
// verifica se foi clicado o botão de registar
if(isset($_REQUEST['registar'])) {
// verifica se o código captcha está correto
if($_SESSION['codigo'] == $_POST['codigo']){
// verifica se o campo de email está por preencher
if (empty($_POST['email'])) {
echo "<tr>O campo de endereço de correio eletrónico está vazio! </tr>";
echo "<tr><a href='registar_mail.php'>Clique para tentar de novo!</a></tr>";
}
else {
// verifica se endereço de correio eletrónico esta correto
$email = $_POST['email'];
if(filter_var($email, FILTER_VALIDATE_EMAIL)){
// regista o email
$sql = "INSERT INTO emails(endereco_email, data_registo) VALUES ( '$email' , NOW() ) ";
$consulta = mysql_query($sql);
echo "<table>";
echo "<tr>Obrigado por se registar!</tr>";
echo "<tr><a href='registar_mail.php'>Clique para voltar à página principal!</a></tr>";
} else {
echo "<tr>O endereço de correio eletrónico não é válido! </tr>";
echo "<tr><a href='registar_mail.php'>Clique para tentar de novo!</a></tr>";
} } } }
?>
<table width="800 px" border="0" align="center" class="tabela_geral" cellspacing="0">
<form id="form_registo" name="form_registo" action="registar_mail.php" method="POST">
<tr class="tabela_geral">
<td> Introduza o seu endereço de correio eletrónico para se registar na nossa<i> mailing list</i>!
</td>
</tr>
<tr><td class="tabela_geral">
Endereço de correio eletrónico: <input type="text" size=40 name="email">
</td><tr>
<td>
<img scr='captcha.php' alt="imagem ausente"/> <input type="text" name="codigo"/>
<img src="imagens/imagemcaptcha.png" width="230" height="50" alt="imagemcaptcha"/>
</td>
</tr>
<td>
<input type="submit" name="registar" value="Registar">
<input type="reset" name="apagar" value="Apagar"></td>
</form>
</table>
</body>
</html>
/////script captcha.php//////////////////
<?php
//inicia sessão
session_start();
//definição do tipo de imagem a gerar
header("Content-type:image/png");
//geração da chave
$chave=rand(0,500);
//codificação da chave e apresentacao de 8 carateres
$codigo=substr(sha1($chave),0,8);
$_SESSION['codigo']=$codigo;
//definicao imagem e cor
$imagem= imagecreatefrompng("imagens/imagemcaptcha.png");
$cores= imagecolorallocate($imagem, 255, 55, 0);
//centrar código na figura
imagestring($imagem, 5, 75, 20, $codigo, $cores);
//gerar imagem:Outputs or saves a PNG image from the given image.
imagepng($imagem);
//DESTRUIR IMAGEM
imagedestroy($imagem);
?>
could someone help me to understand what is the problem???
thanks :)
[toc] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2013-01-31 20:57 +0100 |
| Message-ID | <an00kgF9s2qU1@mid.individual.net> |
| In reply to | #8155 |
On 31/01/13 19:11, sferreira1979@gmail.com wrote:
> i have two files: registar_mail.php and captcha.php
> captcha.php display an image witch should appear on my file registar_mail.php using
> <img src="captcha.php"/> but the image doesn't appear :(
> i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp
I won't go into the registar_mail.php
> /////script captcha.php//////////////////
> <?php
> //inicia sessão
> session_start();
>
> //definição do tipo de imagem a gerar
> header("Content-type:image/png");
>
> //geração da chave
> $chave=rand(0,500);
>
> //codificação da chave e apresentacao de 8 carateres
> $codigo=substr(sha1($chave),0,8);
>
> $_SESSION['codigo']=$codigo;
>
> //definicao imagem e cor
> $imagem= imagecreatefrompng("imagens/imagemcaptcha.png");
> $cores= imagecolorallocate($imagem, 255, 55, 0);
>
> //centrar código na figura
> imagestring($imagem, 5, 75, 20, $codigo, $cores);
>
> //gerar imagem:Outputs or saves a PNG image from the given image.
> imagepng($imagem);
>
> //DESTRUIR IMAGEM
> imagedestroy($imagem);
>
> ?>
>
> could someone help me to understand what is the problem???
The code itself is okey to add a easy to automatically read text and
generate a new image, the issue may be with the
imagens/imagemcaptcha.png which has to be in a sub directory to the
captcha.php
I do recommend you use a professional solution for captcha, take a look
at this one:
http://www.google.com/recaptcha
--
//Aho
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-01-31 15:09 -0500 |
| Message-ID | <keej2e$2nb$1@dont-email.me> |
| In reply to | #8155 |
On 1/31/2013 1:11 PM, sferreira1979@gmail.com wrote:
> Hi,
>
> i'm a portuguese's student and i'm trying to learn php by myself (with books and php.net) but i'm experiencing a problem on one of my test:
> i have two files: registar_mail.php and captcha.php
> captcha.php display an image witch should appear on my file registar_mail.php using
> <img src="captcha.php"/> but the image doesn't appear :(
> i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp
>
<snip code>
>
> could someone help me to understand what is the problem???
>
> thanks :)
>
You have a typo in your html:
<img scr='captcha.php' alt="imagem ausente"/>
^^^
Should be "src"
A good way to determine whether the problem is in your html or the
captcha code is to try to load the image in your browser, i.e.,
http://www.example.com/captcha.php
If the image displays, the problem is *probably* in your html (there's
always that bug... :) ). If the image doesn't show, you *probably* have
a problem in your captcha php file.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | sferreira1979@gmail.com |
|---|---|
| Date | 2013-02-02 03:11 -0800 |
| Message-ID | <e944a938-b506-4080-ba7c-e22718806184@googlegroups.com> |
| In reply to | #8157 |
Quinta-feira, 31 de Janeiro de 2013 20:09:40 UTC, Jerry Stuckle escreveu: > On 1/31/2013 1:11 PM, sferreira1979@gmail.com wrote: > > > Hi, > > > > > > i'm a portuguese's student and i'm trying to learn php by myself (with books and php.net) but i'm experiencing a problem on one of my test: > > > i have two files: registar_mail.php and captcha.php > > > captcha.php display an image witch should appear on my file registar_mail.php using > > > <img src="captcha.php"/> but the image doesn't appear :( > > > i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp > > > > > <snip code> > > > > > > could someone help me to understand what is the problem??? > > > > > > thanks :) > > > > > > > You have a typo in your html: > > > > <img scr='captcha.php' alt="imagem ausente"/> > > ^^^ > > > > Should be "src" > > > > A good way to determine whether the problem is in your html or the > > captcha code is to try to load the image in your browser, i.e., > > > > http://www.example.com/captcha.php > > > > If the image displays, the problem is *probably* in your html (there's > > always that bug... :) ). If the image doesn't show, you *probably* have > > a problem in your captcha php file. > > > > -- > > ================== > > Remove the "x" from my email address > > Jerry Stuckle > > JDS Computer Training Corp. > > jstucklex@attglobal.net > > ================== hi!? thanks :) i have correct the img attribute but i'm still having the problem... captcha.php runs correctly in browser, the problems seems to be in registar_mail.php... in debug mode the file captcha.php is not calling by the programe and i don't know why... others sugestions? thanks for your time
[toc] | [prev] | [next] | [standalone]
| From | sferreira1979@gmail.com |
|---|---|
| Date | 2013-02-02 03:20 -0800 |
| Message-ID | <7aa927ff-ee48-4d6b-8c02-b54ae57a1cba@googlegroups.com> |
| In reply to | #8157 |
Quinta-feira, 31 de Janeiro de 2013 20:09:40 UTC, Jerry Stuckle escreveu: > On 1/31/2013 1:11 PM, sferreira1979@gmail.com wrote: > > > Hi, > > > > > > i'm a portuguese's student and i'm trying to learn php by myself (with books and php.net) but i'm experiencing a problem on one of my test: > > > i have two files: registar_mail.php and captcha.php > > > captcha.php display an image witch should appear on my file registar_mail.php using > > > <img src="captcha.php"/> but the image doesn't appear :( > > > i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp > > > > > <snip code> > > > > > > could someone help me to understand what is the problem??? > > > > > > thanks :) > > > > > > > You have a typo in your html: > > > > <img scr='captcha.php' alt="imagem ausente"/> > > ^^^ > > > > Should be "src" > > > > A good way to determine whether the problem is in your html or the > > captcha code is to try to load the image in your browser, i.e., > > > > http://www.example.com/captcha.php > > > > If the image displays, the problem is *probably* in your html (there's > > always that bug... :) ). If the image doesn't show, you *probably* have > > a problem in your captcha php file. > > > > -- > > ================== > > Remove the "x" from my email address > > Jerry Stuckle > > JDS Computer Training Corp. > > jstucklex@attglobal.net > > ================== hi again?! my mistake... i have an other error when i test others issues... i correct the img tag attribute end it's working :) <img src='captcha.php'alt="imagem ausente"/> the session is needing to make this verification: // verifica se o código captcha está correto if($_SESSION['codigo'] == $_POST['codigo']) finally solved :) thanks
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-01-31 20:37 +0000 |
| Message-ID | <keekn1$v85$1@news.albasani.net> |
| In reply to | #8155 |
On 31/01/13 18:11, sferreira1979@gmail.com wrote:
> Hi,
>
> i'm a portuguese's student and i'm trying to learn php by myself (with books and php.net) but i'm experiencing a problem on one of my test:
> i have two files: registar_mail.php and captcha.php
> captcha.php display an image witch should appear on my file registar_mail.php using
> <img src="captcha.php"/> but the image doesn't appear :(
> i have been looking for a solution in forums but i don't find anything witch works with me... i'm working with netbeans and xampp
>
> ////// script registar_mail.php//////////
> !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
> <title>MAILING LIST</title>
> <style type="text/css">
> @import url("estilo_mailinglist.css");
> </style>
> </head>
> <body>
>
>
> <?php
> // Ligação à base de dados
> //phpinfo();
> include("ligacao_bd.php");
>
> // verifica se foi clicado o botão de registar
> if(isset($_REQUEST['registar'])) {
>
> // verifica se o código captcha está correto
> if($_SESSION['codigo'] == $_POST['codigo']){
>
> // verifica se o campo de email está por preencher
> if (empty($_POST['email'])) {
> echo "<tr>O campo de endereço de correio eletrónico está vazio! </tr>";
> echo "<tr><a href='registar_mail.php'>Clique para tentar de novo!</a></tr>";
> }
> else {
>
> // verifica se endereço de correio eletrónico esta correto
> $email = $_POST['email'];
> if(filter_var($email, FILTER_VALIDATE_EMAIL)){
>
> // regista o email
> $sql = "INSERT INTO emails(endereco_email, data_registo) VALUES ( '$email' , NOW() ) ";
> $consulta = mysql_query($sql);
>
> echo "<table>";
> echo "<tr>Obrigado por se registar!</tr>";
> echo "<tr><a href='registar_mail.php'>Clique para voltar à página principal!</a></tr>";
>
> } else {
> echo "<tr>O endereço de correio eletrónico não é válido! </tr>";
> echo "<tr><a href='registar_mail.php'>Clique para tentar de novo!</a></tr>";
> } } } }
> ?>
> <table width="800 px" border="0" align="center" class="tabela_geral" cellspacing="0">
> <form id="form_registo" name="form_registo" action="registar_mail.php" method="POST">
> <tr class="tabela_geral">
> <td> Introduza o seu endereço de correio eletrónico para se registar na nossa<i> mailing list</i>!
> </td>
> </tr>
> <tr><td class="tabela_geral">
> Endereço de correio eletrónico: <input type="text" size=40 name="email">
> </td><tr>
> <td>
> <img scr='captcha.php' alt="imagem ausente"/> <input type="text" name="codigo"/>
> <img src="imagens/imagemcaptcha.png" width="230" height="50" alt="imagemcaptcha"/>
>
> </td>
> </tr>
> <td>
> <input type="submit" name="registar" value="Registar">
> <input type="reset" name="apagar" value="Apagar"></td>
> </form>
> </table>
> </body>
> </html>
>
> /////script captcha.php//////////////////
> <?php
> //inicia sessão
> session_start();
Bad move. Nio sessions pelae!
>
> //definição do tipo de imagem a gerar
> header("Content-type:image/png");
>
> //geração da chave
> $chave=rand(0,500);
>
> //codificação da chave e apresentacao de 8 carateres
> $codigo=substr(sha1($chave),0,8);
>
> $_SESSION['codigo']=$codigo;
>
> //definicao imagem e cor
> $imagem= imagecreatefrompng("imagens/imagemcaptcha.png");
> $cores= imagecolorallocate($imagem, 255, 55, 0);
>
> //centrar código na figura
> imagestring($imagem, 5, 75, 20, $codigo, $cores);
>
> //gerar imagem:Outputs or saves a PNG image from the given image.
> imagepng($imagem);
>
> //DESTRUIR IMAGEM
> imagedestroy($imagem);
>
> ?>
>
> could someone help me to understand what is the problem???
>
> thanks :)
>
The simplest php script to send a picture is this
<? php5
header("Content-Type: image/jpeg");
$fh = fopen("myfile.jpg", "r");
fpassthru($fh);
flose($fh)';
// and leave the ?> OUT of things.
// and sessions.
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-01-31 15:42 -0500 |
| Message-ID | <keel0a$dd3$1@dont-email.me> |
| In reply to | #8158 |
On 1/31/2013 3:37 PM, The Natural Philosopher wrote:
> On 31/01/13 18:11, sferreira1979@gmail.com wrote:
>> Hi,
>>
>> i'm a portuguese's student and i'm trying to learn php by myself (with
>> books and php.net) but i'm experiencing a problem on one of my test:
>> i have two files: registar_mail.php and captcha.php
>> captcha.php display an image witch should appear on my file
>> registar_mail.php using
>> <img src="captcha.php"/> but the image doesn't appear :(
>> i have been looking for a solution in forums but i don't find anything
>> witch works with me... i'm working with netbeans and xampp
>>
>> ////// script registar_mail.php//////////
>> !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml">
>> <head>
>> <meta http-equiv="Content-Type" content="text/html;
>> charset=iso-8859-1" />
>> <title>MAILING LIST</title>
>> <style type="text/css">
>> @import url("estilo_mailinglist.css");
>> </style>
>> </head>
>> <body>
>>
>>
>> <?php
>> // Ligação à base de dados
>> //phpinfo();
>> include("ligacao_bd.php");
>>
>> // verifica se foi clicado o botão de registar
>> if(isset($_REQUEST['registar'])) {
>>
>> // verifica se o código captcha está correto
>> if($_SESSION['codigo'] == $_POST['codigo']){
>>
>> // verifica se o campo de email está por preencher
>> if (empty($_POST['email'])) {
>> echo "<tr>O campo de endereço de correio eletrónico está vazio!
>> </tr>";
>> echo "<tr><a href='registar_mail.php'>Clique para tentar de
>> novo!</a></tr>";
>> }
>> else {
>>
>> // verifica se endereço de correio eletrónico esta correto
>> $email = $_POST['email'];
>> if(filter_var($email, FILTER_VALIDATE_EMAIL)){
>>
>> // regista o email
>> $sql = "INSERT INTO emails(endereco_email, data_registo) VALUES (
>> '$email' , NOW() ) ";
>> $consulta = mysql_query($sql);
>>
>> echo "<table>";
>> echo "<tr>Obrigado por se registar!</tr>";
>> echo "<tr><a href='registar_mail.php'>Clique para voltar à página
>> principal!</a></tr>";
>>
>> } else {
>> echo "<tr>O endereço de correio eletrónico não é válido! </tr>";
>> echo "<tr><a href='registar_mail.php'>Clique para tentar de
>> novo!</a></tr>";
>> } } } }
>> ?>
>> <table width="800 px" border="0" align="center" class="tabela_geral"
>> cellspacing="0">
>> <form id="form_registo" name="form_registo" action="registar_mail.php"
>> method="POST">
>> <tr class="tabela_geral">
>> <td> Introduza o seu endereço de correio eletrónico para se registar
>> na nossa<i> mailing list</i>!
>> </td>
>> </tr>
>> <tr><td class="tabela_geral">
>> Endereço de correio eletrónico: <input type="text" size=40 name="email">
>> </td><tr>
>> <td>
>> <img scr='captcha.php' alt="imagem ausente"/> <input type="text"
>> name="codigo"/>
>> <img src="imagens/imagemcaptcha.png" width="230" height="50"
>> alt="imagemcaptcha"/>
>>
>> </td>
>> </tr>
>> <td>
>> <input type="submit" name="registar" value="Registar">
>> <input type="reset" name="apagar" value="Apagar"></td>
>> </form>
>> </table>
>> </body>
>> </html>
>>
>> /////script captcha.php//////////////////
>> <?php
>> //inicia sessão
>> session_start();
>
> Bad move. Nio sessions pelae!
>>
>> //definição do tipo de imagem a gerar
>> header("Content-type:image/png");
>>
>> //geração da chave
>> $chave=rand(0,500);
>>
>> //codificação da chave e apresentacao de 8 carateres
>> $codigo=substr(sha1($chave),0,8);
>>
>> $_SESSION['codigo']=$codigo;
>>
>> //definicao imagem e cor
>> $imagem= imagecreatefrompng("imagens/imagemcaptcha.png");
>> $cores= imagecolorallocate($imagem, 255, 55, 0);
>>
>> //centrar código na figura
>> imagestring($imagem, 5, 75, 20, $codigo, $cores);
>>
>> //gerar imagem:Outputs or saves a PNG image from the given image.
>> imagepng($imagem);
>>
>> //DESTRUIR IMAGEM
>> imagedestroy($imagem);
>>
>> ?>
>>
>> could someone help me to understand what is the problem???
>>
>> thanks :)
>>
>
>
> The simplest php script to send a picture is this
> <? php5
> header("Content-Type: image/jpeg");
> $fh = fopen("myfile.jpg", "r");
> fpassthru($fh);
> flose($fh)';
>
> // and leave the ?> OUT of things.
> // and sessions.
>
>
Which has nothing to do with his problem (or a solution to it).
And in your example, the simplest way to do it is to not use PHP at all.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | Christoph Becker <cmbecker69@gmx.de> |
|---|---|
| Date | 2013-01-31 23:19 +0100 |
| Message-ID | <keeqkr$8nh$1@speranza.aioe.org> |
| In reply to | #8158 |
The Natural Philosopher wrote: > > On 31/01/13 18:11, sferreira1979@gmail.com wrote: >> >> session_start(); > > Bad move. Nio sessions pelae! Why is starting a session a bad move? -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-02-01 00:34 +0000 |
| Message-ID | <kef2ii$qi3$2@news.albasani.net> |
| In reply to | #8160 |
On 31/01/13 22:19, Christoph Becker wrote: > The Natural Philosopher wrote: >> >> On 31/01/13 18:11, sferreira1979@gmail.com wrote: >>> >>> session_start(); >> >> Bad move. Nio sessions pelae! > > Why is starting a session a bad move? > > -- Christoph M. Becker > I dont thinks a strict file download can set a cookie. I could be wrong in that. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-01-31 20:16 -0500 |
| Message-ID | <kef518$ers$1@dont-email.me> |
| In reply to | #8161 |
On 1/31/2013 7:34 PM, The Natural Philosopher wrote: > On 31/01/13 22:19, Christoph Becker wrote: >> The Natural Philosopher wrote: >>> >>> On 31/01/13 18:11, sferreira1979@gmail.com wrote: >>>> >>>> session_start(); >>> >>> Bad move. Nio sessions pelae! >> >> Why is starting a session a bad move? >> >> -- Christoph M. Becker >> > I dont thinks a strict file download can set a cookie. > > I could be wrong in that. Wrong answer (as usual). -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Scott Johnson <noonehome@chalupasworld.com> |
|---|---|
| Date | 2013-02-01 12:11 -0800 |
| Message-ID | <keh7hg$87a$1@dont-email.me> |
| In reply to | #8162 |
On 1/31/2013 5:16 PM, Jerry Stuckle wrote: > On 1/31/2013 7:34 PM, The Natural Philosopher wrote: >> On 31/01/13 22:19, Christoph Becker wrote: >>> The Natural Philosopher wrote: >>>> >>>> On 31/01/13 18:11, sferreira1979@gmail.com wrote: >>>>> >>>>> session_start(); >>>> >>>> Bad move. Nio sessions pelae! >>> >>> Why is starting a session a bad move? >>> >>> -- Christoph M. Becker >>> >> I dont thinks a strict file download can set a cookie. >> >> I could be wrong in that. > > Wrong answer (as usual). > *puts the popcorn on*
[toc] | [prev] | [next] | [standalone]
| From | Christoph Becker <cmbecker69@gmx.de> |
|---|---|
| Date | 2013-02-05 23:57 +0100 |
| Message-ID | <kes2ph$3c9$1@speranza.aioe.org> |
| In reply to | #8161 |
The Natural Philosopher wrote: > On 31/01/13 22:19, Christoph Becker wrote: >> >> Why is starting a session a bad move? >> > I dont thinks a strict file download can set a cookie. > > I could be wrong in that. According to RFC 2109 section 4.2.1 a session (not to be confused with a PHP session) is initiated by sending an extra request header (Set-Cookie) in the response. And even a strict file download consists of a HTTP request and an according response. So no problem here. :) -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-02-05 23:11 +0000 |
| Message-ID | <kes3iv$jn6$3@news.albasani.net> |
| In reply to | #8301 |
On 05/02/13 22:57, Christoph Becker wrote: > The Natural Philosopher wrote: > >> On 31/01/13 22:19, Christoph Becker wrote: >>> >>> Why is starting a session a bad move? >>> >> I dont thinks a strict file download can set a cookie. >> >> I could be wrong in that. > > According to RFC 2109 section 4.2.1 a session (not to be confused with a > PHP session) is initiated by sending an extra request header > (Set-Cookie) in the response. And even a strict file download consists > of a HTTP request and an according response. So no problem here. :) > I stand corrected. Do all browsers honor it though? -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Becker <cmbecker69@gmx.de> |
|---|---|
| Date | 2013-02-06 00:21 +0100 |
| Message-ID | <kes464$71q$1@speranza.aioe.org> |
| In reply to | #8302 |
The Natural Philosopher wrote: > On 05/02/13 22:57, Christoph Becker wrote: >> The Natural Philosopher wrote: >> >>> On 31/01/13 22:19, Christoph Becker wrote: >>>> >>>> Why is starting a session a bad move? >>>> >>> I dont thinks a strict file download can set a cookie. >>> >>> I could be wrong in that. >> >> According to RFC 2109 section 4.2.1 a session (not to be confused with a >> PHP session) is initiated by sending an extra request header >> (Set-Cookie) in the response. And even a strict file download consists >> of a HTTP request and an according response. So no problem here. :) >> > I stand corrected. > > Do all browsers honor it though? Every browser is free to ignore the Set-Cookie header anyway. However, I expect browsers to handle this the same independent of the Content-Type. -- Christoph M. Becker
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web