[PHP] Checking for Javascript funcionality

2003-08-26 Thread hecchan
Hi people,

I think is the PHP scripter needs to know in advance if he can count on 
Client-side scripting capability.
I just start with PHP but wrote this chunk of code to check it.


if (isset($_REQUEST['UA_js'])) {
	session_start();
	$_SESSION['UA_js'] = $_REQUEST['UA_js'];
	if ($_SESSION['UA_js'] == 'true') {
		$_SESSION['UA_coky'] = $_REQUEST['UA_coky'];
		... add more vars
	}
	header( "Location: http://mydomain.com/secondPage.php"; );
	exit;
}
?>



	




	
	
	... add more hidden fields


UA_form = document.forms[0];
UA_form['UA_coky'].value = navigator.cookieEnabled;
... set more values
UA_form.submit();
Then you can send the client the page tailored for him and to know in advance what can you expect from him. It would be nice if the browser sent in the request a flag about this funcionality. Sure this code can be improved (I'd love ideas about it) but think the knowledge of what's exactly is in the other side will pay the extra process. Sorry about my english -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem with IE parsing of PHP output

2003-09-02 Thread hecchan
Hi,
I have a class which write a menu, it works fine with Mozilla and Opera 
but with IE (6 on XP) got a extrange behaviour.
Links works and submenus are open, but the second time the page is 
loaded I can not see the source and if I try to save the file IE says 
some files are missed.
The environment:
Apache 2 on Windows XP PHP, 4.3.2 as apache module on Localhost

mod_rewrite send all the request for valid html/php files internally to 
index.php

if no session
	include javascriptAutoForm_class.php
	(send a client side script, post the result and save post in session, 
saves too original page requested)

include Menu_class.php
include template.php
(From the session pageRequested menu is built and correct content is 
loaded with an include)

The HTML source i can check with opera and Mozilla is correct (all tags 
closed and quoted attributes)

If some one can help or point me in the right direction (if needed can 
send the full script by mail) would be grand

Thanks

hecchan

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


[PHP] Session_start() corrupt HTML output with IE

2003-09-03 Thread hecchan
Hi,
Using IE 6 (XP) i can't see the source generated for PHP even the page 
works properly (It doesn't happend with Mozilla or Opera).

If i comment out the line:
session_start()
This behaviour stops.
Any idea what's going on?
Thanks

hecchan

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