Jump to content

Checking if form is submitted or not ? how to send array in between pages ?


Nuv

Recommended Posts

Following is the form.Now i want to see if submit button is pressed or not.Usually if html had

 

<input type="submit" value="Submit" name = "submit" />

 

i would simply use

<?php
if(isset($_POST['submit']))
?>

 

But below is the form which has an image as a submit button

 

Form -

<form action="" method="post" id="sendemail">
            <ol>
              <li>
                <label for="name">Name (required)</label>
                <input id="name" name="name" class="text" />
              </li>
              <li>
                <label for="email">Email Address (required)</label>
                <input id="email" name="email" class="text" />
              </li>
              <li>
                <label for="email">Phone number</label>
                <input id="phone" name="phone" class="text" />
              </li>
               <li>
                <label for="address">Address(required)</label>
                <input id="address" name="address" class="text" />
              </li>
              <li>
                <label for="city">City(required)</label>
                <input id="city" name="city" class="text" />
              </li>
              <li>
                <label for="state">State(required)</label>
                <input id="state" name="state" class="text"/>
              </li>
               <li>
                <label for="zipcode">Pincode/Zipcode(required)</label>
                <input id="zipcode" name="zipcode" class="text" />
              </li>
              <li>
                <input type="image" name="submit" id="imageField" src="images/submit.gif" class="send" />
                <div class="clr"></div>
              </li>
            </ol>
          </form>   

 

How should i check if form is submitted or not when instead of submit button there is an image ?

 

----------------------------------------------------------------- Alternative Solution ----------------------------------------------------------------------------

 

I tried sending it to other page but then i had to send an array back to this page and i didn't know how to send that either.I tried

<?php
$error = serialize($error);
  echo "<meta http-equiv='refresh' content='0;url=about.php?array=".$error."'> ";
?>

 

But even after

 

$array = unserialize($array); 

 

$array contained nothing.

 

Can someone please show me how to send in array in between pages for future ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.