CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript, Python code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Thu Mar 28, 2024 12:47 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Storing and retrieving session from one page to another
PostPosted: Wed Nov 30, 2016 4:13 am 
Offline

Joined: Wed Nov 30, 2016 4:09 am
Posts: 1
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">&times;</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'];
}
?>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2016 phpBB Group