Results 1 to 4 of 4

Thread: php onclick

  1. #1
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default php onclick

    how to navigate from one html page to another using php onclick.?
    i want to insert my html page data in database by submitting it at the same time after submitting it should navigate to another html page how to do this??

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Read this for some background information:
    http://dynamicdrive.com/forums/showthread.php?t=25847

    PHP is serverside and does not have any interaction with the user. Javascript has something called "onclick" but that is not part of PHP.
    If you want "something to happen" when you "click", then just make a link to another PHP page and it will load.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default

    you can use the path of destination page into form tag like this :
    <form action="destination.php">

    and in the desination.php, u can write a script to submit data into database...



    another way to accomplish this task is to redirect the page on destination link ... hop it l b helpful...

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    A (less secure but more to your solution) solution would be to send values in the address this can be altered by the user though so sql injections are possible and should be filtered. onclick="window.location.href ="sitename.php? + javadomainvalues"; ";

    This is all in theory though. I havent tested this.

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
  •