Results 1 to 5 of 5

Thread: sed question

  1. #1
    Join Date
    Jan 2004
    Posts
    18

    Unanswered: sed question

    How can I change $PHP_SELF into $_POST["PHP_SELF"]
    Murat SULUHAN
    Live Free or Die

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525

    Re: sed question

    Originally posted by msuluhan
    How can I change $PHP_SELF into $_POST["PHP_SELF"]
    This should what you are asking...

    echo '$PHP_SELF' | sed 's/\$\(.*\)/$_POST["\1"]/'

    I suspect your requirement is a little more complicated than that though (?).

    Damian

  3. #3
    Join Date
    Jan 2004
    Posts
    18
    thank you so much
    Murat SULUHAN
    Live Free or Die

  4. #4
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    Obviously you realise that the following would give the same result but I'm assuming there is more to the problem that you have said, so I posted the more flexible solution.
    Code:
    echo '$PHP_SELF' | sed 's/\$PHP_SELF/$_POST["PHP_SELF"]/'

  5. #5
    Join Date
    Jan 2004
    Posts
    18
    I wanted to develop a script, and your text would be very useful for me, thanks again
    Murat SULUHAN
    Live Free or Die

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •