Re: [PHP] emulating enable_trans_sid
That'd be great -- for inspiration if nothing else :) Justin French on 01/07/02 6:35 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: > Hi > It just so happens I have been playing with an html parser making an html > to xml converter. I started with phpHTMLparse class but it couldn't cope > with the html generated by microsoft so I have modified it to better handle > carriage returns,white space,comments and embedded commands in the html. > Your quite welcome to the files if it'll help. > Tom > > At 04:03 PM 1/07/2002 +1000, Justin French wrote: >> on 01/07/02 3:36 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: >> >>> Ok probably the easiest is just to add >>> to the end of each url, if cookies are supported SID will be an empty >> string. >> >> I want to avoid this, because it adds a level of complexity to the >> construction of pages that I'm not comfortable with. With multiple writers, >> designers and programmers passing stuff around, it'll be way too easy to >> loose the session. >> >> I'm not really looking for "easiest", I'm looking for "the solution", >> regardless of how long it take to perfect, because this will be a write-once >> solution that I'll use over and over. >> >> It's quite possible that the end solution will require a decent HTML parser >> or state engine. Fun fun :) >> >> >> Justin French >> >> >> -- >> 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
Re: [PHP] emulating enable_trans_sid
Hi It just so happens I have been playing with an html parser making an html to xml converter. I started with phpHTMLparse class but it couldn't cope with the html generated by microsoft so I have modified it to better handle carriage returns,white space,comments and embedded commands in the html. Your quite welcome to the files if it'll help. Tom At 04:03 PM 1/07/2002 +1000, Justin French wrote: >on 01/07/02 3:36 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: > > > Ok probably the easiest is just to add > > to the end of each url, if cookies are supported SID will be an empty > string. > >I want to avoid this, because it adds a level of complexity to the >construction of pages that I'm not comfortable with. With multiple writers, >designers and programmers passing stuff around, it'll be way too easy to >loose the session. > >I'm not really looking for "easiest", I'm looking for "the solution", >regardless of how long it take to perfect, because this will be a write-once >solution that I'll use over and over. > >It's quite possible that the end solution will require a decent HTML parser >or state engine. Fun fun :) > > >Justin French > > >-- >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
RE: [PHP] emulating enable_trans_sid
Justin > It's quite possible that the end solution will require a decent HTML parser > or state engine. Fun fun :) Do you have any JS that will have to be "altered" because of what you're trying to do. 'Cause if you have to write an HTML parser, you'd prob have to write a JS parser too :) More fun for ya! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] emulating enable_trans_sid
on 01/07/02 3:36 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: > Ok probably the easiest is just to add > to the end of each url, if cookies are supported SID will be an empty string. I want to avoid this, because it adds a level of complexity to the construction of pages that I'm not comfortable with. With multiple writers, designers and programmers passing stuff around, it'll be way too easy to loose the session. I'm not really looking for "easiest", I'm looking for "the solution", regardless of how long it take to perfect, because this will be a write-once solution that I'll use over and over. It's quite possible that the end solution will require a decent HTML parser or state engine. Fun fun :) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] emulating enable_trans_sid
Hi Ok probably the easiest is just to add to the end of each url, if cookies are supported SID will be an empty string. Tom At 01:59 PM 1/07/2002 +1000, you wrote: >I'm aware of this. What I'm trying to do is emulate this process on servers >which have not compiled with --enable_trans_sid. I thought that was pretty >clear, but perhaps not. > >In the ideal world, enable_trans_sid would have been compiled, but I'm yet >to find many shared hosts where this has been done. And since shared >servers seem to be what my current client set are using, I'm looking at >emulating enable_trans_sid. > >Regards, > >Justin French > > > >on 01/07/02 1:07 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: > > > Hi > > enable_trans_sid does exactly what you are trying to re create, if no > > cookies are available it modifies all the urls automatically. > > and transparently > > Tom > > > > > > At 12:48 PM 1/07/2002 +1000, Justin French wrote: > >> Hi, > >> > >> As discussed a few months back, I'm interested attempting to recreate > PHP's > >> enable_trans_sid feature, for users without cookies. > >> > >> ONLY if cookies are UNavailable, I want to open the output buffer, > build the > >> page, then run a reg exp or something over the output to append SIDs > to all > >> URLs (GET), then print it. > >> > >> I've got a pretty good picture in my head of how I'll test for > cookies, and > >> how I'll do the output buffering, but regexp's are NOT my thing :) > >> > >> I'm interested in hearing some opinions on the most efficient way to > append > >> the SID to all internal URLs on the page... this would include: > >> > >> - header("Location: something.php") > >> - > >> - > >> > >> My thoughts are that it would only be done for relative links > >> (dir/something.php), NOT for fully qualified URLs (http://otherdomain.com, > >> ftp://, mailto:, https://, ?), as per enable_trans_sid documentation. > >> > >> It would also have to accommodate URLs which already have a query > string... > >> if there's an existing query string, just append &SID, otherwise append > >> ?SID. > >> > >> > >> This seems to me like a rather in-depth regexp already, and I'm sure i'm > >> forgetting something. > >> > >> Perhaps there's a simpler way that I'm missing? The only simpler way > I can > >> think of would be to search for '.php' and '.php?' and act > accordingly, but > >> this has obvious problems when 'something.php' is type, but not in context > >> of a link or header redirection. > >> > >> Where would I look to see the source of enable_trans_sid -- maybe this > will > >> give me some hints?? > >> > >> > >> Justin French > >> > >> > >> -- > >> 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] emulating enable_trans_sid
I'm aware of this. What I'm trying to do is emulate this process on servers which have not compiled with --enable_trans_sid. I thought that was pretty clear, but perhaps not. In the ideal world, enable_trans_sid would have been compiled, but I'm yet to find many shared hosts where this has been done. And since shared servers seem to be what my current client set are using, I'm looking at emulating enable_trans_sid. Regards, Justin French on 01/07/02 1:07 PM, Tom Rogers ([EMAIL PROTECTED]) wrote: > Hi > enable_trans_sid does exactly what you are trying to re create, if no > cookies are available it modifies all the urls automatically. > and transparently > Tom > > > At 12:48 PM 1/07/2002 +1000, Justin French wrote: >> Hi, >> >> As discussed a few months back, I'm interested attempting to recreate PHP's >> enable_trans_sid feature, for users without cookies. >> >> ONLY if cookies are UNavailable, I want to open the output buffer, build the >> page, then run a reg exp or something over the output to append SIDs to all >> URLs (GET), then print it. >> >> I've got a pretty good picture in my head of how I'll test for cookies, and >> how I'll do the output buffering, but regexp's are NOT my thing :) >> >> I'm interested in hearing some opinions on the most efficient way to append >> the SID to all internal URLs on the page... this would include: >> >> - header("Location: something.php") >> - >> - >> >> My thoughts are that it would only be done for relative links >> (dir/something.php), NOT for fully qualified URLs (http://otherdomain.com, >> ftp://, mailto:, https://, ?), as per enable_trans_sid documentation. >> >> It would also have to accommodate URLs which already have a query string... >> if there's an existing query string, just append &SID, otherwise append >> ?SID. >> >> >> This seems to me like a rather in-depth regexp already, and I'm sure i'm >> forgetting something. >> >> Perhaps there's a simpler way that I'm missing? The only simpler way I can >> think of would be to search for '.php' and '.php?' and act accordingly, but >> this has obvious problems when 'something.php' is type, but not in context >> of a link or header redirection. >> >> Where would I look to see the source of enable_trans_sid -- maybe this will >> give me some hints?? >> >> >> Justin French >> >> >> -- >> 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
Re: [PHP] emulating enable_trans_sid
Hi enable_trans_sid does exactly what you are trying to re create, if no cookies are available it modifies all the urls automatically. and transparently Tom At 12:48 PM 1/07/2002 +1000, Justin French wrote: >Hi, > >As discussed a few months back, I'm interested attempting to recreate PHP's >enable_trans_sid feature, for users without cookies. > >ONLY if cookies are UNavailable, I want to open the output buffer, build the >page, then run a reg exp or something over the output to append SIDs to all >URLs (GET), then print it. > >I've got a pretty good picture in my head of how I'll test for cookies, and >how I'll do the output buffering, but regexp's are NOT my thing :) > >I'm interested in hearing some opinions on the most efficient way to append >the SID to all internal URLs on the page... this would include: > >- header("Location: something.php") >- >- > >My thoughts are that it would only be done for relative links >(dir/something.php), NOT for fully qualified URLs (http://otherdomain.com, >ftp://, mailto:, https://, ?), as per enable_trans_sid documentation. > >It would also have to accommodate URLs which already have a query string... >if there's an existing query string, just append &SID, otherwise append >?SID. > > >This seems to me like a rather in-depth regexp already, and I'm sure i'm >forgetting something. > >Perhaps there's a simpler way that I'm missing? The only simpler way I can >think of would be to search for '.php' and '.php?' and act accordingly, but >this has obvious problems when 'something.php' is type, but not in context >of a link or header redirection. > >Where would I look to see the source of enable_trans_sid -- maybe this will >give me some hints?? > > >Justin French > > >-- >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