I am working on a form with the possiblity for the user to use illegal/special characters in the string that is to be submitted to the database. I want to escape/negate these characters in the string and have been using htmlspecialchars(). However, I would like to know if there is a better/faster method.
Basically what I want to do is display an email using javascript to bring the parts together and form a complete email address that cannot be visible by email harvesters.
I would like to take an email address eg [email protected] and break it to:
$variable1 = "info";
$variable2 = "thiscompany.com";
All this done in PHP.
Regards,
JB
I am trying to use the .NET Windows Form OpenFileDialog control to select a font file (not a font as you would with the FontDialog), but the dialog will not allow a mouse click to select a file in the C:\WINDOWS\Font directory.
Any ideas for choosing a font file
It's not a practically important issue, but could you please provide me with an example of tacit programming in F# where my `pointless' functions can have multiple arguments (not in form of list or tuple);
And secondly, where those functions can manipulate a complex data structure. I'm trying to manage it in FSharp interactive, but have no success yet.
Huh.. I've managed to construct something:
(fun _ - (fun _ - (+))) 333 222 111 555
Is that right way?
I am working on an MVC site using NHaml for the view engine.
I have a page that needs to submit HTML code as a form value and am getting the System.Web.HttpRequestValidationException thrown at me.
I want to specify the <%@ Page validateRequest="false" % so that this page will allow this data to be submitted but am unsure on how to do this with NHaml generating the pages.
I have a Django site in which the site admin inputs their Twitter Username/Password in order to use the Twitter API. The Model is set up like this:
class TwitterUser(models.Model):
screen_name = models.CharField(max_length=100)
password = models.CharField(max_length=255)
def __unicode__(self):
return self.screen_name
I need the Admin site to display the password field as a password input, but can't seem to figure out how to do it. I have tried using a ModelAdmin class, a ModelAdmin with a ModelForm, but can't seem to figure out how to make django display that form as a password input...
In an auto-generated chart based on a query (I dragged the chart object onto a blank form to start it), the chart itself is displaying and updating properly, datawise, but I want to change the Legend from reading "SumOfAvgOfield1" and "SumOfAvgOfield2" to regular words suitable for final presentations. But I can't find a way to change it!
Hello all,
i need to integrate modules that are developed in separate win form application.Application can run and test individual and in the integrated.i required to create a set up and deploy at client site.My two biggest challenges are keep assemblies in one place and reference them in application.
I have a text file and when users upload the file, the controller action method parses that file using state machine and uses a generic list to store some values. I pass this back to the view in the form of an IEnumerable. Within my main view, based on this ienumerable list I render a partail view to iterate items and display labels and a textarea. Users could add their input in the text area. When the users hit the save button this ienumrable list from the partial view rendered is null. so please advice any solutions.
here is my main view
@model RunLog.Domain.Entities.RunLogEntry
@{
ViewBag.Title = "Create";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm("Create", "RunLogEntry", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div id="inputTestExceptions" style="display: none;">
<table class="grid" style="width: 450px; margin: 3px 3px 3px 3px;">
<thead>
<tr>
<th>
Exception String
</th>
<th>
Comment
</th>
</tr> </thead>
<tbody>
@if (Model.TestExceptions != null)
{
foreach (var p in Model.TestExceptions)
{
Html.RenderPartial("RunLogTestExceptionSummary", p);
}
}
</tbody>
</table>
</div>
}
partial view as follows:
@model RunLog.Domain.Entities.RunLogEntryTestExceptionDisplay
<tr>
<td>
@Model.TestException@
</td>
<td>@Html.TextAreaFor(Model.Comment, new { style = "width: 200px; height: 80px;" })
</td>
</tr>
Controller action
[HttpPost]
public ActionResult Create(RunLogEntry runLogEntry, String ServiceRequest, string Hour, string Minute, string AMPM,
string submit, IEnumerable<HttpPostedFileBase> file, String AssayPerformanceIssues1, IEnumerable<RunLogEntryTestExceptionDisplay> models)
{
}
The problem is test exceptions which contains exception string and comment is comming back null.
Hi,
My tables are named in a plural form - Models / Entities, is there a way to make the generated classes named Model / Entity?
(Don't know if this is relevant, but I'm using Propel as the ORM)
Thanks.
I am writing a module and I need to retrieve values set in a form_submit function from a page handler function. The reason is that I am rendering results of a form submit on the same page as the page handler.
I have this working, but I am using global variables, which I don't like. I'd like to be able to use the $form_state['storage'] for this, but can't since I don't have access to the $form_state variable from the page handler.
Any suggestions?
I work on a Symfony web application which has a standard login form. To allow users to login more easily we want to give them a link which logs them in directly. I've already build a way to get a token to use, but I have no clue as to how the Symfony login process works, specifically how I can adapt it to take a GET/POST token instead of redirecting to the login page.
Any help appreciated!
Oh and this is Symfony 1.2 BTW (and no, upgrading is not an option right now)
How do I go about sending a Windows Message to a form in my application that is not the MainForm? Using the code below gives me an Access Violation.
procedure TMainForm.SendMessageToAnotherForm;
begin
SendMessage(MyForm.Handle,WM_MY_MESSAGE,0,0);
end;
MyForm has already been created and is the top most window.
Hello , how do I disable browsing to a http link from a Html editor. I have a vb.net web form with a html editor, when I add a hyperlink to the html editor, for example my application website for instance
http://myapplication/myloginpage.aspx
When I run and click the link I can browse my application from inside the Html Editor, which is so weird. How do I stop this from happening.
This is an Intranet application. And the component for Html Editor is of TMS.
Hi all i am new to black berry.I have Experience on Android .Now i want to learn Black berry .In android an application contain res folder in that we add the lay out in xml form and we can create the forms easily using views and lay outs.
In the same way is there any facility in black berry?please give me some suggestions to prepare forms in black berry .
I wanted to use FormsAuthentication to secure my static files as well on my site, so I followed the instructions located here http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis7-integrated-pipeline/ under title "Enabling Forms Authentication for the Entire Application".
Now though, when I try to visit the site by going directly to http://www.mysite.com I get redirected to http://www.mysite.com/Login.aspx?ReturnUrl=%2f instead of it using my DefaultDocument I have set. I can go to my default document by just visiting http://www.mysite.com/Home.aspx without any issues because it is set to allow anonymous access.
Is there something I need to add into my web.config file to make iis7 allow anonymous access to the root? I tried adding with anonymous access but no such luck.
Any help would be much appreciated.
Both Home and the Login form allow anonymous.
<location path="Home.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
Login form is set as the loginUrl
<authentication mode="Forms">
<forms protection="All" loginUrl="Login.aspx">
</forms>
</authentication>
Default document is set as Home.aspx
<defaultDocument>
<files>
<add value="Home.aspx" />
</files>
</defaultDocument>
I have not removed any of the iis7 default documents. However, Home.aspx is first in the priority.
I am trying to echo the action for my form if a post equals 'paypal'
This is what I have:
<?php if $_POST['method'] == 'paypal' echo 'action="paypal/process.php"' else echo 'action="moneybookers/process.php" '?>
Do i need to print the variable before I do this? what am I doing wrong?
I get this error:
Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /var/www/account/credits/credit_amount.php on line 27
With ASP.NET Webforms, I could drag and drop a control on a form and be able to access its properties:
if (number == 0)
AddButton.Enabled = false;
Although I cannot drag and drop a control on a ASP.NET MVC View template, can I change its attributes?
For instance:
disable a button in some conditions and be able to enable it if conditions change.
Be able to change the text of a button from "Next-" to "Finish"
etc.
Trying to add a 'box' to a form at design time, I looked up the msdn and it clearly states that I should be able to do this using the OvalShape and RectangleShape control tools in my Visual Studio 2008.
shape container
Now it should be found under the visual Basic PowerPacks, but all I have listed is Pointer and PrintForm, how do I add it?
The winforms default font for menus in mono (Ubuntu 10.04) does not support german Umlauts. While I can set the font for form content (this.Font), I could not figure out where to configure the menu font. Any suggestions?
I'm in need of help... this is my first time asking a question in SO, so please be kind :)
I'm trying to force-download a file from php, so when the user hits a certain button, he gets a file download. The file is a csv (email, username) of all registered users.
I decided to add this button to the admin users screen, as you can see in this screenshot.
So I added the following code to the addToolbar function in administrator/components/com_users/views/users/view.html.php:
JToolBarHelper::custom('users.export', 'export.png', 'export_f2.png', 'Exportar', false);
This button is mapped to the following function in the com_users\controller\users.php controller:
public function exportAllUsers() {
ob_end_clean();
$app = JFactory::getApplication();
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=ideary_users.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo "email,name\n";
$model = $this->getModel("Users");
$users = $model->getAllUsers();
foreach ($users as $user) {
echo $user->email . ", " . ucwords(trim($user->name)) . "\r\n";
}
$app->close();
}
Now, this is actually working perfectly fine.
The issue here is that after I download a file, if I hit any button in the admin that causes a POST, instead of it performing the action it should, it just downloads the file over again!
For example:
I hit the "Export" button
"users.csv" downloads
Then, I hit the "search" button
"users.csv" downloads... what the hell?
I'm guessing that when I hit the export button, a JS gets called and sets a form's action attribute to an URL... and expects a response or something, and then other button's are prevented from re-setting the form's action attribute. I can't think of any real solution for this, but I'd rather avoid hacks if possible.
So, what would be the standard, elegant solution that joomla offers in this case?
You have a web page with a form that has an input field of type file. You have another web page that expects the data from the first page.
In the second page you need to check whether a file has been sent.
How do you do that?
I've been using the following statement but I'm not sure about it:
$_FILES["file"]["tmp_name"] == ""
I am using asp.net webforms... I have a user registration form where the user uploads his resume.... I use a file upload control and when the user submits it i trigger mail to few mailIds... Now my problem can i attach the file which was uploaded by the user as attachment to the mailids... Is it possible in asp.net... Any suggestion....
How do i design a socket server, which accept various trades ( stock symbol, its value )
Trades are coming in the form of continuous stream.
I need to process those trades based on the subscription client list.