0

I am using two plugins for Popup, window plugin and newsletter plugin. when popup shows, it displays the EMAIL field and Subscribe button

i want to pass email value page1.php(popup form) to page-subscription.php (subscribe page)

If customer enter the email and subscribe, the form action will redirect to page-Subscribe.php and the email value is returned from the poupup window

here is the code for page1.php popup window form code

<form onsubmit="return newsletter_check(this)" action="http://www.example.com /subscription/" class="content-sxzw" method="post">
         <input class="newsletter-email" type="email" placeholder="Your email here" name="ne" size="30" required>
         <input type="submit" class="submit-sxzw" value="{{subscribe-button-text}}" />
</form>

Here is the page-subscription.php form code

<p class="wysija-paragraph"><label style="margin-bottom: 5px;">Your Email <span class="wysija-required">*</span></label><input class="wysija-input validate[custom[email]]" title="Your Email" type="text" name="wysija[user][email]" value="" />
<span class="abs-req">
<input class="wysija-input validated[abs][email]" type="text" name="wysija[user][abs][email]"  value="<?php echo  $_POST['ne']; ?>" />

</span></p>

I am trying to get value of email to this page and it can any of the method

Balaji
  • 25
  • 7

2 Answers2

0

In order to pass values from one page to other page , either you can make use of sessions or make it through url,

Making use of sessions

<?php
session_start();
$_SESSION['example'] = 'value'
//set the values you needed in other page in sessions before redirecting to other page
?>

and in second page you can retrieve this session values as

<?php
 session_start();
 $_SESSION['example'];

?>

?>

sshet
  • 1,152
  • 1
  • 6
  • 15
0

Try this one

// page1.php

   <?php


      if(isset($_POST['submitEmail'])) {

        $email = $_POST['email'];
        header("location: page2.php?$email");
      } 

   ?>

   <form action="" method="POST">
   <input type="text" name="email" />
   <input type="submit" name="submitEmail" value="submit" />
   </form>


  // page2.php

  <?php

      $email = $_SERVER['QUERY_STRING'];

      echo $email;
 ?>
user3587432
  • 11
  • 1
  • 4