Loading ...
Sorry, an error occurred while loading the content.

Multiple submits for a form

Expand Messages
  • arunissatan
    Hi, This may be a stupid question, since I m *very* new to this. I ve got a form with two submit buttons. As I understand it, a form can only have 1 action, so
    Message 1 of 6 , Jun 16, 2003
    • 0 Attachment
      Hi,
      This may be a stupid question, since I'm *very* new to this.

      I've got a form with two submit buttons. As I understand it, a form
      can only have 1 action, so processing the option selected must be done
      by scripting. My code to do this works fine.
      The problem I'm facing is that I use "require_once()" to include the
      appropriate file, as per the submit button used. However, these
      included files reside in separate directories, and their relative URLs
      fail, since the current path is not the directory in which the inluded
      file resides. I could relocate the included files and modify their
      realtive URLs, but I don't think it's the right way to go about it.
      So, must I relocate the files, is there a better way, or am I doing
      something fundamentally wrong somewhere?

      Thanks in advance,
      Arun

      p.s.: Redirection won't work out since relative URLs are not allowed,
      and absolute URLs will mess up my session.
    • Nirav Mehta
      Hi, ... but I don t think it s the right way to go about it. Well, you can modify the relative URLs without relocating them. Relocating them may not be a good
      Message 2 of 6 , Jun 16, 2003
      • 0 Attachment
        Hi,

        > I could relocate the included files and modify their realtive URLs,
        but I don't think it's the right way to go about it.

        Well, you can modify the relative URLs without relocating them.
        Relocating them may not be a good idea - depending on the number and
        functionality of the files. You might also want to use a variable to
        denote the position in the folder structure and use it in the links.

        E.g. Many a times, we have a folder structure like:

        - Root
        --- include
        ----- config.inc.php
        --- admin
        ----- add.inc.php
        --- index.php
        --- view.inc.php

        We would like to include the config file everywhere and the config file
        in turn calls some other files in the include folder. We use a variable
        $prefix in such cases. When we include config from root, it's set to
        "./include" and when we include it from admin, it's set to "../include".


        The config file than, could include files as

        include_once($prefix.'/db.inc.php');

        Hope this helps :)

        Regards,
        Nirav.
        ======================================================
        | MLEP - Linux, Apache, MySQL, PHP education program |
        | http://www.mlep.com/ |
        |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
        | tangible, customized solutions for your e-business |
        | http://www.magnet-i.com/ |
        ======================================================


        -----Original Message-----
        From: arunissatan [mailto:arunissatan@...]
        Sent: Monday, June 16, 2003 8:30 PM
        To: in-phpug@yahoogroups.com
        Subject: [in-phpug] Multiple submits for a form


        Hi,
        This may be a stupid question, since I'm *very* new to this.

        I've got a form with two submit buttons. As I understand it, a form can
        only have 1 action, so processing the option selected must be done by
        scripting. My code to do this works fine. The problem I'm facing is that
        I use "require_once()" to include the appropriate file, as per the
        submit button used. However, these included files reside in separate
        directories, and their relative URLs fail, since the current path is not
        the directory in which the inluded file resides. I could relocate the
        included files and modify their realtive URLs, but I don't think it's
        the right way to go about it. So, must I relocate the files, is there a
        better way, or am I doing something fundamentally wrong somewhere?

        Thanks in advance,
        Arun

        p.s.: Redirection won't work out since relative URLs are not allowed,
        and absolute URLs will mess up my session.
      • arunissatan
        Hi, ... Neat! It s a clever solution, and very workable in the project I m making. Thanks a lot! Arun
        Message 3 of 6 , Jun 16, 2003
        • 0 Attachment
          Hi,

          > We would like to include the config file everywhere and the config file
          > in turn calls some other files in the include folder. We use a variable
          > $prefix in such cases. When we include config from root, it's set to
          > "./include" and when we include it from admin, it's set to "../include".
          >
          >
          > The config file than, could include files as
          >
          > include_once($prefix.'/db.inc.php');
          >

          Neat! It's a clever solution, and very workable in the project I'm making.

          Thanks a lot!
          Arun
        • Dr Tarique Sani
          ... Most free host disable the mail() function use phpinfo() to find out - try and see if you can use any pure PHP SMTP classes, though I feel even that will
          Message 4 of 6 , Jun 16, 2003
          • 0 Attachment
            On Mon, 16 Jun 2003, shyam prakash wrote:

            > The problem starts there. the mail() is not sending me the mail. i use

            Most free host disable the mail() function use phpinfo() to find out - try
            and see if you can use any pure PHP SMTP classes, though I feel even that
            will not work you are unlikely to be allowed to use sockets either...


            Cheers

            Tarique

            --
            ===================================================================
            PHP Applications for E-Biz: http://www.sanisoft.com -o)
            /\\
            Indian PHP User Group: http://groups.yahoo.com/group/in-phpug _\_v
            ===================================================================
          • shyam prakash
            Hello there, I am having a very simple problem but i dont know how to solve it. i have put up a small site (i am new to the world of html and to php) with php
            Message 5 of 6 , Jun 16, 2003
            • 0 Attachment
              Hello there,

              I am having a very simple problem but i dont know how to solve it. i have put up a small site (i am new to the world of html and to php) with php and have page wherein the user can send me feed back to me by a email.

              The problem starts there. the mail() is not sending me the mail. i use the free web hosting facility of www.portland.co.uk. Please help to slove the problem.

              ks



              ---------------------------------
              Do you Yahoo!?
              SBC Yahoo! DSL - Now only $29.95 per month!

              [Non-text portions of this message have been removed]
            • shyam prakash
              thank you very much ! one more doubt. this is wat the sendmail says: sendmail_from: no value no value sendmail_path: /usr/sbin/sendmail -t /usr/sbin/sendmail
              Message 6 of 6 , Jun 16, 2003
              • 0 Attachment
                thank you very much !
                one more doubt. this is wat the sendmail says:

                sendmail_from: no value no value
                sendmail_path: /usr/sbin/sendmail -t
                /usr/sbin/sendmail -t

                --- Dr Tarique Sani <tarique@...> wrote:
                > On Mon, 16 Jun 2003, shyam prakash wrote:
                >
                > > The problem starts there. the mail() is not
                > sending me the mail. i use
                >
                > Most free host disable the mail() function use
                > phpinfo() to find out - try
                > and see if you can use any pure PHP SMTP classes,
                > though I feel even that
                > will not work you are unlikely to be allowed to use
                > sockets either...
                >
                >
                > Cheers
                >
                > Tarique
                >
                > --
                >
                ===================================================================
                > PHP Applications for E-Biz: http://www.sanisoft.com
                > -o)
                >
                > /\\
                > Indian PHP User Group:
                > http://groups.yahoo.com/group/in-phpug _\_v
                >
                ===================================================================
                >
                >


                __________________________________
                Do you Yahoo!?
                SBC Yahoo! DSL - Now only $29.95 per month!
                http://sbc.yahoo.com
              Your message has been successfully submitted and would be delivered to recipients shortly.