Facebook login works in chrome but not in Firefox
I have an asp.net website - www.domain.com
I've used the built in OAuth in VS2012 to allow users to register on my
site using facebook. Unforutnately, I recently discovered that this has
not been working for users on Firefox. What makes this even more strange
is that, in the facebook app settings, if I change the site url from
http://www.domain.com to http://domain.com, it starts working in firefox
and stops working in chrome.
How can I fix this so it will work in both browsers???
Thursday, 8 August 2013
Multiple dynamic contact forms
Multiple dynamic contact forms
I have built a inquiry form on my website, the idea is instead of mailing
me each time a user submits a query it is added to my database which I can
then go and view via my backend system
Each query will be listed one by one with a text-area contact form below
it allowing me to reply to each query individually
So far I have this (sorry it's a bit messy)
foreach ($listings as $row){
$loop.= "<h3 class='text-center'>".$row['question']."</h3>";
$loop.= "<p>".$row['message']."</p>";
$loop.= "Name: <b>".$row['name']."</b>";
$loop.= "<span class='pull-right'>Email:
<b>".$row['email']."</b><br></span>";
$loop.= "<div class='clearfix'></div>";
if(isset($row['website'])){ $loop.="Website:
<b>".$row['website']."</b>"; }
$loop.= "<span class='pull-right'>Date: <b>".$row['date']."</b></span>";
$loop.= "<form name='submit-response' method='POST'><fieldset>";
$loop.= "<div class='form-group'> <label
for='Message".$counter."'>Your Message</label> <textarea
id='Message".$counter."' name='Message".$counter."'
class='form-control' rows='5'></textarea> </div>";
$loop.= "<button type='submit' name='submit".$counter."' class='btn
btn-default btn-block'>Reply</button>";
$loop.= "</fieldset></form>";
}
Before that is a foreach loop and the start of the oh and $counter is set
to nill
What I want is for each contact form to be unique so when I click send on
one of the queries it will be sent and removed so I can send another, the
only issue I am having is working out how I will work out if a submit has
been hit, and which submit has been hit
The code will need to workout which button has been hit and depending on
which button it will then mail() to the recipient
I'm quite stuck on this one and I'm not sure of the best course of action
so any advice is really appreciated
Luke
I have built a inquiry form on my website, the idea is instead of mailing
me each time a user submits a query it is added to my database which I can
then go and view via my backend system
Each query will be listed one by one with a text-area contact form below
it allowing me to reply to each query individually
So far I have this (sorry it's a bit messy)
foreach ($listings as $row){
$loop.= "<h3 class='text-center'>".$row['question']."</h3>";
$loop.= "<p>".$row['message']."</p>";
$loop.= "Name: <b>".$row['name']."</b>";
$loop.= "<span class='pull-right'>Email:
<b>".$row['email']."</b><br></span>";
$loop.= "<div class='clearfix'></div>";
if(isset($row['website'])){ $loop.="Website:
<b>".$row['website']."</b>"; }
$loop.= "<span class='pull-right'>Date: <b>".$row['date']."</b></span>";
$loop.= "<form name='submit-response' method='POST'><fieldset>";
$loop.= "<div class='form-group'> <label
for='Message".$counter."'>Your Message</label> <textarea
id='Message".$counter."' name='Message".$counter."'
class='form-control' rows='5'></textarea> </div>";
$loop.= "<button type='submit' name='submit".$counter."' class='btn
btn-default btn-block'>Reply</button>";
$loop.= "</fieldset></form>";
}
Before that is a foreach loop and the start of the oh and $counter is set
to nill
What I want is for each contact form to be unique so when I click send on
one of the queries it will be sent and removed so I can send another, the
only issue I am having is working out how I will work out if a submit has
been hit, and which submit has been hit
The code will need to workout which button has been hit and depending on
which button it will then mail() to the recipient
I'm quite stuck on this one and I'm not sure of the best course of action
so any advice is really appreciated
Luke
iOS >> Why isn't it Possible to Set UIControls Properties Directly in Code When Approaching Them via "sender"?
iOS >> Why isn't it Possible to Set UIControls Properties Directly in Code
When Approaching Them via "sender"?
Let's say that I wish to approach a certain UIControl in a certain method
that it triggers - I can send the method a pointer to the UIControl using
"sender". but then, for some reason, I cannot approach sender's properties
directly and have to use the setX:forState: methods. If I approach the
properties directly, I get no error or warning; it simply does nothing...
Here's an example:
h. file...
@interface MYViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *dButton; //connected to a
UIButton in IB
-(IBAction)dButtonClick:(UIButton*)sender; //connected to the same
UIButton in IB
@end
then...
m. file...
- (void)viewDidLoad
{
[super viewDidLoad];
self.dButton.titleLabel.textColor = [UIColor greenColor]; //this is
working...
}
-(IBAction)dButtonClick:(UIButton*)sender
{
sender.titleLabel.textColor = [UIColor redColor]; //this is not
working...
self.dButton.titleLabel.textColor = [UIColor redColor]; //this is also
not working...
[sender setTitleColor:[UIColor redColor]
forState:UIControlStateNormal]; //only this is working.
//But why?!?!?
}
I tried to search for some info about the way these items work, but
couldn't find anything that explains the logic behind it clear enough.
Any help would be... well... helpful...
When Approaching Them via "sender"?
Let's say that I wish to approach a certain UIControl in a certain method
that it triggers - I can send the method a pointer to the UIControl using
"sender". but then, for some reason, I cannot approach sender's properties
directly and have to use the setX:forState: methods. If I approach the
properties directly, I get no error or warning; it simply does nothing...
Here's an example:
h. file...
@interface MYViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *dButton; //connected to a
UIButton in IB
-(IBAction)dButtonClick:(UIButton*)sender; //connected to the same
UIButton in IB
@end
then...
m. file...
- (void)viewDidLoad
{
[super viewDidLoad];
self.dButton.titleLabel.textColor = [UIColor greenColor]; //this is
working...
}
-(IBAction)dButtonClick:(UIButton*)sender
{
sender.titleLabel.textColor = [UIColor redColor]; //this is not
working...
self.dButton.titleLabel.textColor = [UIColor redColor]; //this is also
not working...
[sender setTitleColor:[UIColor redColor]
forState:UIControlStateNormal]; //only this is working.
//But why?!?!?
}
I tried to search for some info about the way these items work, but
couldn't find anything that explains the logic behind it clear enough.
Any help would be... well... helpful...
Wednesday, 7 August 2013
Listview column reordering auto scroll
Listview column reordering auto scroll
I want to reorder my columns in UI,as I have lot of columns I want my
listview to auto scroll once I take my dragged column to the end of
visible scrollview.Is there a way to do it in MVVM?
I want to reorder my columns in UI,as I have lot of columns I want my
listview to auto scroll once I take my dragged column to the end of
visible scrollview.Is there a way to do it in MVVM?
Play Framework Error on BindRequest
Play Framework Error on BindRequest
I'm getting the following error on Play 2.1.3: [RuntimeException: Cannot
instantiate class controllers.Application$User. It must have a default
constructor]
Here's my Application.java file...I can't tell what I'm doing wrong! This
occurs when I make a POST request to /login.
package controllers;
import play.mvc.*;
import play.data.*;
import views.html.*;
public class Application extends Controller {
private static boolean loggedin = false;
private static User currentUser;
private static Form<User> LoginForm = Form.form(User.class);
public static Result index() {
String message, title;
if(!loggedin)
{
title = "Login";
message = "Please log in.";
}
else
{
title = "Welcome";
message = "You are logged in!";
}
return ok(index.render(title, message, loggedin));
}
public static Result login() {
currentUser = LoginForm.bindFromRequest().get();
if(currentUser.getUsername().equals("test") &&
currentUser.getPassword().equals("password")) {
loggedin = true;
return redirect(routes.Application.index());
}
else {
String title = "Login";
String message = "An error occurred. Please try logging in
again.";
return ok(index.render(title, message, loggedin));
}
}
static class User {
private String username;
private String password;
public User() {
this.username = "";
this.password = "";
}
public String getUsername() {
return this.username;
}
public String getPassword() {
return this.password;
}
}
}
I'm getting the following error on Play 2.1.3: [RuntimeException: Cannot
instantiate class controllers.Application$User. It must have a default
constructor]
Here's my Application.java file...I can't tell what I'm doing wrong! This
occurs when I make a POST request to /login.
package controllers;
import play.mvc.*;
import play.data.*;
import views.html.*;
public class Application extends Controller {
private static boolean loggedin = false;
private static User currentUser;
private static Form<User> LoginForm = Form.form(User.class);
public static Result index() {
String message, title;
if(!loggedin)
{
title = "Login";
message = "Please log in.";
}
else
{
title = "Welcome";
message = "You are logged in!";
}
return ok(index.render(title, message, loggedin));
}
public static Result login() {
currentUser = LoginForm.bindFromRequest().get();
if(currentUser.getUsername().equals("test") &&
currentUser.getPassword().equals("password")) {
loggedin = true;
return redirect(routes.Application.index());
}
else {
String title = "Login";
String message = "An error occurred. Please try logging in
again.";
return ok(index.render(title, message, loggedin));
}
}
static class User {
private String username;
private String password;
public User() {
this.username = "";
this.password = "";
}
public String getUsername() {
return this.username;
}
public String getPassword() {
return this.password;
}
}
}
Replace elements of a vector in R
Replace elements of a vector in R
I would like to apply the replace function to each string element in a
vector. So if i had a vector that looks like this:
t <- c("a1", "a2", "a3_!", "a4_!", "a5")
i would like to replace all "!" in the strings with a value
Thank you in advance for the help
I would like to apply the replace function to each string element in a
vector. So if i had a vector that looks like this:
t <- c("a1", "a2", "a3_!", "a4_!", "a5")
i would like to replace all "!" in the strings with a value
Thank you in advance for the help
Create mysql compatible Date from variables in PHP
Create mysql compatible Date from variables in PHP
I have a field set to type date in a mysql table. I get day, month and
year from user and at the moment I have the values returned like this:
[start_dateMonth] => 08 //$stardMonth
[start_dateDay] => 7 //$startDay
[start_dateYear] => 2013 //$startYear
How can I convert this to a valid date that I can easily insert in the
database?
This is my own code, but for some reasons the browser just shows a blank
screen with no source code inside:
$format = 'Y-m-d H:i:s';
$start = DateTime::createFromFormat($format,
"$startYear-$startMonth-$startDay $startHour:$startMinutes:00");
echo $start;
I have a field set to type date in a mysql table. I get day, month and
year from user and at the moment I have the values returned like this:
[start_dateMonth] => 08 //$stardMonth
[start_dateDay] => 7 //$startDay
[start_dateYear] => 2013 //$startYear
How can I convert this to a valid date that I can easily insert in the
database?
This is my own code, but for some reasons the browser just shows a blank
screen with no source code inside:
$format = 'Y-m-d H:i:s';
$start = DateTime::createFromFormat($format,
"$startYear-$startMonth-$startDay $startHour:$startMinutes:00");
echo $start;
Subscribe to:
Posts (Atom)