In my index page, i have added textarea and a button. User will enter the comments in textarea and clicks the button then it will open a modal dialog, which is having social logins(facebook, google). And the after logging in, it will open home page. In that home page , the comment which user has entered in index page has to be displayed.
For me modal dialog with social logins are working and it is redirecting to home page , but textareA comment is not passing from index page to home page. Code for social logins i have used from OAuth Login for Facebook Twitter and Google Plus Using PHP. So please tell me how to pass text from index to home page. On button click event, it has ti open the modal dialog and also it has to carry the text to home page using php. My code is index.php
<body>
<!-- Add your site or application content here --> <div class="container-fluid"> <div class="row"> <div class="col-md-offset-4 col-lg-offset-4 col-md-4 col-lg-4"> Story: <br><textarea id="ta1" maxlength="1000" cols="50" rows="4"></textarea> maxlength="1000"<br>
<button id='modal-launcher' class="btn btn-primary btn-lg" data-toggle="modal" data-target="#login-modal" > Post </button> </div> </div> </div>
<div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header login_modal_header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h2 class="modal-title" id="myModalLabel">Login to Your Account</h2> </div> <div class="modal-body login-modal">
<br/> <div class="clearfix"></div> <div id='social-icons-conatainer'> <!--<div class='modal-body-left'> <div class="form-group"> <input type="text" id="username" placeholder="Enter your name" value="" class="form-control login-field"> <i class="fa fa-user login-field-icon"></i> </div>
<div class="form-group"> <input type="password" id="login-pass" placeholder="Password" value="" class="form-control login-field"> <i class="fa fa-lock login-field-icon"></i> </div>
<a href="#" class="btn btn-success modal-login-btn">Login</a> <a href="#" class="login-link text-center">Lost your password?</a> </div>
<div class='modal-body-right'>--> <div class="modal-social-icons"> <a class="btn btn-default facebook" href="login.php?type=facebook"> <i class="fa fa-facebook modal-icons"></i> Signin with Facebook </a> <a class="btn btn-default google" href="login.php?type=google"> <i class="fa fa-google-plus modal-icons"></i> Signin with Google </a> <a class="btn btn-default twitter" href="login.php?type=twitter"> <i class="fa fa-twitter modal-icons"></i> Signin with Twitter </a> <!--<a href='#' class="btn btn-default linkedin"> <i class="fa fa-linkedin modal-icons"></i> Sign In with Linkedin </a>--> </div> <!--</div> <div id='center-line'> OR </div> </div> <div class="clearfix"></div>
<div class="form-group modal-register-btn"> <button class="btn btn-default"> New User Please Register</button> </div>--> </div> <!--<div class="clearfix"></div> <div class="modal-footer login_modal_footer"> </div>--> </div> </div> </div> <!-- /container --> <script src="js/jquery.validate.min.js"></script> <script src="js/login.js"></script> </body> </html> <?php
$_SESSION['story'] = $_POST['limitedtextarea']; ?>
home.php
<div class="content"> <div class="container"> <div class="col-md-8 col-sm-8 col-xs-12"> <div class="well text-center"> <p>Welcome</p>
</div>
</div>
</div> </div>
if(isset($_SESSION['story'])) { echo "Your session is running " . $_SESSION['story']; } ?>
|