This is a discussion on Ajax and PHP: XMLHTTP within the PHP General forums, part of the PHP Programming Forums category; <?=$_SERVER['PHP_SELF']?> Can I replace the above with some sort of XMLHTTP request? Googling now... thought I would ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
<?=$_SERVER['PHP_SELF']?>
Can I replace the above with some sort of XMLHTTP request? Googling now... thought I would ask here first. Any good links to tuts that might cover that sort of thing? Kinda thinking about plugging some Ajax into a random image php script. TIA. :) Cheers, Micky -- Wishlist: <http://snipurl.com/vrs9> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse> |
|
|||
|
Micky Hulse wrote:
> <?=$_SERVER['PHP_SELF']?> > > Can I replace the above with some sort of XMLHTTP request? > > Googling now... thought I would ask here first. > > Any good links to tuts that might cover that sort of thing? > > Kinda thinking about plugging some Ajax into a random image php script. > > TIA. :) > Cheers, > Micky > I think that is a javascript question is it not? Unless you mean to use curl or some such. AJ -- www.deployview.com www.nerds-central.com www.project-network.com |
|
|||
|
Micky Hulse wrote:
> <?=$_SERVER['PHP_SELF']?> > > Can I replace the above with some sort of XMLHTTP request? > As noted, that's a javascript question. However your PHP code is vulnerable to XSS attacks; you should at least encode the output with htmlspecialchars() so that URLs like "foo.php/<script>alert('hi');</script>" are safe. eg. <?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?> Arpad |
|
|||
|
What do you exactly want to do? -----Original Message----- From: Micky Hulse [mailto:micky@ambiguism.com] Sent: Domingo, 10 de Septiembre de 2006 10:46 p.m. To: php php Subject: Ajax and PHP: XMLHTTP <?=$_SERVER['PHP_SELF']?> Can I replace the above with some sort of XMLHTTP request? Googling now... thought I would ask here first. Any good links to tuts that might cover that sort of thing? Kinda thinking about plugging some Ajax into a random image php script. TIA. :) Cheers, Micky -- Wishlist: <http://snipurl.com/vrs9> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse> Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. |
|
|||
|
Hi all, thanks for responses, I appreciate it. :)
Miguel Guirao wrote: > What do you exactly want to do? Oh, I wanted to call a php function on my page that changes some CSS. I was hoping I could change my CSS on the fly without having to reload page... but after doing more research, I think that a page refresh is best way to go. All the Ajax/PHP examples i have seen deal with elements on page (in this case i have PHP script in head that changes my css)... Still new to "Ajax" and XMLHTTP... I know how to handle JS, but I am way more comfortable with PHP. Not too many examps on the web that show some good techniques for calling PHP functions to manipulate CSS that I could find. I am also not a big fan of plugging-in a huge Ajax scripting library(ies) for something as simple as calling a PHP script to manipulate CSS. I would prefer simple on the JS end of things and make it more about PHP without a page refresh. :D Lol, hope that makes sense... In a bit of a rush - headed out door to work. :) You guys are right though, I should probably ask on the JS listserv. Many thanks for your time. Cheers, Micky -- Wishlist: <http://snipurl.com/vrs9> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse> |
|
|||
|
using $_SERVER['PHP_SELF'] is riskless as it represents "The filename
of the currently executing script", unlike REQUEST_URI Arpad Ray wrote: > Micky Hulse wrote: > > <?=$_SERVER['PHP_SELF']?> > > > > Can I replace the above with some sort of XMLHTTP request? > > > As noted, that's a javascript question. However your PHP code is > vulnerable to XSS attacks; you should at least encode the output with > htmlspecialchars() so that URLs like > "foo.php/<script>alert('hi');</script>" are safe. > eg. <?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?> > > Arpad |