newb: Expain me this

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnny

    #1

    newb: Expain me this

    I have the following code:

    exec ("find /C \"$term\" *", $command_output );

    Can you tell me how this string: "find /C \"$term\" *"
    will appear after excaping characters?

    Thank you

  • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

    #2
    Re: newb: Expain me this

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    johnny wrote:
    I have the following code:
    >
    exec ("find /C \"$term\" *", $command_output );
    >
    Can you tell me how this string: "find /C \"$term\" *"
    will appear after excaping characters?
    find /C "$term" *


    - --
    - ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-


    Proudly running Debian Linux with 2.6.17-1-686 kernel, KDE3.5.3, and PHP
    5.2.0-8 generating this signature.
    Uptime: 02:07:36 up 8:15, 1 user, load average: 0.03, 0.19, 0.58

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFFiIzqR56 dWuhgxGgRAufmAK DFvF3qB3/M82AFBE900FKmuo 7aJQCfSiAo
    MQhgJY1TaS0TodR uWk3+MD8=
    =p3rc
    -----END PGP SIGNATURE-----

    Comment

    • seaside

      #3
      Re: newb: Expain me this


      johnny schrieb:
      I have the following code:
      >
      exec ("find /C \"$term\" *", $command_output );
      >
      Can you tell me how this string: "find /C \"$term\" *"
      will appear after excaping characters?
      Each \ in conjunction with the next characte gets replaced by the next
      character.

      Comment

      • Curtis

        #4
        Re: newb: Expain me this

        Also, you should be using the escapeshellarg( ) function on variables
        passed to shell commands, especially if they contain user input. Even
        register globals could be a potential problem if you're not expecting
        user input.

        Escape a string to be used as a shell argument


        On Dec 19, 4:59 pm, "johnny" <rampet...@gmai l.comwrote:
        I have the following code:
        >
        exec ("find /C \"$term\" *", $command_output );
        >
        Can you tell me how this string: "find /C \"$term\" *"
        will appear after excaping characters?
        >
        Thank you

        Comment

        Working...