.... Thank you. David. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <4297262b_2@x-privat.org> [ref] => [htmlstate] => on_nl2br [postusername] => Ing. [ip] => davigre@hotmail [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> > > > ... > > class=button> > class=button> > class=button> > class=button> > class=button> > class=button> > class=button> > >[/ref] Why don't you just submit using POST method?
In the form handler member.php you just get the clicked button $m = current(keys($_REQUEST['Agregar'])); // Result: $m contains either 2015530 or 2015610 depending on which button was clicked. // Now just add those n+1 buttons you had there.... If you were wondering: in a form that has multiple submit buttons, only the one that is clicked is submitted, so it's a good way to do this. So in this case, nothing but the button that was clicked is sent. And in the form handler we just recieve the array index of it. -- "I am pro death penalty. That way people learn their lesson for the next time." -- Britney Spears com [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <4297262b_2@x-privat.org> [htmlstate] => on_nl2br [postusername] => Kimmo [ip] => eternal.erectio [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> > > > ... > > class=button> > class=button> > class=button> > class=button> > class=button> > class=button> > class=button> > > > Thank you. > > David. > >[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <429917aa_1@x-privat.org> [ref] => <4297262b_2@x-privat.org> [htmlstate] => on_nl2br [postusername] => David [ip] => davigre_spam@ho [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 5 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> How Can I 'run' a php file without showing it? - PHP Development

How Can I 'run' a php file without showing it? - PHP Development

I have the folllowing problem: In a html page I show several 'buttons'. This buttons have a onclick="Agregar([a number])". The 'Agregar(number)' function calls a php file. This php file UPDATES a row in a MYSQL database using the number. Up to here is OK. I don't want to show the: "?m=number" (in the URL, when I call the pHP file) or best... That the PHP files runs transparentely. or at least with a POST method to send the parameters (number) The code I have is somethig like: <script language="JavaScript"> <!-- function Agregar(matnum) { window.location.href="member.php?m=" + matnum; } // --> </script> ...

  1. #1

    Default How Can I 'run' a php file without showing it?

    I have the folllowing problem:

    In a html page I show several 'buttons'. This buttons have a
    onclick="Agregar([a number])". The 'Agregar(number)' function calls a php
    file. This php file UPDATES a row in a MYSQL database using the number. Up
    to here is OK.

    I don't want to show the: "?m=number" (in the URL, when I call the pHP file)

    or best... That the PHP files runs transparentely.
    or at least with a POST method to send the parameters (number)

    The code I have is somethig like:

    <script language="JavaScript">
    <!--
    function Agregar(matnum) {
    window.location.href="member.php?m=" + matnum;
    }
    // -->
    </script>

    ....

    <input type="button" value="agregar" onclick="Agregar(2011310)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2011410)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2012010)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2012110)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2015510)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2015530)"
    class=button>
    <input type="button" value="agregar" onclick="Agregar(2015610)"
    class=button>


    Thank you.

    David.


    Ing. Guest

  2. #2

    Default Re: How Can I 'run' a php file without showing it?

    Ing. David Méndez wrote: 

    Use an iframe to call the PHP file, which can reload the parent page with
    javascript when finished. Note that for this to work, both files should run
    on the same domain.


    JW



    Janwillem Guest

  3. #3

    Default Re: How Can I 'run' a php file without showing it?

    Ing. David Méndez wrote:
     

    doent.images['someImage'].src="phpFile.php?m=" + matnum;
     

    <img name="someImage" src="phpFile.php" width="1" height="1">

    Then, the URL is never seen (to most anyway).

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Randy Guest

  4. #4

    Default Re: How Can I 'run' a php file without showing it?

    "Ing. David Méndez" <com> kirjoitti
    viestissä:org... 

    Why don't you just submit using POST method?

    <form action='member.php'>
    <input type="submit" value="agregar" name="Agregar[2015530]" class=button>
    <input type="submit" value="agregar" name="Agregar[2015610]" class=button>
    </form>

    In the form handler member.php you just get the clicked button

    $m = current(keys($_REQUEST['Agregar']));

    // Result: $m contains either 2015530 or 2015610 depending on which button
    was clicked.
    // Now just add those n+1 buttons you had there....

    If you were wondering: in a form that has multiple submit buttons, only the
    one that is clicked is submitted, so it's a good way to do this. So in this
    case, nothing but the button that was clicked is sent. And in the form
    handler we just recieve the array index of it.
    --
    "I am pro death penalty. That way people learn
    their lesson for the next time." -- Britney Spears

    com


    Kimmo Guest

  5. #5

    Default Re: How Can I 'run' a php file without showing it?

    Thank You all !!

    I think Kimmo Laine solution is what I was expecting, a POST method
    Solution.

    bye.
    David.

    "Ing. David Méndez" <com> wrote in message
    news:org... 
    file) 


    David Guest

Similar Threads

  1. Php File Showing As Text
    By george in forum PHP Development
    Replies: 4
    Last Post: April 12th, 11:30 PM
  2. Folders not showing in PS7 File Browser
    By 8thNote@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 3
    Last Post: March 2nd, 07:59 PM
  3. file upload not showing up in /tmp linux
    By Jim in forum PHP Development
    Replies: 2
    Last Post: August 11th, 03:51 PM
  4. Showing an HTML file in part of a Webform
    By Tor Inge Rislaa in forum ASP
    Replies: 4
    Last Post: August 2nd, 01:26 AM
  5. include file not showing on linked page
    By bob62 webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 28th, 11:48 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