Re: refresh PHP page via onclick event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Or, use form and images as button and you will not get variables at the
end of the link:


<form method=post action=<?= $_SERVER['PHP_SELF'] ?>>
<input type=images src=engFlag.jpg name=lang value=en>
<input type=images src=fraFlag.jpg name=lang value=fr>
</form>


and on the top of the page (php file) before you grab info from database
and language info (maybe i the header file):

<?php
if(isset($_POST['lang']))
{
   $_SESSION['lang'] = mysql_real_escape_string($_POST['lang']);
}
?>


-afan

> On 15 Apr 2006, at 12:51, Alain Roger wrote:
>
>> but i do not want to add some variable at the end of link...
>> when user click on the flag, it should first store language into a
>> $_SESSION
>> variable and after redirect/refresh page.
>
> Not possible. Web pages don't work like that.
>
> You need the flags to link somewhere, and only then can it store the
> details in the session. So either each flag links to its own PHP
> script (pointless), or you follow the advice of Chris and handle it
> that way. However you look at it though, you've got to pass a
> language somehow. Either via the query string, or by calling a unique
> script that handles that language only.
>
> Cheers,
>
> Rich
> --
> http://www.corephp.co.uk
> Zend Certified Engineer
> PHP Development Services
>
> --
> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux