How do I echo this?

Discussion in 'PHP' started by DidierE, Jul 22, 2009.

  1. #1
    Hey guys!
    just a quick question...
    I'm trying to echo a submit button in php. How do i echo the following WITHOUT errors and WITH a working URL when clicked:

    echo '<form><input type="button" value="Submit" onclick="document.location.href='http://www.mydomain.com';"></form>'; 
    PHP:
    I'm having troubles with the ' and "" things and i'm not really a php expert.

    Thanks for your help!!
     
    DidierE, Jul 22, 2009 IP
  2. iam.xavier

    iam.xavier Well-Known Member

    Messages:
    521
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    125
    #2
    This should work for you

    echo "<form><input type=\"button\" value=\"Submit\" onclick=\"document.location.href='http://www.mydomain.com';\"></form>"; 
    PHP:
    Thanks
    -Xak
     
    iam.xavier, Jul 22, 2009 IP
    DidierE likes this.
  3. DidierE

    DidierE Well-Known Member

    Messages:
    1,815
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Thanks buddy!!
    Gave you some green green :)
     
    DidierE, Jul 22, 2009 IP
  4. iam.xavier

    iam.xavier Well-Known Member

    Messages:
    521
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    125
    #4
    Your welcome and thnx fr Green :)

    -Xak
     
    iam.xavier, Jul 22, 2009 IP