Re: [PHP] 2 questions: Search in array and detect JS

2006-04-15 Thread fabien champel
js is client-side, php server side...
it can't work

fabien

 Chrome wrote:
  How about
 
  ?php $js = true; ?
 
  noscript
?php $js = false; ?
  /noscript
 
  ?php
  if ($js)  {
// whizzy Ajax code (or file include)
  } else {
// generic warning (or include non-JS base file)
  }
  ?
 
  I know that would work but does it give the desired effect?
 
  Dan
 
 
  ---
  http://chrome.me.uk

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



Re: [PHP] 2 questions: Search in array and detect JS

2006-04-15 Thread fabien champel
for js detection, you can use that in a previous page :

script type=text/javascript
document.write('a href=ajax-page.htmlpage/a');
/script
noscripta href=simple-page.htmlpage/a/noscript


it is simple, and work fine.
no need to have cookies enable

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



Re: [PHP] JavaScript+Html+PH

2005-05-17 Thread fabien champel
no




javascript won't call a php function. you'll need to open another page
or do it in javascript

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



Re: [PHP] mysql_connect vs mysql_pconnect

2004-11-27 Thread fabien champel
ok, i'm sorry, i was probably too tired.


i've search the doc, but didn't found this page :
http://www.php.net/manual/en/features.persistent-connections.php

will me excuse me ?

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



[PHP] mysql_connect vs mysql_pconnect

2004-11-26 Thread fabien champel
hello,
I do not know when I must use mysql_pconnect instead of the mysql_connect :(

what are the real advantages of persistent connections, please ?

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



Re: [PHP] Sequrity without HTTPS?

2004-11-20 Thread fabien champel
update ;)

also support non-javascript browser






?php
session_start();
if ( function_exists(session_regenerate_id) ) session_regenerate_id();

// pour les tests, sinon, a recuperer dans la base
$lepass = md5(1234);
$lelogin = login;

$l = $_GET[login];
$p = $_GET[pass];

if ( isset($l)  $l==$lelogin  isset($p) 
isset($_SESSION[graindesel])  ($p ==
md5($lepass.$_SESSION[graindesel]) || md5($p)==$lepass) ){
$logged = true;
unset($_SESSION[graindesel]);
} else {
srand(time());
$grain = sha1( rand() );
$_SESSION[graindesel] = $grain;
$logged = false;
}


echo '?xml version=1.0 encoding=iso-8859-1?';
?

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleauth md5/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /

?php  if ( !$logged ) { ?
script type=text/javascript src=md5.js/script
script type=text/javascript
!--
function goForm(){
motdepasse = document.formul.pass.value;
md5 = hex_md5(hex_md5(motdepasse)+?php echo $grain; ?);
document.formul.pass.value = md5;
document.formul.action = ?php echo $_SERVER[PHP_SELF]; ?;
document.formul.submit();
}
--
/script
?php } ?
/head
body


?php  if ( !$logged ) { ?

form method=GET action=?php echo $_SERVER[PHP_SELF]; ? name=formul
input type=text name=login id=login /br /
input type=password name=pass id=pass /br /
input type=submit value=envoyer /
/form
script type=text/javascript
!--
document.formul.action = javascript:goForm();
--
/script

?php } else { ?
ok ;)
?php } ?
/body
/html


it's not as secure as https, but it's better than without it.

what do you think about it ?

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



Re: [PHP] Sequrity without HTTPS?

2004-11-19 Thread fabien champel
you can fint sha1 and md5 functions in javascript here :
http://pajhome.org.uk/crypt/md5/index.html

__

example :

before html
?php
session_start();
if ( function_exists(session_regenerate_id) ) session_regenerate_id();

$l = $_POST[login];
$p = $_POST[pass];
$lemd5 = md5(1234.$_SESSION[str]);

if ( isset($l)  $l==login  isset($p)  $p == $lemd5 ){
$logged = true;
unset($_SESSION[str]);
} else {
srand(time());
$myStr = sha1( rand() );
$_SESSION[str] = $myStr;
$logged = false;
}
?


in head :
?php  if ( !$logged ) { ?
script type=text/javascript src=md5.js/script
script type=text/javascript

function goForm(){
val = document.formul.pass.value;
md5 = hex_md5(val+?php echo $myStr; ?);
document.formul.pass.value = md5;
document.formul.action = index.php;
document.formul.submit();
}

/script
?php } ?


and in body
?php  if ( !$logged ) { ?

form method=POST action=javascript:goForm() name=formul
input type=text name=login id=login /br /
input type=password name=pass id=pass /br /
input type=submit value=envoyer /

/form
?php } else { ?
ok ;)
?php } ?


i hope that it can be useful :-)

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