"value" field passes value too literally!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rynato@gmail.com

    "value" field passes value too literally!

    Simple question, probably a simple answer:

    I have a php-based email form. There are three hidden variables passed
    from the initial page to the php script which handles sending the
    message:

    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent " value="<?php echo $httpagenti ?
    >" />

    Everything works fine, I do get sent the message when I fill out and
    submit the form, but the three values above are passed as literally,
    the values seen above within the quotes. That is, I get:

    Additional Info : IP = <?php echo $ipi ?>
    Browser Info: <?php echo $httpagenti ?>
    Referral : <?php echo $httprefi ?>

    in the body of the email. Why? And what can I do to fix this?

    thx in adv

  • peter

    #2
    Re: &quot;value&quo t; field passes value too literally!

    Simple question, probably a simple answer:
    >
    I have a php-based email form. There are three hidden variables passed
    from the initial page to the php script which handles sending the
    message:
    >
    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent " value="<?php echo $httpagenti ?
    >>" />
    >
    >
    Everything works fine, I do get sent the message when I fill out and
    submit the form, but the three values above are passed as literally,
    the values seen above within the quotes. That is, I get:
    >
    Additional Info : IP = <?php echo $ipi ?>
    Browser Info: <?php echo $httpagenti ?>
    Referral : <?php echo $httprefi ?>
    >
    in the body of the email. Why? And what can I do to fix this?
    Presumably the page that has this form has the extension .php? The only
    other reason I could think that would case this is if in the script you have
    the whole of the those 3 lines within single quotes.


    Comment

    • Toby A Inkster

      #3
      Re: &quot;value&quo t; field passes value too literally!

      rynato wrote:
      That is, I get:
      Additional Info : IP = <?php echo $ipi ?>
      Browser Info: <?php echo $httpagenti ?>
      Referral : <?php echo $httprefi ?>
      in the body of the email. Why?
      Your server doesn't support PHP? The page on which the mail form sits is
      not being parsed as PHP?

      --
      Toby A Inkster BSc (Hons) ARCS
      Contact Me ~ http://tobyinkster.co.uk/contact
      Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

      * = I'm getting there!

      Comment

      • Rami Elomaa

        #4
        Re: &quot;value&quo t; field passes value too literally!

        usenet@isotopeR EEMOOVEmedia.co m kirjoitti:
        On 3 Apr 2007 08:24:22 -0700, rynato@gmail.co m wrote:
        >
        >Simple question, probably a simple answer:
        >>
        >I have a php-based email form. There are three hidden variables passed
        >>from the initial page to the php script which handles sending the
        >message:
        >>
        ><input type="hidden" name="ip" value="<?php echo $ipi ?>" />
        ><input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
        ><input type="hidden" name="httpagent " value="<?php echo $httpagenti ?
        >>" />
        >>
        >Everything works fine, I do get sent the message when I fill out and
        >submit the form, but the three values above are passed as literally,
        >the values seen above within the quotes. That is, I get:
        >>
        >Additional Info : IP = <?php echo $ipi ?>
        >Browser Info: <?php echo $httpagenti ?>
        >Referral : <?php echo $httprefi ?>
        >>
        >in the body of the email. Why? And what can I do to fix this?
        >
        This shouldn't cause the problem, but the semicolons are missing at the end of
        the php statements.
        Well clearly that's not the problem. A semicolon may be omitted in such
        a case.

        As we Read The Fine Manual, we see the following: "The closing tag of a
        block of PHP code automatically implies a semicolon; you do not need to
        have a semicolon terminating the last line of a PHP block."



        --
        Rami.Elomaa@gma il.com
        "Olemme apinoiden planeetalla."

        Comment

        • cresh

          #5
          Re: &quot;value&quo t; field passes value too literally!

          <? echo getenv('REMOTE_ ADDR'); ?>

          Comment

          • Schraalhans Keukenmeester

            #6
            Re: &quot;value&quo t; field passes value too literally!

            rynato@gmail.co m wrote:
            Simple question, probably a simple answer:
            >
            I have a php-based email form. There are three hidden variables passed
            from the initial page to the php script which handles sending the
            message:
            >
            <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
            <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
            <input type="hidden" name="httpagent " value="<?php echo $httpagenti ?
            >" />
            >
            >
            Everything works fine, I do get sent the message when I fill out and
            submit the form, but the three values above are passed as literally,
            the values seen above within the quotes. That is, I get:
            >
            Additional Info : IP = <?php echo $ipi ?>
            Browser Info: <?php echo $httpagenti ?>
            Referral : <?php echo $httprefi ?>
            >
            in the body of the email. Why? And what can I do to fix this?
            >
            thx in adv
            >
            Am I the only one who thinks the problem may be the double quotes around
            the php bits making the script parse it as a literal string? Or am I
            just being silly. I can live with that now and then....

            Sh.

            Comment

            • Jerry Stuckle

              #7
              Re: &quot;value&quo t; field passes value too literally!

              Schraalhans Keukenmeester wrote:
              rynato@gmail.co m wrote:
              >Simple question, probably a simple answer:
              >>
              >I have a php-based email form. There are three hidden variables passed
              >from the initial page to the php script which handles sending the
              >message:
              >>
              ><input type="hidden" name="ip" value="<?php echo $ipi ?>" />
              ><input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
              ><input type="hidden" name="httpagent " value="<?php echo $httpagenti ?
              >>" />
              >>
              >Everything works fine, I do get sent the message when I fill out and
              >submit the form, but the three values above are passed as literally,
              >the values seen above within the quotes. That is, I get:
              >>
              >Additional Info : IP = <?php echo $ipi ?>
              >Browser Info: <?php echo $httpagenti ?>
              >Referral : <?php echo $httprefi ?>
              >>
              >in the body of the email. Why? And what can I do to fix this?
              >>
              >thx in adv
              >>
              Am I the only one who thinks the problem may be the double quotes around
              the php bits making the script parse it as a literal string? Or am I
              just being silly. I can live with that now and then....
              >
              Sh.
              Nope, you're just being silly :-). This is pretty common in HTML.

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • cresh

                #8
                Re: &quot;value&quo t; field passes value too literally!

                You need to assign a variable to what you want, then echo it. For
                instance...
                BEGIN CODE:
                <?
                $ip = $_SERVER['REMOTE_ADDR'];
                ?>

                ..... whatever you want here, etc....

                <input type=hidden name=ip value='<? echo $ip ?>' />
                END CODE.

                Verified and working fine. Do the same with your other variables.

                Cheers,

                Cresh

                Comment

                Working...