You are here: Re: $_SESSION array goes blind when inserting <img src=""> into it « PHP Programming Language « IT news, forums, messages
Re: $_SESSION array goes blind when inserting <img src=""> into it

Posted by shimmyshack on 06/29/07 11:53

On Jun 29, 10:45 am, Joey33 <konrad...@gmail.com> wrote:
> Hello to all people of good will,
>
> On one page I insert into $_SESSION at 'mykey' a value:
>
> <div onclick="parent.load_pic()" id="foto_0"><img alt="image" src=""/
>
> ></div>
>
> It comes from a form and is assigned as usual:
> $_SESSION['mykey']=$the_above_long_string
>
> And on another page when I start the session and try to read the
> $_SESSION array the $_SESSION['mykey'] is empty.
>
> All the other values set elsewhere are right there in $_SESSION array.
>
> I tried addslashes(), htmlentities() but nothing works. To my surprise
> it doesn't work in FF, in IE it's ok.
>
> I also discovered that SRC="" attribute is the problem, when I skip it
> or misspell it, everything works fine.
>
> Any idea? Thanks in advance,
> Joey_33

it works in both, session stuff is independent of browser!!
however since its html you need to view source to see. try this:

file1.php
<?php
session_start();
$_SESSION['mykey']='<div onclick="parent.load_pic()" id="foto_0"><img
alt="image" src=""></div>';
?>


file2.php
<?php
session_start();
var_dump($_SESSION);
?>

then view the source. It does work in firefox, to see that highligh
right click and view selection source. (cant just use view source
because the view source window doesnt send the cookie header)

I can confident say that it works, IE cannot be different to FF
because the data is sent to the browser as html, the only thing that
is exchanged between the server and the browser is a 32 char long
string of letters and numbers.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация