1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

New 2 PHP

Discussion in 'PHP' started by AndyFarrell, Apr 12, 2010.

  1. #1
    hey everyone.
    i have been using c# for web development for a while and a few days ago i started building a site in php.
    i am 80% done but i have a simple problem.

    i have no clue to call a function onClick of an image button. i know how to code the function i just don`t know how to call it.

    thanks in advance.
     
    AndyFarrell, Apr 12, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,498
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Hi

    You've fallen into the trap of thinking that PHP is used everywhere... it's not. PHP works in partnership with Javascript. PHP outputs text files that just so happen to be HTML. The web browser reads the HTML and uses links, forms and javascript to do the rest.

    Is your image a submit button on a form? a link to another page? or does it need to make something happen on the current page?
    How you code it depends on the answer.
     
    sarahk, Apr 12, 2010 IP
  3. markup

    markup Peon

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I hope you know , what is client side script and what is serverside script

    When u click on image , some evet occur (onClick) , those are client side event

    if you want to send some data to server and do some work on data , you have to use GET or POST method

    If you understand above concept , you can do lot
     
    markup, Apr 12, 2010 IP
  4. capt_nemo777

    capt_nemo777 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <input type="button" onClick="yourjavascriptfunction();" />
     
    capt_nemo777, Apr 12, 2010 IP