PHP/Javascript/HTML problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Reply Via Newsgroup

    #16
    Re: PHP/Javascript/HTML problem

    Phil Powell wrote:[color=blue]
    > I am having a potential PHP/Javascript/HTML conflict going on in my
    > code that I simply can't resolve - been wracking my brain for a good
    > hour over this one and have come up with no good solution.
    >
    > My resulting HTML tag MUST look like this:
    >
    > quote:
    > <a href=index.php? section=person& action=delete_d ept&id=1
    > onClick="return isOKDelete('Are you sure you wish to delete Department
    > \"Phil\"?')" >
    >
    >
    > Where
    >
    > $deptName = 'Phil'
    > and
    > $section = 'person'
    > and
    > $action = 'delete_dept'
    >
    > I can't figure out how to write my PHP code to ensure that that HTML
    > tag will look like the above example and work in a
    > dynamically-generated Javascript function, ALL at the very same time!
    >
    > Help appreciated, this is a showstopper for my app!
    >
    > Thanx
    > Phil
    >
    > PS: I need this cross-posted in the hope of finding someone as equally
    > skilled in PHP as in Javascript to be able to come up with the best
    > idea for this as I can't.[/color]


    I've not read the long list of posts the come forward with javascript
    solutions, but I think its a PHP issue, and you should go to

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    and look into

    urldecode(), urlencode(), rawurlencode() and rawurldecode()

    One of them is bound to get you there...

    randelld

    Comment

    • Randy Webb

      #17
      Re: PHP/Javascript/HTML problem

      Reply Via Newsgroup wrote:[color=blue]
      > Phil Powell wrote:
      >[color=green]
      >> I am having a potential PHP/Javascript/HTML conflict going on in my
      >> code that I simply can't resolve - been wracking my brain for a good
      >> hour over this one and have come up with no good solution.
      >>
      >> My resulting HTML tag MUST look like this:
      >>
      >> quote:
      >> <a href=index.php? section=person& action=delete_d ept&id=1
      >> onClick="return isOKDelete('Are you sure you wish to delete Department
      >> \"Phil\"?')" >
      >>
      >>
      >> Where
      >>
      >> $deptName = 'Phil'
      >> and
      >> $section = 'person'
      >> and
      >> $action = 'delete_dept'
      >>
      >> I can't figure out how to write my PHP code to ensure that that HTML
      >> tag will look like the above example and work in a
      >> dynamically-generated Javascript function, ALL at the very same time!
      >>
      >> Help appreciated, this is a showstopper for my app!
      >>
      >> Thanx
      >> Phil
      >>
      >> PS: I need this cross-posted in the hope of finding someone as equally
      >> skilled in PHP as in Javascript to be able to come up with the best
      >> idea for this as I can't.[/color]
      >
      >
      >
      > I've not read the long list of posts the come forward with javascript
      > solutions, but I think its a PHP issue, and you should go to
      >
      > www.php.net
      >
      > and look into
      >
      > urldecode(), urlencode(), rawurlencode() and rawurldecode()
      >
      > One of them is bound to get you there...[/color]

      The problem is not PHP related, its javascript related and has to do
      with the quoting order and the only thing you can change in PHP to "fix"
      that is to have it issue a different quote order.


      --
      Randy
      Chance Favors The Prepared Mind
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      Working...