[PHP] problems with func_get_arg()
Hi, Using the following code snippet function doHead() { header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) . " GMT"); if (func_num_args() == 2) { doTitle(func_get_arg(0), func_get_arg(1)); } else { doTitle(func_get_arg(0)); } if I pass 2 argument into the function then I get the following error * Fatal error*: func_get_arg(): Can't be used as a function parameter but passing 1 argument is ok as is using the following code with 2 arguments function doHead() { header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) . " GMT"); if (func_num_args() == 2) { $a = func_get_arg(0); $b = func_get_arg(1); doTitle($a, $b); } else { doTitle(func_get_arg(0)); } Is there a particualr reason for this or is it a bug? PHP/4.1.2 on Debian Stable (PowerPC) /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML compliance with forms and trans_sid when using sessions
Hi, How do I get PHP to output an HTML tag instead of and XML tag when using trans_sid and a form in PHP. (eg) php outputs but I don't want the trailing / /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML compliance with forms and trans_sid when using sessions
Lars Torben Wilson wrote: >On Thu, 2002-02-21 at 09:45, James Nord wrote: > >>Hi, >> >>How do I get PHP to output an HTML tag instead of and XML tag when using >>trans_sid and a form in PHP. >> >>(eg) >> php outputs >> >> >> >>but I don't want the trailing / >> >>/James >> > >I already told you how in the bug system: use output buffering to >catch the output and remove the slash. > Hmm I didn't get an email copy of your reply and I was expecting one :-/ >But you'd be *breaking* >compliance with this. > Yes you are right about the HTML conformance my bad. But I would only be breaking conformance for XHTML/XML output - which I'm not using in any case. As you point out HTML can "take it or leave it" Unfortunatly I know some that need to leave it. >If you would state exactly what the problem with the slash being >there is, perhaps we could help you. > The HTML renderer that comes with Java (jfc) renders the '>' due to the '/' being before it. There may well be others (or older browser versions too) that choke on it . Oh well - output buffers it is then... /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML compliance with forms and trans_sid when using sessions
Lars Torben Wilson wrote: >On Thu, 2002-02-21 at 14:11, James Nord wrote: > >>Unfortunatly I know some that need to leave it. >> >>>If you would state exactly what the problem with the slash being >>>there is, perhaps we could help you. >>> >>The HTML renderer that comes with Java (jfc) renders the '>' due to the >>'/' being before it. There may well be others (or older browser >>versions too) that choke on it . >> >>Oh well - output buffers it is then... >> >>/James >> >>-- >>Technology is a word that describes something that doesn't work yet. >> Douglas Adams >> > >What is the actual component which is having a hard time rendering this? > The JTextPane Example below, import javax.swing.*; import java.net.*; import java.awt.*; public class foo { public static void main(String[] args) throws Exception { new foo(args[0]); } public foo(String url) throws Exception { Frame f = new Frame("Trailing Slash bug"); JTextPane html = new JTextPane(); f.add(html); f.pack(); f.show(); html.setPage(new URL(url)); html.setEditable(false); } } /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php