Click here to Skip to main content
12,074,449 members (59,177 online)
Rate this:
Please Sign up or sign in to vote.
See more: Ajax jQuery
Hi friends

please give solution for this issue

i am using Ajax and jquery in my appication

i want to pass session variable to other vriable through ajax please give slolution for this
actually i am using captcha for security so from catcha_config.php file am getting as code in session i want to use that captcha code in my appication

my code is here

include "db.php";
include "header.php";

$cname=$_SESSION['6_letters_code']; // i want to use below in ajax code and send to other page
echo $cname;

<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(document).ready(function() {
    window.$required = $('<div></div>').dialog({
        autoOpen: false,
        title: 'Required Information'
<script type="text/javascript">

        if(name == "") {
    $required.html("Please fill name.").dialog('open');
    return false;

        if(email == "") {
    $required.html("Please fill email.").dialog('open');
    return false;

        if(country == "") {
    $required.html("Please fill country.").dialog('open');
    return false;
        if(state == "") {
    $required.html("Please fill state.").dialog('open');
    return false;
        if(message == "") {
    $required.html("Please fill message.").dialog('open');
    return false;
        if(letterscode == "") {
    $required.html("Please fill letterscode.").dialog('open');
    return false;


            type: "POST",
            url: somepage.php;,
             data: {
              email: email,
               message: message
            success: function(msg){
                if(msg == 1) {
                $required.html("Your Enquiry has been sent. Support will get back to you shortly").dialog('open');
                else {
                  $required.html("Your Enquiry has not been sent.").dialog('open');
 return false;
    return true


<form name="register" method="post" id="register" >
echo "<div style=color:red;padding-left:250px;>".nl2br($errors1)."</div>";
echo "<p style=color:red;padding-left:250px;>".nl2br($errors)."</p>";
Posted 28-Feb-13 3:49am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100