Professional Web Applications Themes

Calling a php Function from an onClick event - Adobe Dreamweaver & Contribute

I need to create a hyperlink that calls a php function when clicked. How would I do that (with or without Javascript)? Any feedback is appreciated!...

Sponsored Links
  1. #1

    Default Calling a php Function from an onClick event

    I need to create a hyperlink that calls a php function when clicked. How would I do that (with or without Javascript)? Any feedback is appreciated!
    Sponsored Links
    jip Guest

  2. #2

    Default Re: Calling a php Function from an onClick event

    On 09 May 2005 in macromedia.dreamweaver.appdev, jip wrote:
    > I need to create a hyperlink that calls a php function when clicked.
    > How would I do that (with or without Javascript)?
    <a href="myscript.php">Call my script</a>

    What exactly are you trying to do?

    --
    Joe Makowiec
    [url]http://makowiec.net/[/url]
    Email: [url]http://makowiec.net/email.php[/url]
    Joe Makowiec Guest

  3. #3

    Default Re: Calling a php Function from an onClick event

    I am trying to destroy a few session variables, then reroute to the login page
    when a user clicks a "logout" link. In addition, there are instances where it
    would be helpful to be able to call a function on the page by clicking a link.

    jip Guest

  4. #4

    Default Re: Calling a php Function from an onClick event

    You can`t call a PHP function from clicking a link. All the PHP is processed
    before the page is sent to the browser, so you can`t call a PHP function
    from javascript. All you can do is to call a php page which runs the
    function.

    Create a PHP page that destroys your session variables, then you can use the
    header() command to redirect back to the login page.


    --
    Gareth - TMM Dreamweaver
    [url]http://www.dreamweavermxsupport.com/[/url]
    [url]http://www.garethdp.com/[/url]

    PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
    [url]http://www.phploginsuite.co.uk/[/url]

    Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
    Co-Author: Practical Intranet Development - Apress
    Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
    Co-Author: Dreamweaver MX: PHP Web Development - Wrox


    gareth Guest

  5. #5

    Default Re: Calling a php Function from an onClick event

    Thanks for the feedback gareth!
    jip Guest

Similar Threads

  1. are there any event handlers besides onClick?
    By Byron Adams in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: January 16th, 09:48 AM
  2. Onclick event
    By delali in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: October 7th, 10:20 PM
  3. Replies: 0
    Last Post: August 24th, 10:59 AM
  4. Newbie Q: calling access data on onclick function
    By Jeremy in forum ASP Database
    Replies: 1
    Last Post: July 8th, 11:35 AM
  5. Sending event or calling function in flash from director?!
    By Peleg Kurland in forum Macromedia Director Lingo
    Replies: 1
    Last Post: October 24th, 08:32 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139