NEED HELP!?! echoing image

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

    #1

    NEED HELP!?! echoing image

    form action="index.p hp#order" method="post" name="image1" id="image1">
    <input name="image1" type="submit" id="image1" value="Buy!">

    form action="index.p hp#order" method="post" name="image2" id="image2">
    <input name="image2" type="submit" id="image3" value="Buy!">

    <form name="form1" method="post" action="thankyo u.php">

    <?php
    if ($_POST[image1]) {
    echo "<img src=\"image/image1.jpg\">";
    }
    if ($_POST[image2]) {
    echo "<img src=\"image/image2.jpg\">";
    }
    ?>

    i want in thankyou.php to echo the selected image in index.php#order .

    Please help! thanks

  • NC

    #2
    Re: NEED HELP!?! echoing image

    jayparaiso@gmai l.com wrote:
    >
    form action="index.p hp#order" method="post" name="image1" id="image1">
    <input name="image1" type="submit" id="image1" value="Buy!">
    >
    form action="index.p hp#order" method="post" name="image2" id="image2">
    <input name="image2" type="submit" id="image3" value="Buy!">
    >
    <form name="form1" method="post" action="thankyo u.php">
    >
    <?php
    if ($_POST[image1]) {
    echo "<img src=\"image/image1.jpg\">";
    }
    if ($_POST[image2]) {
    echo "<img src=\"image/image2.jpg\">";
    }
    ?>
    >
    i want in thankyou.php to echo the selected image in index.php#order .
    Your forms are messed up. Try this:

    <form action="index.p hp#order" method="post">
    <input name="image1" type="submit" id="image1" value="Buy!">
    </form>

    <form action="index.p hp#order" method="post">
    <input name="image2" type="submit" id="image2" value="Buy!">
    </form>

    <?php
    if (isset($_POST['image1'])) {
    echo "<img src=\"image/image1.jpg\">";
    }
    if (isset($_POST['image2'])) {
    echo "<img src=\"image/image2.jpg\">";
    }
    ?>
    Cheers,
    NC

    Comment

    • Colin Fine

      #3
      Re: NEED HELP!?! echoing image

      jayparaiso@gmai l.com wrote:
      form action="index.p hp#order" method="post" name="image1" id="image1">
      <input name="image1" type="submit" id="image1" value="Buy!">
      >
      form action="index.p hp#order" method="post" name="image2" id="image2">
      <input name="image2" type="submit" id="image3" value="Buy!">
      >
      <form name="form1" method="post" action="thankyo u.php">
      >
      <?php
      if ($_POST[image1]) {
      echo "<img src=\"image/image1.jpg\">";
      }
      if ($_POST[image2]) {
      echo "<img src=\"image/image2.jpg\">";
      }
      ?>
      >
      i want in thankyou.php to echo the selected image in index.php#order .
      >
      Please help! thanks
      >
      I don't fully understand what you mean, but in general each form on an
      HTML page is independent. If the user pick the Submit in the first form,
      the input from that form (image1) will be available in the next page,
      but if the user picks a submit in any other form (such as the third one)
      then image1 will not be available in the next page.

      Colin

      Comment

      Working...