mardi 31 mars 2015

TokenMismatchException on different workstations

Laravel 5 Website:


When my co-workers submit forms on the website, they are getting the error: tokenmismatchexception


My co-workers are both running on Mac-os and using Mamp to host the website.


I myself am running on Windows 7 64bit and using Xamp. I have never run into this error myself.


We all are using source-tree and they have the exact same project as me. Completely unedited. They've tried deleting and cloning it again but still the same problem.


This question is quite vague but I'd appreciate if someone could give some insight on what to look into for possible solutions.


Passing form object to another method

Im trying to pass a form object from the method that creates it to one that will show it and set a few properties on it, instead of having the smae code in each button event. Im getting the error "Argument 1: cannot convert from 'ref RWCStatTracker.Fixture.FRMAddFixture' to 'ref System.Windows.Forms.Form'" and "The best overloaded method match for 'RWCStatTracker.Form1.showForm(ref System.Windows.Forms.Form)' has some invalid arguments" These are occuring on line 70 in the button click event where it has showForm(ref frm);



public void addToolStripMenuItem3_Click(object sender, EventArgs e)
{
RWCStatTracker.Fixture.FRMAddFixture frm = new RWCStatTracker.Fixture.FRMAddFixture();
showForm(ref frm);
}

public void showForm(ref Form frm)
{
frm.TopLevel = false; //set it's TopLevel to false

Controls.Add(frm); //and add it to the parent Form
frm.Show(); //finally display it

frm.BringToFront(); //use this it there are Controls over your form.
}


I've found many articles on google but none are really achieving what im trying to achieve


Any ideas how I can make this work?


Typo3 powermail optin redirect

My static form works like a charm. But when I try to use the optin, the redirect breaks. The redirect is to the same page where the form is send from and additionally my form is hidden an the optinmessage is shown. I want to achive, that I am redirected to a special id and that my form is shown again without the message. Here my code. It´s a static code which I place at the footer, because this form is on every page.



lib.newsletterform < tt_content.list.20.powermail_pi1
lib.newsletterform {
settings.setup {
thx.redirect = {$page.pages.newsletter.thankyou}
receiver {
email = {$page.newsletter.receiver.email}
name = {$page.newsletter.receiver.name}
subject = {$page.newsletter.receiver.subject}
}
sender {
email = {$page.newsletter.sender.email}
name = {$page.newsletter.sender.name}
senderName = {$page.newsletter.sender.senderName}
senderEmail = {$page.newsletter.sender.senderEmail}
subject = {$page.newsletter.sender.subject}
}
main {
# newsletterform
form = 1
optin = 1
pid = 37
}
}
view {
# set new template for footer layout
templateRootPath >
templateRootPaths >
templateRootPaths {
10 = packages/Sites/page/Resources/Private/plugins/powermail/TemplatesFooter/
}
}
}

How to POST form data from within a table to PHP

I currently have a Timesheet form I am creating for the employees at my work and I am stuck at getting the input values to post correctly. I have a database set up but right now, I can't even get the values to show in a .php page. Here is a sample from my current table:



<html>
<form method="POST" form action="result.php">
<table>
<tr><td><b>Day of Week</td><td><b>Week 1 Hours</td><td><b>Week 2 Hours</td> <td>
<tr><td>Monday</td><td>
<input type="text" name="Monday" size="3" maxlength="4" value="" onkeypress="return inputLimiter(event,'Numbers')">
<input type="checkbox" tabindex="-1" name="Stime1">Sick?<input type="checkbox" tabindex="-1" name="Vac1">Vacation?</td>
<td><input type="text" name="Monday2" size="3" maxlength="4" value="" onkeypress="return inputLimiter(event,'Numbers')">
<input type="checkbox" tabindex="-1" name="Stime2">Sick?<input type="checkbox" tabindex="-1" name="Vac2">Vacation?</td></tr>
</table>
<input type="submit" value="submit">
</html>


This pattern continues for each day of the week. And then when I try to view the results of the post I couldn't get anything to work. I resorted to trying:



<html>
<?php var_dump ($_POST);
?>
</html>


All I get is a blank page, and if I view source it just shows the php code used. It's late here so I must be too tired and missing something but I just can't figure it out. Any and all help is much appreciated.


Thanks!


Creating a search text box in an Access 2013 Navigation Subform

I created a search text box in Access 2013 that works as in should in the form. When I moved the form to the Navigation form it stopped working. I receive the following error: "The action or method is invalid because the form or report isn't bound to a table or query." I have changed the condition in the Embedded Macro to read as follows:



[conLastName] Like "*" & [Forms]![frmNavigation]![NavigationSubform].[Form]![TxtSearchContacts] & "*"


I have also tried:



[conLastName] Like "*" & [Forms]![frmNavigation].[NavigationSubform].[Form]![TxtSearchContacts] & "*"


And:



[conLastName] Like "*" & [Forms]![frmNavigation]![NavigationSubform]![Form]![TxtSearchContacts] & "*"


Any and all insight would be greatly appreciated. I have spent well over two hours beating my head against the wall on this one. Thank you. ~Christa


Form not sending, directs to php file but does does nothing

I have a contact form on a site and use php to send the message, I took the php file from another site I created and changed it to suite the needs of this site which is why I don't see where the problem is, it worked fine on the other site. The PHP is here:



<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Submitting...</title>

</head>

<body>

<?php
$name = $_POST ['name'];
$company = $_POST['company'];
$phone_number = $_POST['phone_number'];
$email = $_POST['email'];
$client = $_POST['current-client'];
$office = $_POST['office'];
$enquiry = $_POST['enquiry'];
$formcontent = "Name: $name
\n Company: $company
\n Phone Number: $phone_number
\n Email: $email
\n Client: $client
\n Office: $office
\n Enquiry: $enquiry";
$recipient = "tristan.dyas@gmail.com";
$subject = "$office Website contact";
$mailheader = "From: $email \r\n";
ini_set("sendmail_from","tristan.dyas@gmail.com");
mail($recipient, $subject, $formcontent, $mailheader) or die("Please try again.");
echo "Form Submitted.";
header("Location: http://ift.tt/19vntly");
?>

</body>
</html>


And the html:



<div id="contact_form_container">
<form id="contact_form" name="contact_form" method="post" action="mail.php">
<table width="" align="center" border="0">
<tr>
<td colspan="3" align="center" style="height: 4.0em;">&nbsp;</td>
</tr>
<tr>
<td class="label-cell"><label for="name">Full Name*</label></td>
<td>&nbsp;</td>
<td class="label-cell"><label for="company">Company Name (If Applicable)</label></td>
</tr>
<tr>
<td width="145"><input type="text" name="name" id="name" class="text" /></td>
<td width="25" rowspan="8">&nbsp;</td>
<td width="145"><input type="text" name="company" id="company" class="text" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="label-cell"><label for="email">Email Address*</label></td>
<td class="label-cell"><label for="phone_number">Phone Number*</label></td>
</tr>
<tr>
<td><input type="email" name="email" id="email" class="text" /></td>
<td><input type="number" name="phone_number" id="phone_number" class="text" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="label-cell"><label for="current-client">Current Client?*</label></td>
<td class="label-cell"><label for="office">Office (If Applicable)</label></td>
</tr>
<tr>
<td><select name="current-client" id="current-client-drp" class="dropdown-select">
<option selected>Please Select...</option>
<option>Yes, current client</option>
<option>No, not a client</option>
<option>No, previous client</option>
</select></td>
<td><select name="office" id="office-drp" class="dropdown-select">
<option selected>Please Select...</option>
<option>Cotteridge</option>
<option>Handsworth</option>
<option>Solihull</option>
<option>Grimsby</option>
</select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><label for="enquiry">Message:</label></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><textarea name="enquiry" id="enquiry"></textarea></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center"><input name="submit" type="submit" id="submit" form="contact_form" formaction="mail.php" formenctype="multipart/form-data" formmethod="POST" formtarget="_self" title="Submit" value="Submit"></td>
</tr>
</table>
</form>
</div>


When I fill out the form and hit submit, it goes to the sending page, but just sits there and does nothing. The message does not send either. It's a simple form, I have checked and double checked but I am not great with PHP, I focus more on HTML and CSS so this is a little outside my comfort zone. Any help will be greatly appreciated.


Why can't my jQuery transitions be seen during form submission?

I want to create a transition indicating form submission is in progress when user click the submit button. I have the following codes.



$('div').on('submit', 'form', function(e){

if (transition_done === true) {
transition_done = false; // reset flag
return; // let the event bubble away
}

e.preventDefault();

$('.button').hide();
$('.transition').show();

transition_done = true; // set flag
this.submit();

});


The effect is doing OK on web. But when browse on mobile using the Android browser, the effect doesn't show up. INstead, it submits the form directly. Why is it like that and how can I fix it? Thanks!