-3

THIS IS META.PHP . I AM JUST PASSING SESSION VALUE USING JAVA SCRIPT

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script src="./js/jquery.js"></script>
<script src="./js/laddubox.js"></script>
<script src="./js/pop.js"></script>
<script src="./js/jquery.js"></script>
<script type="text/javascript">
   var page = "<?php echo $_SESSION['pa'] ?>";
</script>
<title><?=$title?></title>
</head>

THIS IS A POP-UP IN JS . NOW I WANT THE SESSION VALUE IN THIS POP-UP AND I HAVE CREATED THE HIDDEN INPUT FIELD TO PASS THE VALUE TO ANOTHER PAGE

function sin() {
    var lbox = new LadduBox();
    lbox.init({
        "width": 500,
        "height": 300,
        "HTML": '<div style="width:495px; height:272px; background-color:#ffffff; border:2px solid orange;"><table cellspacing="0" cellpadding="0" border="0" align="center" width="485" height="270" style="font-family:arial; font-size:20px; font-weight:bold;"><tr><td align="right" colspan="3"><img src="images/untitled-1.png" style="margin:10px; cursor:pointer;" id="btnClose"/></td></tr><tr><td height="30" colspan="3"><div style="font-family:arial; font-size:20px; color:#ff6c00; padding-left:200px;">SIGN IN</div></td></tr><tr><td><form method="get"><div style="margin:10px; font-size:14px;">EMAIL<br><input type="text" name="email"/></div><br><div style="margin-left:10px; margin-top:-10px; font-size:14px;">PASSWORD<br><input type="hidden" name="page" value=""/><input type="text" name="paswrd"/></div><br><input type="submit" value="submit"  class="subbg"/></form></td><td><img src="images/orbar.png" /></td><td align="center"><a href=sign_in.php?val=1"><img src="images/redfb.png" style="margin-bottom:7px;"/></a><br><a href=sign_in.php?val=2"><img src="images/redgoogle.png" style="margin-bottom:7px;"/></a><br><a href=sign_in.php?val=3"><img src="images/redtwitter.png" /></a></td></tr></table></div>',
        'btnCloseId': '#btnClose'
    });
    lbox.fire();
}

SO PLEASE IF ANYONE KNOWS THE ANSWERE PLEASE HELP ME

8
  • I would add quotes around your echo call, since those values are usually strings. var page = "<?php echo $_SESSION['pa']; ?>". Everything else seems good. Commented Oct 7, 2013 at 13:44
  • in hidden set value= '<?php echo $_SESSION['pa'] ?>' Commented Oct 7, 2013 at 13:44
  • @jrthib done after that wat will i do ?? Commented Oct 7, 2013 at 13:47
  • @VinodLouis its not working Commented Oct 7, 2013 at 13:48
  • Did you call session_start() ? Commented Oct 7, 2013 at 13:51

2 Answers 2

0

You have this HTML snippet:

<input type="hidden" name="page" value=""/>

Just insert PHP value there as:

<input type="hidden" name="page" value="<?php echo $_SESSION['pa'] ?>"/>
Sign up to request clarification or add additional context in comments.

Comments

0

Is it as simple as you are just missing the semicolon at the end of the php statement? var page = "";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.