elrohir 0 Report post Posted June 1, 2006 THANK YOU, anwiii!... In my opinion, anybody who does not have basic javascript enabled does not deserve the print feature... they can bliddy well copy & paste the whole feaking page Share this post Link to post Share on other sites
Spectre 0 Report post Posted June 1, 2006 *Sigh. I won't even bother with that one. You just stay in your little world. Anyway, .hack//GU, I would appreciate it if you could please make your descriptions a little clearer and take the time to consider which forum to place your questions in in the future. I don't know why I would have assumed you wanted to use PHP to do the actual printing after posting this in the PHP forum... how stupid of me, right elrohir? Share this post Link to post Share on other sites
elrohir 0 Report post Posted June 2, 2006 Well, you cannot deny that echoing javascript works, and there is a reason to have it in PHP, but perhaps some people just code differently than others. From my point of view, it is either that or a die(), which I despise, and don't use... All I am saying is that PHP does not do clientside operations, so I doubt that there is a way of printing a page with PHP. If there was, it would probably do the exact same thing as the echo method - it would do it with a clientside script. I can see your point of view when you say that it would do the same thing, and I know that it would not be PHP doing the actual printing, but it is the best solution I know of. It is in PHP quotes, which was the aim, according to .hack//GU, so who cares what is doing the job, so long as it gets done? Do you have a better idea, Spectre? Agree to the choice of forum though Share this post Link to post Share on other sites
Spectre 0 Report post Posted June 3, 2006 I don't want to argue about this with you anymore. You clearly know little about PHP - which is fine, but just don't pretend otherwise. It's not a difficult language to learn, so perhaps you could take the time one day. I'm not trying to pretend I'm an expert or anything either. Echoing static text does nothing that you couldn't do without putting it into a static file. Echoing JavaScript with PHP does not use PHP at all, other than to output the plaintext code. Just to re-iterate for the 300th time. Printing can be achieved with PHP (although possibly not directly - ie. executing a system call on the server side to print data) - why you would use it for such a purpose I don't know, but it is possible. Having the server print files via PHP and having JavaScript print files via the client's browser are two very different things. I don't know why you would even suggest outputting JavaScript from PHP as a method that uses PHP, because it doesn't. It is an alternative way, yes, but it is completely irrelavent to PHP. PHP is not natively capable of processing JavaScript code. This is the last time I am going to post in this thread. I'm glad .hack//GU's problem appears to be solved; although it seems it was completey different from as he originally described. And because it doesn't seem to be getting through: no matter how you want to acheive it, text which is sent as output via PHP is never treated as anything other than text. Therefore... <!-- Having this in a HTML file: --><script language="JavaScript">alert('blah');</script><!-- Is identical to having this in a PHP file: --><?phpecho '<script language="JavaScript">alert(\'blah\');</script>';// Orecho "<script language=\"JavaScript\">alert('blah');</script>";// Ordie('<script language="JavaScript">alert(\'blah\');</script>');// Orexit('<script language="JavaScript">alert(\'blah\');</script>');// Orprint('<script language="JavaScript">alert(\'blah\');</script>');?> Share this post Link to post Share on other sites
moldboy 0 Report post Posted June 3, 2006 No offence, but you two are nuts, you're not even arguing and yet seem to think that you are. One says you can't print with PHP (atleast not for the client) And the other one say that PHP doesn't parse javascript code. Both very good points, and very true, however they don't confict.Now Echoing JavaScript with PHP does not use PHP at allyes it does, if you do something with php it uses php when you write echo "some JS code"; it uses php, it just does.I don't know why you would even suggest outputting JavaScript from PHP as a method that uses PHP, because it doesn't. again if you use php to echo something then you DO use php, and why, perhapse elrohir felt it would be a good idea if .hack//GU knew you could enclose javascript inside the echo statement, and perhapse then bu knowing that .hack//GU would be able to have something which would only offer the print command to users who were signed in so//set user logged in state$loggedin = TRUE;//determin output based on previous decisionif ($loggedin ==TRUE){echo "the print command (I don't do JS)";}else {echo "I'm sorry the print option is only available to registered users"} Share this post Link to post Share on other sites
Spectre 0 Report post Posted June 3, 2006 *Sigh. Here we go again. Despite saying my previous post would be my last in this topic.. moldboy, please don't argue just for the sake of arguing. This is getting ridiculous and childish. Outputting JavaScript via PHP involves PHP doing nothing outside of sending the data as output; it has absolutely no influence over nor is it all influenced by how the outputted JavaScript operates. Obviously, having PHP send output is using PHP; I was referring to the fact that it is not using PHP to instigate whatever operation the JavaScript will then execute. In this case, there is absolutely no benefit in having PHP send JavaScript as output over simply having it contained staticly within a file - quite the opposite in fact, it will result in further processing power being required in order to have the PHP output a non-dynamic piece of plaintext, especially if you use doublequotes as elrohir suggested. Illogical, pointless things frustrate me no end. Share this post Link to post Share on other sites
elrohir 0 Report post Posted June 3, 2006 lol, doesnt have to be double quotes, if you insist - but I dont think that one line of code will greatly influence parsing time unless you have a freaking slow server and a 5 bps server. But say you have this huge page of code, with a switch on $page_id, and heredoc constructs for page output. Obviously, if you put the JS as plain html, it will appear on every single page which the switch concerns - This may not be very desirable, so you would then put it in PHP. Please, try to look from a different point of view. I am not saying that the result is any different from just plain html, or that PHP would be the one doing the printing. All I am saying - and ask Moldboy, who seems to understand my point - is that there is a benefit in putting it inside PHP. Even though PHP would not do the actual printing. And even though it could be done with just plain html/JS... I agree that this is getting silly, but I still find it hilarious that you have not grasped the point yet. But is .hack//GU even following this post? In the time we have spent arguing, he has most likely finished his site and started selling like heill... I really would like to finish my own, you know.... Moldboy, you obviously did not read the whole thread properly. But Spectre, you did not answer my question: Do you have a better PHP way of doing it? Share this post Link to post Share on other sites
Spectre 0 Report post Posted June 3, 2006 I seem to remember suggesting how to physically print with PHP in the first post I made in this thread - the only post which, might I point out, actually addressed the problem exactly as .hack//GU described it. I'm not saying there is never a benefit to dynamically displaying JavaScript code. If you read my previous post, I said 'In this case, there is absolutely no benefit...'. Yet you continue to insist there is. I'm glad you find my refusal to agree with pointlessly wasting time and inability to build an empty argument on that 'hilarious'. I share a similar view of your inability to grasp logic and reason. Share this post Link to post Share on other sites
elrohir 0 Report post Posted June 3, 2006 wee then we are all happy then, and since .hack//GU is not really taking part, I guess we solved his problem somewhere along the line. If so, why the hell are we discussing this? Share this post Link to post Share on other sites