Cross sub-domain ajax form submit with session
I'm working on something here.
Javascript
$('#create').submit(function() {
$.ajax({
data: $(this).serialize(),
type: $(this).attr('method'),
url: $(this).attr('action'),
success: function(response) {
console.log(response);
}
});
return false;
});
Php file (url):
session_start();
header('Access-Control-Allow-Origin: *');
session_set_cookie_params( time() + 3600, '/', '.domain.com');
print_r($_SESSION);
die;
On the page with the form my session[memberid] = [some int];
But if i make the ajax call the whole sesison variable is empty
I tried looking on google for some answers, i tried looking for some
answers on stack overflow
but nothing really helped. And i do not prefer using an iframe. Maybe that
was the solution, but maybe there is someone who knows what i need to do
here.
The form is located at the domain m.domain.com and the php file is located
at domain.com
Thursday, 3 October 2013
Wednesday, 2 October 2013
Need help in trying to read and write from plist
Need help in trying to read and write from plist
I am trying to save an NSMutable Array and NSString into plist and then if
it exists initialize the value from plist. However when I re run the app,
the values do not get initialize as it is suppose to. So far the following
is what I have.
if (self = [super init]) {
NSString *path=[self getFileUrl];
NSFileManager *fm = [[NSFileManager alloc] init];
if ([fm fileExistsAtPath:path]) {
_history = [d objectForKey:@"stringKey"];
availableSeats=[d objectForKey: @"ArrayKey"];
}
else
{
//Initialize the string
_history=@"";
}
//Get the url of the plist method
-(NSString*)getFileUrl
{
NSArray *path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentDirectory=[path objectAtIndex:0];
return [documentDirectory
stringByAppendingPathComponent:@"savedResources.plist"];
}
NSDictionary *d;
//This is what I execute when the user presses the save button.
-(void)Save
{
d=@{@"StringKey" :_history, @"ArrayKey" :classes};
[d writeToFile:[self getFileUrl] atomically:YES];
}
However the values are not getting initialized as per the plist. Is it the
way I am extracting the values from the dictionary?
I am trying to save an NSMutable Array and NSString into plist and then if
it exists initialize the value from plist. However when I re run the app,
the values do not get initialize as it is suppose to. So far the following
is what I have.
if (self = [super init]) {
NSString *path=[self getFileUrl];
NSFileManager *fm = [[NSFileManager alloc] init];
if ([fm fileExistsAtPath:path]) {
_history = [d objectForKey:@"stringKey"];
availableSeats=[d objectForKey: @"ArrayKey"];
}
else
{
//Initialize the string
_history=@"";
}
//Get the url of the plist method
-(NSString*)getFileUrl
{
NSArray *path=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentDirectory=[path objectAtIndex:0];
return [documentDirectory
stringByAppendingPathComponent:@"savedResources.plist"];
}
NSDictionary *d;
//This is what I execute when the user presses the save button.
-(void)Save
{
d=@{@"StringKey" :_history, @"ArrayKey" :classes};
[d writeToFile:[self getFileUrl] atomically:YES];
}
However the values are not getting initialized as per the plist. Is it the
way I am extracting the values from the dictionary?
Too many Stylesheets using Zurb-Foundation with sass and Compass
Too many Stylesheets using Zurb-Foundation with sass and Compass
I just started out with Zurb-Foundation using sass and compass, but I'm
damn confused about which stylesheets to use and link to from the html,
because there are simply too many! If someone could tell me exactly which
styesheets to use for what, I'd be super grateful. I'm pretty sure I've
read ALL the documentation on Zurb and sass more a few times, but I'm
still not clear on how to get my project template all set up correctly and
in which stylesheet to put all my styles. I've installed ruby, compass,
sass, and zurb-foundation, and I'm using Prepros. Here are all the
stylesheets I have but don't know what to do with...
-foundation.css
-foundaiton.min.css
-ie.css
-normalize.css
-ie.scss (x2)
-print.scss(x2)
-screen.scss(x2)
Can anybody tell me simply which ones I need and what for, as well as
which ones to link to in the head of the html? Keep in mind that I'm using
Prepros, which is the windows version of Codekit.
Thanks in advance!! =-)
-Garrett
I just started out with Zurb-Foundation using sass and compass, but I'm
damn confused about which stylesheets to use and link to from the html,
because there are simply too many! If someone could tell me exactly which
styesheets to use for what, I'd be super grateful. I'm pretty sure I've
read ALL the documentation on Zurb and sass more a few times, but I'm
still not clear on how to get my project template all set up correctly and
in which stylesheet to put all my styles. I've installed ruby, compass,
sass, and zurb-foundation, and I'm using Prepros. Here are all the
stylesheets I have but don't know what to do with...
-foundation.css
-foundaiton.min.css
-ie.css
-normalize.css
-ie.scss (x2)
-print.scss(x2)
-screen.scss(x2)
Can anybody tell me simply which ones I need and what for, as well as
which ones to link to in the head of the html? Keep in mind that I'm using
Prepros, which is the windows version of Codekit.
Thanks in advance!! =-)
-Garrett
entity framework Type not defined
entity framework Type not defined
I imported a simple MySQL db using VS 2012, and 2 of the 3 tables are
giving me "Type 'tablename' is not defined". The error is in the
MyDatabase.Context.vb file.
I imported a simple MySQL db using VS 2012, and 2 of the 3 tables are
giving me "Type 'tablename' is not defined". The error is in the
MyDatabase.Context.vb file.
where 's the java sample source
where 's the java sample source
I'm japanese, sorry my poor English.
I'm trying to make EC-Site(Web) with in Paypal Service.
EJDK 1.6.0
EF/W SAStruts
Eand UI useing Ajax(JSON)
I heard our service is mach in "Chained Payments" from Paypal techSupport.
So I want sample source of this.
But doesn't have a document in Japanese.
I heard the sample source URL from Paypal techSupport.
(https://github.com/paypal)
I download "sdk-packages-gh-pages.zip" and unzip and grep by "chained",
but I can't reach them.
Please teach me the detail sample source URL of "Chained Payments" moves.
And all API of "Chained Payments" flow to use.
Sorry in the simple question..
I'm japanese, sorry my poor English.
I'm trying to make EC-Site(Web) with in Paypal Service.
EJDK 1.6.0
EF/W SAStruts
Eand UI useing Ajax(JSON)
I heard our service is mach in "Chained Payments" from Paypal techSupport.
So I want sample source of this.
But doesn't have a document in Japanese.
I heard the sample source URL from Paypal techSupport.
(https://github.com/paypal)
I download "sdk-packages-gh-pages.zip" and unzip and grep by "chained",
but I can't reach them.
Please teach me the detail sample source URL of "Chained Payments" moves.
And all API of "Chained Payments" flow to use.
Sorry in the simple question..
Tuesday, 1 October 2013
Conversion from string "FalseTrue" to type 'Boolean' is not valid. :/
Conversion from string "FalseTrue" to type 'Boolean' is not valid. :/
Conversion from string "FalseTrue" to type 'Boolean' is not valid. How can
I fix it in this case? Label5.Text has to contain those, it can't equal as
they provide the full converted time to EST including date.
If ((Label5.Text.Contains("8:00") Or Label5.Text.Contains("1:35")) &
(Label5.Text.Contains("PM"))) Then
WebControl1.Source = New Uri("http://www.flalottery.com/play4.do")
Label1.Text = "Loading in 7 seconds..."
Label2.Text = "Loading in 7 seconds..."
Refresh.Start()
End If
Winforms VB.NET 2012 Express.
Conversion from string "FalseTrue" to type 'Boolean' is not valid. How can
I fix it in this case? Label5.Text has to contain those, it can't equal as
they provide the full converted time to EST including date.
If ((Label5.Text.Contains("8:00") Or Label5.Text.Contains("1:35")) &
(Label5.Text.Contains("PM"))) Then
WebControl1.Source = New Uri("http://www.flalottery.com/play4.do")
Label1.Text = "Loading in 7 seconds..."
Label2.Text = "Loading in 7 seconds..."
Refresh.Start()
End If
Winforms VB.NET 2012 Express.
Microformats Specifically hreview-aggregate
Microformats Specifically hreview-aggregate
I had a question about microfomats and more specifically
hreview-aggregate. A client implemented them a while ago but they are not
showing in the SERPs however Google's rich snippet testing tool shows them
working perfectly. I took a look at the code and it is currently
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars">4.383 of 5
stars</span>
<a tabindex="0" href="https://www.example.com/category/"
title="View all xxxx Reviews">
<span class="count">View all xxxx Reviews</span>
</a>
</div>
</div>
I changed it up to include class="average" class="best" and a few other
spans that they were missing.
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars"><span
class="average">4.383</span> of <span
class="best">5</span> stars</span>
<a tabindex="0" href="https://www.example.com/category/"
title="View all xxxx Reviews">
View all <span class="count">xxxx</span> Reviews
</a>
</div>
</div>
Will the updated code finally show in the SERPs? Also, the page only has
the rating but no reviews, should I use COUNT or VOTES?
Thanks in advance.
I had a question about microfomats and more specifically
hreview-aggregate. A client implemented them a while ago but they are not
showing in the SERPs however Google's rich snippet testing tool shows them
working perfectly. I took a look at the code and it is currently
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars">4.383 of 5
stars</span>
<a tabindex="0" href="https://www.example.com/category/"
title="View all xxxx Reviews">
<span class="count">View all xxxx Reviews</span>
</a>
</div>
</div>
I changed it up to include class="average" class="best" and a few other
spans that they were missing.
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars"><span
class="average">4.383</span> of <span
class="best">5</span> stars</span>
<a tabindex="0" href="https://www.example.com/category/"
title="View all xxxx Reviews">
View all <span class="count">xxxx</span> Reviews
</a>
</div>
</div>
Will the updated code finally show in the SERPs? Also, the page only has
the rating but no reviews, should I use COUNT or VOTES?
Thanks in advance.
How can ArcGIS labels use a different expression if attribute is null=?iso-8859-1?Q?=3F_=96_gis.stackexchange.com?=
How can ArcGIS labels use a different expression if attribute is null? –
gis.stackexchange.com
I am using an expression to label features by concatenating two attributes
in ArcMap. It works like this: <attribute_1>+" "+<attribute_2>
Unfortunately when either attribute is Null the …
gis.stackexchange.com
I am using an expression to label features by concatenating two attributes
in ArcMap. It works like this: <attribute_1>+" "+<attribute_2>
Unfortunately when either attribute is Null the …
Group theory Normal Sugbroups
Group theory Normal Sugbroups
(a) Let $N$ be a normal subgroup of a group $G$. Prove that the one-to-one
correspondence $\pi$ between the subgroups of $G$ that contain $N$ and all
of the subgroups of $G/N$ preserves normal subgroups, that is, if $K$ is a
subgroup of $G$ containing $N$, then $K$ is normal in $G$ if and only if
$\pi(K)$ is normal in $G/N$.
(b) Prove that every finite group $G$ has a homomorphic image that is a
simple group, that is, a nontrivial group with no normal subgroups other
than $\{e\}$ and itself.
(a) Let $N$ be a normal subgroup of a group $G$. Prove that the one-to-one
correspondence $\pi$ between the subgroups of $G$ that contain $N$ and all
of the subgroups of $G/N$ preserves normal subgroups, that is, if $K$ is a
subgroup of $G$ containing $N$, then $K$ is normal in $G$ if and only if
$\pi(K)$ is normal in $G/N$.
(b) Prove that every finite group $G$ has a homomorphic image that is a
simple group, that is, a nontrivial group with no normal subgroups other
than $\{e\}$ and itself.
Subscribe to:
Comments (Atom)