Php variable in several files including jquery
Posted
by vipinsahu
on Stack Overflow
See other posts from Stack Overflow
or by vipinsahu
Published on 2010-04-24T12:56:34Z
Indexed on
2010/04/24
13:03 UTC
Read the original article
Hit count: 261
i created two variable and these two variable are using everywhere . i don't want to store these variable in to database e.g ( $username ,$password and there are 3 files using these variable load.php,index.php and add.php , i am also using jquery to load the add.php as in ajax (to add the user in JSON)
$.ajax({ type: "POST", url: "add.php", data: "twitter="+encodeURIComponent(twitter), /* Sending the filled in twitter name */ success: function(msg){
/* PHP returns 1 on success, and 0 on error */
var status = parseInt(msg);
if(status)
{
$('#response').html('Thank you ');
$('#twitterName').val('');
}
else
$('#response').html('<span style="color:red">There is no user.</span>');
}
});
how can i use these two variable in a single file to perform the whole operation
Thanks
© Stack Overflow or respective owner