2017-10-30 11 views
-1

私は、管理者がwikiページとして投稿を移動したために決して解決されなかった問題としてこれを再投稿しました。PHPファイルの問題と思われる簡単な入力ミスがあったが、問題の原因は何かページリダイレクトはリンク先ページでは動作しません

ありがとうございましたページにリダイレクトできることを教えてください。 JavascriptとPHPファイルで多数のリダイレクトを試しましたが、それを理解できないようです。

送信ボタンをクリックすると、メールの詳細が完全に送信されますが、ページはリダイレクトされません。事前に

おかげ

アダム

/* ================================== 
 
\t Hero Form Validation 
 
\t =====================================*/ 
 
\t $('#hero-submit').click(function(e){ 
 

 
     // Stop form submission & check the validation 
 
     e.preventDefault(); 
 

 
     // Variable declaration 
 
     var error = false; 
 
     var fname = $('#hero-fname').val(); 
 
     var email = $('#hero-email').val(); 
 
     var username = $('#hero-username').val(); 
 

 
     \t // Form field validation 
 
     if(fname.length == 0){ 
 
      var error = true; 
 
      $('#hero-fname').parent('div').addClass('field-error'); 
 
     }else{ 
 
      $('#hero-fname').parent('div').removeClass('field-error'); 
 
     } 
 
     if(email.length == 0 || email.indexOf('@') == '-1'){ 
 
      var error = true; 
 
      $('#hero-email').parent('div').addClass('field-error'); 
 
     }else{ 
 
      $('#hero-email').parent('div').removeClass('field-error'); 
 
     } 
 
     if(username.length == 0){ 
 
      var error = true; 
 
      $('#hero-username').parent('div').addClass('field-error'); 
 
     }else{ 
 
      $('#hero-username').parent('div').removeClass('field-error'); 
 
     } 
 

 
     if(error == true){ 
 
     \t $('#hero-error-notification').addClass('show-up'); 
 
     }else{ 
 
      $('#hero-error-notification').removeClass('show-up'); 
 
     } 
 

 
     if(error == false){ 
 
      $.post("hero-form.php", $("#register-form").serialize(),function(result){ 
 
       if(result == 'sent'){ 
 
        window.location.replace("http://SOMESITE.COM/ppi/page2.html"); 
 
\t \t \t \t \t $('#hero-success-notification').addClass('show-up'); 
 
        $('#hero-submit').addClass('disabled'); 
 
       } 
 
      }); 
 
     } 
 
    }); 
 

 

 
\t // Function to close the Notification 
 
    $('a.notification-close').click(function(){ 
 
\t  $(this).parent('div').fadeOut(200); 
 
    });
<?php 
 
$subject = 'Register New Account on Urip Landing Page'; // Subject of your email 
 
$to = '[email protected]'; //Recipient's or Your E-mail 
 

 
$headers = 'MIME-Version: 1.0' . "\r\n"; 
 
$headers .= "From: " . $_REQUEST['email'] . "\r\n"; // Sender's E-mail 
 
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
 

 
$message = 'ACCOUNT DETAILS: ' . "<br>"; 
 
$message .= 'Username: ' . $_REQUEST['username'] . "<br>"; 
 
$message .= 'First Name: ' . $_REQUEST['fname'] . "<br>"; 
 
$message .= 'Last Name: ' . $_REQUEST['lname'] . "<br>"; 
 
$message .= 'Email Address: ' . $_REQUEST['email'] . "<br>"; 
 
$message .= 'Phone Number: ' . $_REQUEST['phone']; 
 

 
////// Redirect user after submitting form 
 
$redirect_thankyou = 'http://SOMESITE.COM/ppi/page2.html'; 
 
$redirect_error = 'http://SOMESITE.COM/ppi/page3.html'; 
 

 
if (mail($to, $subject, $message, $headers)) { 
 
    header("Location: $redirect_thankyou"); 
 
    exit(); 
 
} 
 
else 
 
{ 
 
    header("Location: $redirect_error"); 
 
    exit(); 
 
} 
 

 
?>
<!--DOCTYPE html --> 
 
<html><head> 
 
\t  <meta charset="utf-8"> 
 
\t  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
\t \t <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 
 

 
\t  <!-- CSS --> 
 
\t \t <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> 
 
\t \t <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic|Montserrat:700,400|Varela+Round"> 
 

 
\t \t <!-- Font Icon --> 
 
\t \t <link rel="stylesheet" href="fonts/icomoon/icomoon.css"> 
 

 
\t \t <!-- Swipebox --> 
 
\t \t <link rel="stylesheet" href="css/swipebox.css"> 
 

 
\t \t <!-- Animate CSS --> 
 
\t \t <link rel="stylesheet" href="css/animate.min.css"> 
 

 
\t \t <!-- Slick CSS --> 
 
\t \t <link rel="stylesheet" href="js/slick/slick.css"> 
 
\t \t <link rel="stylesheet" href="js/slick/slick-theme.css"> 
 

 
\t \t <!-- Custom CSS --> 
 
\t \t <link rel="stylesheet" href="css/style-v2.css"> 
 
\t \t <link rel="stylesheet" href="css/style-responsive-v2.css"> 
 
\t \t <link rel="stylesheet" href="css/expandableGallery.css"> 
 

 
\t  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> 
 
\t  <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 
 
\t  <!--[if lt IE 9]> 
 
\t  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> 
 
\t  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> 
 
\t  <![endif]--> 
 
\t  <script src="js/modernizr.js"></script> <!-- Modernizr --> 
 

 
    \t </head> 
 

 
\t <body> 
 

 
\t  <div id="page" class="page main"> 
 

 

 

 
\t  <!-- 
 
\t \t \t ========================== 
 
\t \t \t == BEGIN HEADER CONTENT == 
 
\t \t \t ========================== 
 
\t \t \t --> 
 
\t \t \t <header id="main-header" class="the-header the-origin-header"> 
 

 
\t \t \t \t <div class="container"> 
 
\t \t \t \t \t <div class="row"> 
 

 
\t \t \t \t \t \t <div class="col-lg-12"> 
 

 
\t \t \t \t \t \t \t <a href="#0" class="logo"><img src="images/logo.png" alt="Urip Logo" style="outline: none; cursor: inherit;"></a> <!-- Your Logo --> 
 

 
\t \t \t \t \t \t \t <a href="#0" id="nav-menu-trigger" class="menu-toggle pull-right all-caps">Menu<span class="icon-menu5"></span></a> <!-- Menu Toggle --> 
 

 
\t \t \t \t \t \t </div> <!--/ .col-lg-12 --> 
 

 
\t \t \t \t \t </div> <!--/ .row --> 
 
\t \t \t \t </div> <!--/ .container --> 
 

 
\t \t \t </header> 
 
\t \t \t <!-- 
 
\t \t \t ========================= 
 
\t \t \t ==/ END HEADER CONTENT == 
 
\t \t \t ========================= 
 
\t \t \t --> 
 

 

 
\t \t \t <!-- 
 
\t \t \t ============================ 
 
\t \t \t == BEGIN NAV MENU CONTENT == 
 
\t \t \t ============================ 
 
\t \t \t --> 
 
\t \t \t <nav id="nav-wrapper"> 
 

 
\t \t \t \t <a class="nav-close" href="#0" style="outline: none; cursor: inherit;"><span class="icon-cross2"></span></a> 
 

 
\t \t \t \t <ul id="main-nav" class="main-nav all-caps"> 
 
\t \t \t \t \t <li class="current"><a href="#hero" style="outline: none; cursor: inherit;">Home</a></li> 
 
\t \t \t \t \t <li><a href="#what-we-do" style="outline: none; cursor: inherit;">What We Do</a></li> 
 
\t \t \t \t \t <li><a href="#our-features" style="outline: none; cursor: inherit;">Our Features</a></li> 
 
\t \t \t \t \t <li><a href="#pricing" style="outline: none; cursor: inherit;">Pricing</a></li> 
 
\t \t \t \t \t <li><a href="#our-team" style="outline: none; cursor: inherit;">The Team</a></li> 
 
\t \t \t \t \t <li><a href="#customer-story" style="outline: none; cursor: inherit;">Customers</a></li> 
 
\t \t \t \t \t <li class="dropdown"> 
 
\t \t \t \t \t \t <a class="external" href="#0" style="outline: none; cursor: inherit;"> 
 
\t \t \t \t \t \t \t Dropdown 
 
\t \t \t \t \t \t </a> 
 
\t \t \t \t \t \t <ul class="dropdown-menu"> 
 
\t \t \t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">Some Submenu</a></li> 
 
\t \t \t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">And More</a></li> 
 
\t \t \t \t \t \t </ul> 
 
\t \t \t \t \t </li> 
 
\t \t \t \t </ul> <!--/ .main-nav --> 
 

 
\t \t \t \t <ul class="secondary-nav"> 
 
\t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">About This Template</a></li> 
 
\t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">Privacy Policy</a></li> 
 
\t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">Terms of Service</a></li> 
 
\t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">Legal</a></li> 
 
\t \t \t \t \t <li><a href="#0" style="outline: none; cursor: inherit;">Careers</a></li> 
 
\t \t \t \t \t <li><a class="contact-trigger" style="outline: none; cursor: inherit;">Contact Us</a></li> 
 
\t \t \t \t </ul> <!--/ .secondary-nav --> 
 

 
\t \t \t </nav> 
 
\t \t \t <!-- 
 
\t \t \t =========================== 
 
\t \t \t ==/ END NAV MENU CONTENT == 
 
\t \t \t =========================== 
 
\t \t \t --> 
 

 

 
\t \t \t <!-- 
 
\t \t \t ======================== 
 
\t \t \t == BEGIN MAIN CONTENT == 
 
\t \t \t ======================== 
 
\t \t \t --> 
 

 
\t \t \t \t <!-- 
 
\t \t \t \t ======================== 
 
\t \t \t \t == BEGIN HERO SECTION == 
 
\t \t \t \t ======================== 
 
\t \t \t \t --> 
 
\t \t \t \t <section id="hero" class="hero-form-layout breaking" data-stellar-background-ratio="0.5" data-stellar-vertical-offset="50" style="background-position: 50% 0px;"> 
 

 
\t \t \t \t \t <div class="hero-split-right"></div> 
 

 
\t \t \t \t \t <div class="container"> 
 

 
\t \t \t \t \t \t <div class="vertical-center-wrapper"> 
 
\t \t \t \t \t \t \t <div class="vertical-center-table"> 
 
\t \t \t \t \t \t \t \t <div class="vertical-center-content"> 
 

 
\t \t \t \t \t \t \t \t \t <!-- BEGIN Hero Content --> 
 
\t \t \t \t \t \t \t \t \t <div class="hero-content row"> 
 
\t \t \t \t \t \t \t \t \t \t <div class="col-lg-6 col-md-6 col-sm-6 margin-top-40"> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="editContent" style="outline: none; cursor: inherit;"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <p class="lead zero-bottom text-shadow-xsmall">Meet Urip Landing Page Template</p> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="editContent" style="outline: none; cursor: inherit;"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <h2 class="text-shadow-medium">All in One Landing Page that Converts</h2> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="row"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-10"> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="videoWrapper embed-responsive embed-responsive-16by9"> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <iframe src="https://player.vimeo.com/video/93094247?color=19a9e5&amp;title=0&amp;byline=0&amp;portrait=0" width="470" height="265" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> <!--/ .embed-responsive --> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> <!--/ .row --> 
 

 
\t \t \t \t \t \t \t \t \t \t </div> <!--/ .col-lg-6 --> 
 

 
\t \t \t \t \t \t \t \t \t \t <div class="hero-form-wrapper col-lg-5 col-lg-offset-1 col-md-6 col-md-offset-0 col-sm-6 col-sm-offset-0 col-xs-10 col-xs-offset-1 centered"> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="editContent"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <h4 class="all-caps margin-bot-15">Create Account for Free</h4> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="editContent"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <p class="zero-bottom"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t Create account in 30 seconds. No credit card required.<br> 
 
\t \t \t \t \t \t \t \t \t \t \t \t Already have an account? <a href="#0" class="more" style="outline: none; cursor: inherit;">Log in here.</a> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </p> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <form class="register-form margin-top-32 margin-bot-5" id="register-form" method="post"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <div class="row"> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-6 col-md-6"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <div class="required-field"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <input name="fname" id="hero-fname" class="hero-input" type="text" placeholder="First Name"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t </div> <!--/ .required-field --> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-6 col-md-6"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <input name="lname" id="hero-lname" class="hero-input" type="text" placeholder="Last Name"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-12 col-md-12"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <div class="required-field"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <input name="username" id="hero-username" class="hero-input" type="text" placeholder="Choose Username"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t </div> <!--/ .required-field --> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-12 col-md-12"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <div class="required-field"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <input name="email" id="hero-email" class="hero-input" type="text" placeholder="Email Address"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t </div> <!--/ .required-field --> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-8 col-md-8"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <input name="phone" id="hero-phone" class="hero-input" type="text" placeholder="Phone Number"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t \t <div class="col-lg-4 col-md-4"> 
 
                
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <button id="hero-submit" type="submit" class="submit-btn">Create</button> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t \t \t \t \t \t </form> <!--/ .register-form --> 
 

 
\t \t \t \t \t \t \t \t \t \t \t <div class="editContent" style="outline: none; cursor: inherit;"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <p class="zero-bottom">By creating account, you agree to the <a href="#0" class="more" style="outline: none; cursor: inherit;">Terms of Service</a></p> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t \t \t \t \t </div> <!--/ .hero-form-wrapper --> 
 

 
\t \t \t \t \t \t \t \t \t </div> <!--/ .row --> 
 
\t \t \t \t \t \t \t \t \t <!-- END Hero Content --> 
 

 
\t \t \t \t \t \t \t \t </div> <!--/ .vertical-center-content --> 
 
\t \t \t \t \t \t \t </div> <!--/ .vertical-center-table --> 
 
\t \t \t \t \t \t </div> <!--/.vertical-center-wrapper --> 
 

 
\t \t \t \t \t </div> <!--/ .container --> 
 

 
\t \t \t \t </section> 
 
\t \t \t \t <!-- 
 
\t \t \t \t ======================= 
 
\t \t \t \t ==/ END HERO SECTION == 
 
\t \t \t \t ======================= 
 
\t \t \t \t --></div><!-- /#page --> 
 

 
\t \t <!-- Load JS here for greater good =============================--> 
 
\t  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
 
\t  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> 
 

 
\t  <!-- Latest compiled and minified JavaScript --> 
 
\t \t <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> 
 

 
\t \t <!-- SmoothScroll --> 
 
\t \t <script src="js/minified/SmoothScroll.min.js"></script> 
 

 
\t \t <!-- Classie --> 
 
\t \t <script src="js/minified/classie.min.js"></script> 
 

 
\t \t <!-- One Page Nav --> 
 
\t \t <script src="js/minified/jquery.nav.min.js"></script> 
 

 
\t \t <!-- AjaxChimp --> 
 
\t \t <script src="js/minified/jquery.ajaxchimp.min.js"></script> 
 

 
\t \t <!-- Swipebox --> 
 
\t \t <script src="js/minified/jquery.swipebox.min.js"></script> 
 

 
\t \t <!-- Expandable Gallery on 2 Block Column --> 
 
\t \t <script src="js/minified/expandableGallery.min.js"></script> 
 

 
\t \t <!-- Counter Up --> 
 
\t \t <script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script> 
 
\t \t <script src="js/minified/jquery.counterup.min.js"></script> 
 

 
\t \t <!-- Isotope JS --> 
 
\t \t <script src="https://npmcdn.com/[email protected]/dist/isotope.pkgd.min.js"></script> 
 
\t \t <script src="js/urip-isotope-setting.js"></script> 
 

 
\t \t <!-- Stellar JS --> 
 
\t \t <script src="js/jquery.stellar.js"></script> 
 

 
\t \t <!-- Custom JS --> 
 
\t \t <script src="js/urip-v2.js"></script> 
 

 
\t \t <!-- Expandable Navigation Menu --> 
 
\t \t <script src="js/minified/expandableNav.min.js"></script> 
 

 
\t 
 

 
</body></html>

+2

元の投稿は決して閉じられませんでした。これを再度投稿する必要はありません。 –

+0

あなたはあなたのerror_logをチェックしましたか? – happymacarts

答えて

0

はこれを試してみてください:

<?php 
header('Location: redirectpage.php'); 
header('Location: redirectpage.php');exit(); 
echo "<script>location.href='redirectpage.php';</script>"; 
?> 

おそらくあなたのヘッダがすでにあなたはそれを修正しようとしている時間によって設定されています。

関連する問題