Forum Moderators: open
On the other hand, do you know if IE5 will read the stylesheet when you bring it in with <link> instead of @import? I realize this may give you NN4 troubles, but you might get around that with a browser sniffer.
The problem is, we have lots of content editors of varying html ability, and we are trying to push them all towards validation (as apposed to the tag soup that regualrly gets published). This is the only part of our template that doesnt validate, and we kind of need to 'practice what we preach' :(
It's also a great trick for shortening the length of the address. Here's exactly what I mean:
Your existing address might be something like this:
file.php?page=intro&style=manilla
This is how I would code it:
file.php?intro-manilla
You can use any symbol you like to separate the variables.
What I've done is scrapped the 'page' and 'style' definitions as you can work those out from the string! Normally you would access the variables like this at the start of the page (in PHP):
$page = $_GET['page'];
$style = $_GET['style'];
Here though is the code required to do away with getting the 'page' and 'style' variables completely:
$all = $_SERVER['QUERY_STRING'];
list ($page, $style) = split ('-', $all);
The only drawback would be if you kept swapping the order of the variables around.
A bit of topic
I have in a previous topic discussed about a solution to reduce the number of passed variables and it was suggested that I could put all datas in one variable and play with string comparaison (php?var=key8key22key3520) - like Ebay does.
I have tried to implement but got stuck with forms coz it will always return the usual (I know I could do sonething using Javascript - write all data in a hidden text field - but not the best solution)
Cheers
OK, but what if data are passed through form?
A form method is by post by default (and should be, due to the length limitation of GET) so there would be nothing available in $ENV{QUERY_STRING}.
Furthermore, this requires hard-coding in a particular order that's fine for small projects but over time can be a real burgeon to work around as a project grows. (What number what that one? 22? 23? OOPS it's zero-based . . . )
The original problem **could** be solvable by using the encoded characters for & and = :
key_1%3Dvalue_1%26key_2%3Dvalue_2 . . . .
I say could because I haven't checked it for validation, but if encoded characters validate - voila.