Help with HTML form,please!
Hi everybody,
I'm trying to write an HTML form that would allow user to login if he/she has already created username and password AND that would let him/her create an account in case the user is not registered yet. The code below creates a form that allows the user login after what this provided data would be sent to some servlet:
<HTML>
<HEAD>
<TITLE>Meeting-scheduling</TITLE>
</HEAD>
<BODY>
<H2>Login To Meeting-Scheduling Program</H2>
<FORM METHOD="POST" ACTION="someServlet">
Username: <INPUT TYPE="TEXT" NAME="username" SIZE="25"><BR>
Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE="25"><P>
<INPUT TYPE="SUBMIT" VALUE="Submit">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
</BODY>
</HTML>
Now,I can't figure out how to add another button, for example, that would trigger another servlet and/or open another form and that would allow user to create an acount. Is this feasible at all? What I basically need is two forms on a single page triggering two different servlets. Thanks a lot,Jimmy.
Yes u can trigger as many as servlets u want ,by using Javascript.make a normal button to act as submit button
for e.g
document.frm.action="/servlet/servletname"
dovument.frm.method=post
document.frm.submit()
I hope this helps u :),if u still have problem mail me at
[email protected]
Similar Messages
-
I need help on some HTML code if at all possible.
What I am trying to do is set up a page that someone can
enter their name address and email into a form and when they hit
the submit button it automatically sends them a premade email of my
choosing that I make prior and somehow maybe embeded into the html
code to the address that they entered? I dont know if it is
possible but I am sure it can be.
Thank you in advanceActually, you could be subject to "abuse complaints", not
"abuse".
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"bregent" <[email protected]> wrote in
message
news:fb547q$b49$[email protected]..
> >What I am trying to do is set up a page that someone
can enter their name
> address
>
> Sure, you can do it fairly easily with any scripting
language. You need to
> be
> cautious about sending automated emails to anyone
without first validating
> that
> they are the actual owners of the email address,
otherwise you open your
> site
> up to abuse.
>
> >I dont know if it is possible but I am sure it can
be.
>
> Huh?
> -
Hello,
I am having some trouble with my HTML format. I am trying to
have it so when I click on my thunbnail another picture shows up as
a popup. you can see what I am trying to do at this link
http://209.66.101.242/EZ-Templates/calendars.php
Here is what my code looks like. If you are able to tell me
what I have wrong I would appreciate it. Thanks in advance
<DIV align=center><a
onclick="return enlarge('
http://www.brcphotography.com/holidaycards/pics/annual/CL02.jpg',event,'center',300,375)"
href="pics/quarterly/CL08-3.jpg"><img
src="pics/quarterly/CL08-3 thumb.gif" name="thumbnail"
border="0" id="thumbnail"
/></A></DIV></TD></TR>
<TR>
<TD>
<DIV class=product_name
align=center>CL08-3</DIV>Works fine for me in boty IE7 and FF. Did you fix it after
posting?
emichael brandt
cdc3323 wrote:
> Hello,
>
> I am having some trouble with my HTML format. I am
trying to have it so when
> I click on my thunbnail another picture shows up as a
popup. you can see what
> I am trying to do at this link
http://209.66.101.242/EZ-Templates/calendars.php
>
> Here is what my code looks like. If you are able to tell
me what I have wrong
> I would appreciate it. Thanks in advance
>
> <DIV align=center><a
> onclick="return
> enlarge('
http://www.brcphotography.com/holidaycards/pics/annual/CL02.jpg',event,
> 'center',300,375)"
> href="pics/quarterly/CL08-3.jpg"><img
> src="pics/quarterly/CL08-3 thumb.gif"
> name="thumbnail"
> border="0" id="thumbnail"
> /></A></DIV></TD></TR>
> <TR>
> <TD>
> <DIV class=product_name
> align=center>CL08-3</DIV>
>
> -
2 Formatting issues with HTML forms
I have a couple of issues that we can't seem to get past with adobe livecycle designer 7.0. We have an internal form, rendered in HTML, that is emailed between departments, and the data entered is stored in an XML file that is created using the code similar to the following:
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException
oOutput = response.getOutputStream();
try {
FormServerWithXML fsb = new FormServerWithXML();
fsb.processForm(request);
File file = File.createTempFile("Form_", ".tmp", new
File("d:\\xmlFiles"));
BufferedWriter(new FileWriter(file));
out.write(fsb.getXMLString());
out.close();
When we use a numeric field and try to format it with any display pattern containing dollar signs, decimals, etc... the xml data for that field isn't being written to the xml file. All of the other fields are being written properly.
The next issue we're having is that with HTML forms, when we create a multiline text field we are unable to limit the number of characters that are allowed in the field.
I'm pretty new with this, so please send some advice my way if you have any.
Thanks,
ChadThanks Rakhi, but that did not resolve my issue. Below is new out as per the thread suggestion and this is not what I wanted.:
"<H>Thank you for choosing Enterprise.</> We look forward to seeing you at 9:00 am on Monday,
November 28, 2011. This message is to confirm you have updated your reservation.
Following are the details for the updated reservation:
P.S. Remember us when you're renting in town. Enterprise is always nearby at more than 6,500
neighborhood locations."
- shalini -
Help with access control please
So I'm trying to set up my brother's PSP to the wirless network through MAC address timed access. What I want to do is make it so that he can only access it through certain times in the day. I'm having troubles with actually getting it to work. Everytime I set it up, the PSP only show's up as a DHCP client and not a Wireless client. I tried the option panel with the add wireless clients through the first try access. Could I get some help with this issue please? Thanks!
Just to calm your fears... There is no conspiracy. If someone had an answer or a suggestion they would post it.
-
Help with html / php contact form
Hi guys I was hoping to get some help with a contact form on my website, to be honest I havent a clue about php but kind of okay with html thats why the php code is just a copy and paste from some website, just trying to marry it up with the html but getting errors.
Hopfully one of you can see the problem.
Error on Submitting:
Notice: Undefined variable: name in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 69
Notice: Undefined variable: message in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 75
We are very sorry, but there were error(s) found with the form you submitted. These errors appear below.
The Name you entered does not appear to be valid.
The Comments you entered do not appear to be valid.
HTML Code:
<section id="contact" class="four">
<div class="container">
<header>
<h2>Contact</h2>
</header>
<form method="post" action="send_form_email.php">
<div class="row half">
<div class="6u"><input type="text" class="text" name="name" placeholder="Name" /></div>
<div class="6u"><input type="text" class="text" name="email" placeholder="Email" /></div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<a href="http://www.mywebsite.co.uk/email_form.php" class="button submit">Send Message</a>
</div>
</div>
</form>
</div>
</section>
php Code:
<?php
if(isset($_POST['email'])) {
$email_to = "my email address";
$email_subject = "Mail from Site";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['message'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
$first_name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$comments = $_POST['message']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
if(strlen($message) < 1) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
if(strlen($error_message) > 0) {
died($error_message);
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
$email_message .= "Name: ".clean_string($name)."\n";;
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<?php
?>PHP CODE: SaveAs send_form_email.php
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "[email protected]";
$email_subject = "Your email subject line";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['message'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$comments = $_POST['message']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
if(strlen($message) < 2) {
$error_message .= 'The message you entered does not appear to be valid.<br />';
if(strlen($error_message) > 0) {
died($error_message);
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
?>
HTML Code -- save as html page.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Form</title>
</head>
<body>
<section id="contact" class="four">
<div class="container">
<header>
<h2>Contact</h2>
</header>
<form method="post" action="send_form_email.php">
<div class="row half"> <div class="6u">
<input type="text" class="text" name="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" class="text" name="email" placeholder="Email" />
</div>
</div>
<div class="row half"> <div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" name="submit" value="Send">
</div>
</div>
</form>
</div>
</section>
</body>
</html>
Upload both to your Apache server to test.
EDIT: changed typo on Submit button -- valuse to value.
Nancy O. -
Help... Populate pdf form fields with html form inputs.
I have a website that allows users to choose the pdf document they want and create. After selecting which pdf they want to create they are redirected to a web page with a html form. The html form has questions that corresponds with the the form fields of the pdf document the user selected. When submitted the code (ASP, PHP whatever is the easier) runs a script that populates the pdf document form fields. The user is then prompted if they want to save or open the document. The newly created pdfs and the user inputs do not need to be saved on the server.
I create the pdf templates using PDF 6.0 professional
Server can be windows or linux
I understand ASP a little but will use whatever is feasible
Purchasing a program is okay as long as its reasonable and is changeable by me and I have full control.
Any help would be appreciated...
Thanks,
JohnTry the Developers/SDK forum...
This forum is for questions about the PDF Language itself.
Leonard -
Help with Login Form (JSP DB Java Beans Session Tracking)
Hi, I need some help with my login form.
The design of my authetication system is as follows.
1. Login.jsp sends login details to validation.jsp.
2. Validation.jsp queries a DB against the parameters received.
3. If the query result is good, I retrieve some information (login id, name, etc.) from the DB and store it into a Java Bean.
4. The bean itself is referenced with the current session.
5. Once all that's done, validation.jsp forwards to main.jsp.
6. As a means to maintain state, I prefer to use url encoding instead of cookies for obvious reasons.I need some help from step 3 onwards please! Some code snippets will do as well!
If you think this approach is not a good practice, pls let me know and advice on better practices!
Thanks a lot!Alright,here is an example for you.
Assume a case where you don't want to give access to any JSP View/HTML Page/Servlet/Backing Bean unless user logging system and let assume you are creating a View Object with the name.
checkout an example (Assuming the filter is being applied to a pattern * which means when a resource is been accessed by webapplication using APP_URL the filter would be called)
public doFilter(ServletRequest req,ServletResponse res,FilterChain chain){
if(req instanceof HttpServletRequest){
HttpServletRequest request = (HttpServletRequest) req;
HttpSession session = request.getSession();
String username = request.getParameter("username");
String password = request.getParameter("password");
String method = request.getMethod();
String auth_type = request.getAuthType();
if(session.getAttribute("useInfoBean") != null)
request.getRequestDispatcher("/dashBoard").forward(req,res);
else{
if(username != null && password != null && method.equaIsgnoreCase("POST") && (auth_type.equalsIgnoreCase("FORM_AUTH") || auth_type.equalsIgnoreCase("CLIENT_CERT_AUTH")) )
chain.doFilter(req,res);
else
request.getRequestDispatcher("/Login.jsp").forward(req,res);
}If carefully look at the code the autherization is given only if either user is already logged in or making an attempt to login in secured way.
to know more insights about where these can used and how these can be used and how ?? the below links might help you.
http://javaboutique.internet.com/tutorials/Servlet_Filters/
http://e-docs.bea.com/wls/docs92/dvspisec/servlet.html
http://livedocs.adobe.com/jrun/4/Programmers_Guide/filters3.htm
http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
http://www.servlets.com/soapbox/filters.html
http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
and coming back to DAO Pattern hope the below link might help you.
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
http://java.sun.com/blueprints/patterns/DAO.html
http://www.javapractices.com/Topic66.cjp
http://www.ibm.com/developerworks/java/library/j-dao/
http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html
On the whole(:D) it is always a good practice to get back to Core Java/J2EE Patterns.and know answers to the question Why are they used & How do i implement them and where do i use it ??
http://www.fluffycat.com/java-design-patterns/
http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
http://www.cmcrossroads.com/bradapp/javapats.html
Hope that might help :)
REGARDS,
RaHuL -
Help with web form script. PHP, CGI, Perl???
anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.
Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
<pre>
<?php
$emailFrom = '[email protected]';
$emailTo = '[email protected]';
$emailSubject = 'Subject';
$date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
$browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
$hostname = $HTTPSERVER_VARS['REMOTEADDR'];
$message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
foreach ($_POST as $key => $value) {
$message .= $key . ": " . $value . "\n";
$mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
?>
</pre>
This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
Also, this script expects your form method="post".
Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
<pre><?php
if ($mailResult) {
echo "Your comments have been received thank you.";
} else {
echo "There was an error. Please try again or contact us using an alternate method.";
?></pre> -
Livecycle design 8 Help with PDF forms
I am new to Livecycle 8. I have created a simple PDF form in Livecycle 8 which was orignally an excel form. I set it up with a submit button to submit by email to a designated person. The form is housed on an internal web site for viewers with adobe reader to open and fill out and then submit by email. The goal is for the designated receiver to receive the the same PDF form with the information filled out by the previous viewer. I was successful with the form being emailed to the designated person as long as the peson submitting the form was using adobe professional. If the viewer only has adobe reader, the form would not submit to the designated receiver. Please help?
Reader does not allow a local save of the form and data by default. To be able to add the attachment o an email message a local save must occur. You can Reader Extend your form to allow for this. Open th eform in Acrobat Pro. Under the Advanced menu choose the "Extend Features in Adobe Reader". Follow the wizard and save the result PDF as a different name ....I like to put RE in the name so I know it is Reader Extended. Try the new file.
paul -
I created a Contact Form in DW CS6, and I used the php and html files provided by Nancy O. in her forum dated back to October 2011. Follow the link for details. http://forums.adobe.com/message/3970070#3970070
I believe I have followed all the required steps, and almost everything seems working properly, except that I am not (Recipient) getting an e-mail. However, the client has received an automated reply from me (Recipient). But no e-mail were sent to me.
Please refer to below (Part of php code - Between Lines 12 and 35) where I have made the changes:
I am not sure where I have made an error(s). Could anyone please assist?Hi Nancy,
I created a new Gmail address as you suggested, and then tested the Form with it. I still can't receive an e-mail.
Also, I have contacted my Web Host, and they confirmed that there are no issues from their end.
I have attached below both the php and the html files, and I would appreciate if you can take a look at them for correctness:
PHP File:
<?php
// Form Processing Script
// General Variables
$check_referrer="no";
$referring_domains="http://domain.com/,http://www.domain.com/,http://subdomain.domain.com/";
// options to use if hidden field "config" has a value of 0
// recipient info
$charset[0]="iso-8859-1";
$tomail[0]="[email protected]";
$cc_tomail[0]=" ";
$bcc_tomail[0]="";
// Mail contents config
$subject[0]="message from EMCG.COM";
$reply_to_field[0]="email";
$reply_to_name[0]="email";
$required_fields[0]="first_name,last_name";
$required_email_fields[0]="email";
$attachment_fields[0]="";
$return_ip[0]="yes";
$mail_intro[0]="The following message was sent from EMCG.COM:";
$mail_fields[0]="first_name,last_name,email,phone,subject,message";
$mail_type[0]="text";
$mail_priority[0]="1";
$allow_html[0]="no";
// Send back to sender config
$send_copy[0]="yes";
$copy_format[0]="vert_table";
$copy_fields[0]="first_name,last_name,subject,message";
$copy_attachment_fields[0]="";
$copy_subject[0]="EMCG automated reply";
$copy_intro[0]="Thanks for taking time to contact EMCG. Someone will be in touch with you soon.";
$copy_from[0]="[email protected]";
$copy_tomail_field[0]="email";
// Result options
$header[0]="";
$footer[0]="";
$error_page[0]="";
$thanks_page[0]="";
// Default Error and Success Page Variables
$error_page_title[0]="Error - Missing Fields";
$error_page_text[0]="Required information is missing. Please use your browser's back button to return to the form and complete the required fields.";
$thanks_page_title[0]="Success - Form processing completed";
$thanks_page_text[0]="Thank you. Please check your e-mail for an automated confirmation. ";
// Antispam Options
$empty_field[0]="nospam";
$character_scan[0]="message";
$time_delay[0]="";
$captcha_codes[0]="9C2449,EEADC8,77A585,D72838";
$max_urls[0]="1";
$max_url_fields[0]="message";
$flag_spam[0]="";
// Don't muck around past this line unless you know what you are doing //
ob_start();
$config=$_POST["config"];
$debug=0;
$debug_text="";
// fix for Windows email server security
ini_set("sendmail_from",$tomail[$config]);
// email validation regular expression
$regex = "^[-a-z0-9!#$%&\'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&\'*+/=?^_`{|}~]+)*@(([a-z0-9]([-a-z0-9]*[a -z0-9]+)?){1,63}\.)+([a-z]([-a-z0-9]*[a-z0-9]+)?){2,63}$";
$header_injection_regex = "(\r|\n)";
if($header[$config]!="")
include($header[$config]);
if($_POST["submit"] || $_POST["Submit"] || $_POST["submit_x"] || $_POST["Submit_x"])
// begin global functions //
// get visitor IP
function getIP()
if(getenv(HTTP_X_FORWARDED_FOR))
$user_ip=getenv("HTTP_X_FORWARDED_FOR");
else
$user_ip=getenv("REMOTE_ADDR");
return $user_ip;
// get value of given key
function parseArray($key)
$array_value=$_POST[$key];
$count=1;
extract($array_value);
foreach($array_value as $part_value)
if($count > 1){$value.=", ";}
$value.=$part_value;
$count=$count+1;
return $value;
// stripslashes and autolink url's
function parseValue($value)
$value=preg_replace("/(http:\/\/+.[^\s]+)/i",'<a href="\\1">\\1</a>', $value);
return $value;
// html header if used
function htmlHeader()
$htmlHeader="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset[$config]."\"></head>\n<body>\n<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"600\">\n";
return $htmlHeader;
// html footer if used
function htmlFooter()
$htmlFooter="</table>\n</body>\n</html>\n";
return $htmlFooter;
// build verticle table format
function buildVertTable($fields, $intro, $to, $send_ip)
$message=htmlHeader();
if($intro != "")
$message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"2\">".$intro."</td>\n</tr>\n";
$fields_check=preg_split('/,/',$fields);
$run=sizeof($fields_check);
for($i=0;$i<$run;$i++)
$cur_key=$fields_check[$i];
$cur_value=$_POST[$cur_key];
if(is_array($cur_value))
$cur_value=parseArray($cur_key);
$cur_value=parseValue($cur_value);
if($allow_html[$config]=="no")
$cur_value=htmlspecialchars(nl2br($cur_value));
else
$cur_value=nl2br($cur_value);
$message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$cur_value."</td>\n</tr>\n";
if($send_ip=="yes" && $to=="recipient")
$user_ip=getIP();
$message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$user_ip."</td>\n</tr>\n";
$message.=htmlFooter();
return $message;
// build horizontal table format
function buildHorzTable($fields, $intro, $to, $send_ip)
$message=htmlHeader();
$fields_check=preg_split('/,/',$fields);
$run=sizeof($fields_check);
if($intro != "")
$message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"".$run."\">".$intro."</td>\n</tr>\n";
$message.="<tr>\n";
for($i=0;$i<$run;$i++)
$cur_key=$fields_check[$i];
$message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n";
if($send_ip=="yes" && $to=="recipient")
$message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n";
$message.="</tr>\n";
$message.="<tr>\n";
for($i=0;$i<$run;$i++)
$cur_key=$fields_check[$i];
$cur_value=$_POST[$cur_key];
if(is_array($cur_value))
$cur_value=parseArray($cur_key);
$cur_value=parseValue($cur_value);
if($allow_html[$config]=="no")
$cur_value=htmlspecialchars(nl2br($cur_value));
else
$cur_value=nl2br($cur_value);
$message.="<td align=\"left\" valign=\"top\">".$cur_value."</td>\n";
$message.="</tr>\n";
$message.="<tr>\n";
if($send_ip=="yes" && $to=="recipient")
$user_ip=getIP();
$message.="<td align=\"left\" valign=\"top\">".$user_ip."</td>\n";
$message.="</tr>\n";
$message.=htmlFooter();
return $message;
// build plain text format
function buildTextTable($fields, $intro, $to, $send_ip)
$message="";
if($intro != "")
$message.=$intro."\n\n";
$fields_check=preg_split('/,/',$fields);
$run=sizeof($fields_check);
for($i=0;$i<$run;$i++)
$cur_key=$fields_check[$i];
$cur_value=$_POST[$cur_key];
if(is_array($cur_value))
$cur_value=parseArray($cur_key);
$cur_value=parseValue($cur_value);
if($allow_html[$config]=="no")
$cur_value=htmlspecialchars($cur_value);
else
$cur_value=$cur_value;
$message.="".$cur_key.": ".$cur_value."\n";
if($send_ip=="yes" && $to=="recipient")
$user_ip=getIP();
$message.="Sender IP: ".$user_ip."\n";
return $message;
// get the proper build fonction
function buildTable($format, $fields, $intro, $to, $send_ip)
if($format=="vert_table")
$message=buildVertTable($fields, $intro, $to, $send_ip);
else if($format=="horz_table")
$message=buildHorzTable($fields, $intro, $to, $send_ip);
else
$message=buildTextTable($fields, $intro, $to, $send_ip);
return $message;
// referrer checking security option
function checkReferer()
if($check_referrer=="yes")
$ref_check=preg_split('/,/',$referring_domains);
$ref_run=sizeof($ref_check);
$referer=$_SERVER['HTTP_REFERER'];
$domain_chk="no";
for($i=0;$i<$ref_run;$i++)
$cur_domain=$ref_check[$i];
if(stristr($referer,$cur_domain)){$domain_chk="yes";}
else
$domain_chk="yes";
return $domain_chk;
// checking required fields and email fields
function checkFields($text_fields, $email_fields, $regex)
$error_message="";
if($debug==1)
$error_message.="<li>text_fields: ".$text_fields."<br />email_fields: ".$email_fields."<br />reply_to_field: ".$reply_to_field."<br />reply_to_name: ".reply_to_name."</li>";
if($text_fields != "")
$req_check=preg_split('/,/',$text_fields);
$req_run=sizeof($req_check);
for($i=0;$i<$req_run;$i++)
$cur_field_name=$req_check[$i];
$cur_field=$_POST[$cur_field_name];
if($cur_field=="")
$error_message.="<li>You are missing the <b>".$req_check[$i]."</b> field</li>\n";
if($email_fields != "")
$email_check=preg_split('/,/',$email_fields);
$email_run=sizeof($email_check);
for($i=0;$i<$email_run;$i++)
$cur_email_name=$email_check[$i];
$cur_email=$_POST[$cur_email_name];
if($cur_email=="" || !eregi($regex, $cur_email))
$error_message.="<li>You are missing the <b>".$email_check[$i]."</b> field or it is not a valid email address.</li>\n";
return $error_message;
// attachment function
function getAttachments($attachment_fields, $message, $content_type, $border)
$att_message="This is a multi-part message in MIME format.\r\n";
$att_message.="--{$border}\r\n";
$att_message.=$content_type."\r\n";
$att_message.="Content-Transfer-Encoding: 7bit\r\n\r\n";
$att_message.=$message."\r\n\r\n";
$att_check=preg_split('/,/',$attachment_fields);
$att_run=sizeof($att_check);
for($i=0;$i<$att_run;$i++)
$fileatt=$_FILES[$att_check[$i]]['tmp_name'];
$fileatt_name=$_FILES[$att_check[$i]]['name'];
$fileatt_type=$_FILES[$att_check[$i]]['type'];
if (is_uploaded_file($fileatt))
$file=fopen($fileatt,'rb');
$data=fread($file,filesize($fileatt));
fclose($file);
$data=chunk_split(base64_encode($data));
$att_message.="--{$border}\n";
$att_message.="Content-Type: {$fileatt_type}; name=\"{$fileatt_name}\"\r\n";
$att_message.="Content-Disposition: attachment; filename=\"{$fileatt_name}\"\r\n";
$att_message.="Content-Transfer-Encoding: base64\r\n\r\n".$data."\r\n\r\n";
$att_message.="--{$border}--\n";
return $att_message;
// function to set content type
function contentType($charset, $format)
if($format=="vert_table")
$content_type="Content-type: text/html; charset=".$charset."\r\n";
else if($format=="horz_table")
$content_type="Content-type: text/html; charset=".$charset."\r\n";
else
$content_type="Content-type: text/plain; charset=".$charset."\r\n";
return $content_type;
// end global functions //
// begin procedural scripting //
// anti-spam empty field check
if($_POST[$empty_field[$config]] != "")
$empty_message = "<li>This submission failed and was flagged as spam.</li>\n";
// anti-spam character scan check
if(strlen($character_scan[$config]) > 0)
$spam_message="";
$field_check=preg_split('/,/',$character_scan[$config]);
$field_run=sizeof($field_check);
for($i=0;$i<$field_run;$i++)
$cur_field_name=$field_check[$i];
$cur_field=$_POST[$cur_field_name];
if(preg_match("/<(.|\n)+?>/", $cur_field) || preg_match("/\[(.|\n)+?\]/", $cur_field))
$spam_message.="<li>This message contains disallowed characters.</li>\n";
// anti-spam time delay check
if((strlen($time_delay[$config]) > 0 && strlen($_POST["time"]) > 0) || (strlen($time_delay[$config]) > 0 && (strlen($_POST["time"]) == 0 || !$_POST["time"])))
if((time() - $_POST["time"]) < $time_delay[$config])
$time_message = "<li>This has been stopped by the timer, and is likely spam.</li>\n";
// anti-spam CAPTCHA check
if(strlen($captcha_codes[$config]) > 0)
$captcha_check=preg_split('/,/',$captcha_codes[$config]);
if(strtolower($_POST["captcha_entry"]) != strtolower($captcha_check[$_POST["captcha_code"]]))
$captcha_message = "<li>CAPTCHA test did not match.</li>\n";
// anti-spam max URL check
if(strlen($max_url_fields[$config]) > 0)
$max_url_message="";
$field_check=preg_split('/,/',$max_url_fields[$config]);
$field_run=sizeof($field_check);
for($i=0;$i<$field_run;$i++)
$cur_field_name=$field_check[$i];
$cur_field=$_POST[$cur_field_name];
preg_match_all("/http:/", $cur_field, $matches);
if(count($matches[0]) > $max_urls[$config])
$max_url_message.="<li>This message contains too many URL's.</li>\n";
// set anti-spam flagging option
if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) == 0)
$set_flag = 2;
else if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) > 0)
$set_flag = 1;
else
$set_flag = 0;
// header injection check
$security_filter="";
if(strlen($_POST[$reply_to_field[$config]]) > 0)
if(eregi($header_injection_regex,$_POST[$reply_to_field[$config]]))
$security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
else
$reply_to_field_checked=$_POST[$reply_to_field[$config]];
if(strlen($_POST[$reply_to_name[$config]]) > 0)
if(eregi($header_injection_regex,$_POST[$reply_to_name[$config]]))
$security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
else
$reply_to_name_checked=$_POST[$reply_to_name[$config]];
// check domain referrer and continue
$domain_chk=checkReferer();
if($domain_chk=="yes")
$error_message=checkFields($required_fields[$config], $required_email_fields[$config], $regex);
if(strlen($error_message) < 1 && strlen($security_filter) < 1 && $set_flag < 2)
// build appropriate message format for recipient
$content_type=contentType($charset[$config], $mail_type[$config]);
$message=buildTable($mail_type[$config], $mail_fields[$config], $mail_intro[$config], "recipient", $return_ip[$config]);
// build header data for recipient message
//$extra="From: ".$_POST[$reply_to_field[$config]]."\r\n";
$extra="From: ".$reply_to_name_checked." <".$reply_to_field_checked.">\r\n";
if($cc_tomail[$config]!="")
$extra.="Cc: ".$cc_tomail[$config]."\r\n";
if($bcc_tomail[$config]!="")
$extra.="Bcc: ".$bcc_tomail[$config]."\r\n";
if($mail_priority[$config]!="")
$extra.="X-Priority: ".$mail_priority[$config]."\r\n";
// get attachments if necessary
if($attachment_fields[$config]!="")
$semi_rand=md5(time());
$border="==Multipart_Boundary_x{$semi_rand}x";
$extra.="MIME-Version: 1.0\r\n";
$extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
$message=getAttachments($attachment_fields[$config], $message, $content_type, $border);
else
$extra.="MIME-Version: 1.0\r\n".$content_type;
// send recipient email
if($debug==1)
if($set_flag == 1)
$debug_text.="<p><b>Mail would have sent flagged for spam if not in debug mode.</b></p>";
else
$debug_text.="<p><b>Mail would have sent if not in debug mode.</b></p>";
else if($debug==0)
if($set_flag == 1)
$subject = $flag_spam[$config]." ".$subject[$config];
else
$subject = $subject[$config];
mail("".$tomail[$config]."", "".stripslashes($subject)."", "".stripslashes($message)."", "".$extra."");
// autoresponse email if necessary
if($send_copy[$config]=="yes")
// build appropriate message format for autoresponse
$content_type=contentType($charset[$config], $copy_format[$config]);
$message=buildTable($copy_format[$config], $copy_fields[$config], $copy_intro[$config], "autoresponder", $return_ip[$config]);
// build header data for autoresponse
$copy_tomail=$_POST[$copy_tomail_field[$config]];
$copy_extra="From: ".$copy_from[$config]."\r\n";
// get autoresponse attachments if necessary
if($copy_attachment_fields[$config]!="")
$semi_rand=md5(time());
$border="==Multipart_Boundary_x{$semi_rand}x";
$copy_extra.="MIME-Version: 1.0\r\n";
$copy_extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
$message=getAttachments($copy_attachment_fields[$config], $message, $content_type, $border);
else
$copy_extra.="MIME-Version: 1.0\r\n".$content_type;
// send autoresponse email
if($debug==1)
if($set_flag == 1)
$debug_text.="<p><b>Autoresponder would have sent flagged for spam if not in debug mode.</b></p>";
else
$debug_text.="<p><b>Autoresponder would have sent if not in debug mode.</b></p>";
else if($debug==0)
$send_copy = 1;
if($copy_tomail=="" || !eregi($regex,$copy_tomail))
$send_copy = 0;
if($send_copy == 1)
if($set_flag == 1)
$copy_subject = $flag_spam[$config]." ".$copy_subject[$config];
else
$copy_subject = $copy_subject[$config];
mail("$copy_tomail", "".$copy_subject."", "$message", "$copy_extra");
// showing thanks pages from a successful submission
if($thanks_page[$config]=="")
echo "<h3>".$thanks_page_title[$config]."</h3>\n";
echo "<p>".$thanks_page_text[$config]."</p>\n";
if(strlen($debug_text) > 0)
echo "<p><b><i>".$debug_text."</i></b></p>\n";
else
header("Location: ".$thanks_page[$config]);
else
// entering error page options from missing required fields
if($error_page[$config]=="")
echo "<h3>".$error_page_title[$config]."</h3>\n";
echo "<ul>\n";
echo $security_filter.$empty_message.$error_message.$spam_message.$time_message.$captcha_messa ge.$max_url_message;
echo "</ul>\n";
echo "<p>".$error_page_text[$config]."</p>\n";
else
header("Location: ".$error_page[$config]);
else
echo "<h3>".$error_page_title[$config]."</h3>\n";
// message if unauthorized domain trigger from referer checking option
echo "<p>Sorry, mailing request came from an unauthorized domain.</p>\n";
// end procedural scripting //
else
echo "<h3>Error</h3>";
echo "<p>No form data has been sent to the script</p>\n";
if($footer[$config]!="")
include($footer[$config]);
ob_end_flush();
?>
<input type="button" value="Return to Form" onClick="javascript: history.go(-1);" />
HTML File:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sample Form</title>
<style type="text/css">
/**BEGIN FORM STYLES**/
#form1 {
font-size: 14px;
width: 500px;
margin: 0 auto; /**centered**/
background: #FFF;
border: 2px groove green;
padding: 7px 14px 7px 14px;
fieldset {
margin-bottom: 5px;
border-right: none;
border-bottom: none;
border-left: none;
legend {
padding: 8px;
border: 1px solid silver;
background: #009900;
font-weight: bold;
color: #FFFFFF;
margin-left: -75px;
*margin-left:0;
line-height: 1.5
/**wrap form lables and fields inside ordered lists for better web accessibility**/
#form1 ol {
list-style: none;
margin: 0;
padding: 0
#form1 li {
padding: 5px;
margin: 0;
clear: left;
label {
display: inline-block;
float: left;
line-height: 23px; /**lines up labels with fields**/
width: 167px;
font-size: 12px;
color: #666;
text-align: right;
margin-right: 10px; /*space between labels, fields*/
input[type=text], textarea {
width: 190px; /**same width on text fields**/
padding: 5px;
color: #666;
border: 1px dotted #009900;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
/**field background on focus**/
input:focus, input:active, textarea:focus, textarea:active {
background-color: #EBECDE;
border: 1px solid;
#submit {
margin-left: 45px;
background: #009900;
font-size: 18px;
color: #FFF;
font-weight: bold;
border: 2px outset #FFF
#submit:hover, #submit:focus, #submit:active {
background: #006600;
color: yellow;
border: 2px inset #FFF
/**END FORM STYLES**/
</style>
</head>
<body>
<!--BEGIN HTML FORM, action="path to form-processing script on your server" -->
<form id="form1" action="vsi2.php" method="post" enctype="multipart/form-data" name="form1">
<h3>HTML Contact Form</h3>
<fieldset>
<legend>Required Fields:</legend>
<!--spam prevention-->
<input name="config" type="hidden" value="0" />
<input type="text" name="nospam" style="display:none" />
<ol>
<li>
<label for="first_name">First Name:</label>
<input name="first_name" id="first_name" type="text" />
</li>
<li>
<label for="last_name">Last Name:</label>
<input name="last_name" id="last_name" type="text" />
</li>
<li>
<label for="email">E-mail:</label>
<input name="email" id="email" type="text" />
</li>
</ol>
</fieldset>
<fieldset>
<legend>Optional Fields:</legend>
<ol>
<li>
<label for="phone">Phone number:</label>
<input name="phone" id="phone" type="text" />
</li>
<li>
<label for="subject">Subject:</label>
<input name="subject" id="subject" type="text" />
</li>
<li>
<label for="message">Message:</label>
<textarea id="message" name="message"></textarea>
</li>
<li>
<label for="submit"> </label>
<input type="submit" name="submit" id="submit" value="Submit" />
</li>
</ol>
</fieldset>
</form>
<!--END OF FORM -->
</body>
</html>
Test File:
http://www.energymcg.com/Original/contactus.html
Thank you for your patience and for sticking with me. I really appreciate it.
Khalid -
Hello, I have a somewhat complicated Report and I am hoping that I can create the Parameter Form in Reports (I would rather not use Forms because I don't know it as well)
Here's my problem:
Right now I have 2 fields that I need help with.
The first one is called "Report Name" and I have it coded to a bind variable that will search for a series of "work units" such as 02% or 03%
This works as coded, the problem comes with the other "Work Unit" field. What I have right now is a LOV that queries for work units that start in either 02 or 03. This variable will narrow down the report findings to the specific work unit selected. What I want is for this list to be dependant on what the user choses for report name.
For example if the user choses ReportName1 the report query finds work units with 02%, but the "work unit" field still displays the list of work units 02% and 03% and the user must know to only chose the certain work units for the specific "Report Name" selected.
If there is a way to somehow have the "Work Unit" field be dependant on the "Report Name" field please give me soem ideas of how to do it.Thats what I was worried about.
Well I have been trying to learn forms for some time now but I can't quite get the hang of it yet.
I don't really have anyone who knows it here, so I'm kind of learning on my own.
Thanks for the response.
Arin -
Ok here is the problem,
I am trying to make a form in my existing fla document and
the form will not function.
I have created the form and used the exact same php script in
a seperate flash movie and the form worked fine but I can not get
it to work in my existing fla.
I would reall appreciate any help with this issue.....
I need my file
(download my file at
http://66.70.213.43/testsite/main3.fla
to have a working email submission form.
this file has no working form on it now and the existing form
can be modified but I would like to keep the submit and the reset
buttons as is if possable.
I would like to use the php email style that is in the lesson
on gotoandlearn.com ( the lesson is listed as sending mail with php
but I am willing to accept other methods if needed.
The Movie clip symbol of the actual form with the submit and
reset button is call P5_s7
The Movie clip symbol of the page which contains the form is
called PAGE 5
I will edit the php and the flash script after you send the
file to me to reflect the email addresses that I want to use so for
testing purposes you can use any email that you want.
I would really appreciate it if someone with more flash
experience could help me out and post a working copy of my file and
the php script that the form links to so that I could re download
then.
Thank you in advance
Please note that there may be some $$$ in it for you if you
can help me.......Don't think you're going to find anyone here who will just be
willing to do the work for you. You might want to check out the
Flash and PHP Integration sample file that comes with Flash 8 for
some pointers on how to get this started.
If you have specific questions later, write back! Good luck! -
Hello,
I am a developer (VB6 ASP),
Please, I need to know, What I need to populate/read an xfa-form, that was created for another company.
I do not know what is the tool that I need to investigate, or a component. (the pdf form it was created with liveCycle)
The original empty pdf form is in xfa-form and I need fill in and the resulted file is delivered to another person that stamp digital signature,
I can fill this pdf form manually with adobe reader 9, but i need this task programmatically.
has any idea for this?
Thank you in advance!
(sorry for my english)
ClarisaThank you Hodmi!
Another question, I new in adobe Technologies, and I am lost in the family of LiveCycle products,
I need pre-populate the pdf that I have attached, xfa-form1.pdf
for example,
1- I download this pdf from an external site,
2- I have to pre-populate with 2 Fields that I obtain from my Database,
3- I embed this pdf file in aspx page(ASP.NET)
4- the user 1 must put their signature.
4- the user 2 must put their signature.
End
I saw code that manipulate programmatically .xdp files with pdf forms, but I do not know if I can manipulate this pdf that I have attached, please, could you help me, If in theory I Can do that?
(I have to do with ASP.NET)
Best Regards!
Clarisa -
Urgent :post xml for xsql difference with html form post
Hi,
We are developing an application to process xml request
posted by external party. The requests arrive by
http-post operation
We developed and tested with an html-form.
Now we encounter problems in testing with http-post
The xsql page is processed correctly but
insert only fixed text when formatting xml-data as input for
the insert-request, string inserted is empty.
Everything is by the book and html-forms works great.
Is anybody else using xsql to insert xml data in the database on this version? Maybe can you help by looking into a testcase ? Issued a tar but am on terrible deadline
so need help very soon.
Details: HP-UX 11.11 Oracle 9.2.0.4 java1.4 ojdbc 1.4
Tnx in advance,
JeroenMark,
Have an external partner which sends xml-requests.
Have to read those, store them and process them.
Idea is let them
1)post the xml at a url where an xsql page is reading the xml
2) transforming this for an insert into
the database. The column is defined to store the complete xml-message.
3) A trigger takes care of processing the stuff and preparing the output
4) and a query in the xsql-page reads the output from an output table
When developing and testing this with an html-form that posts the xml is works great.
$ cat newclobins.xsql
<?xml version="1.0"?>
<page connection="demo" xmlns:xsql="urn:oracle-xsql" >
<xsql:set-session-param name="id">
select msgid.nextval from dual
</xsql:set-session-param>
<xsql:dml>
delete cbs_msg_in where id={@id}
</xsql:dml>
<xsql:insert-request table="cbs_msg_in" column="id,msg" transform="cbsform_1.xsl"/>
<data>
<xsql:query null-indicator="yes">
select msgid,msg from cbs_xml_out where msgid={@id}
</xsql:query>
</data>
</page>
$ cat cbsform_1.xsl
<?xml version="1.0"?>
<ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<xsl:for-each select="request">
<ROW>
<MSG><xsl:value-of select="parameters/doc" /></MSG>
<ID><xsl:value-of select="session/id" /></ID>
</ROW>
</xsl:for-each>
</ROWSET>
1) When using a tool like
http://www.programmersheaven.com/articles/adrian/getpost/article.html it fails with
No rows to modify -- the row enclosing tag missing. Specify the correct row enclosing tag.
2) When using the commandline utility like
xsql jeroen5.xsql posted-xml=test3.xml
this works great when inserting plain text but not
when inserting xml-format data into a column
So problem 1 is why external tools like above or my partner that uses .net to do something similar gives this strange error?
Problem nr 2 is should I stick to just the data in xml and forget about storing the xml-formatted data?
Hope you can help because I am getting quite desparate here.
Regards,
Jeroen
Maybe you are looking for
-
I downloaded Firefox 3.6 for Mac this morning and now when I try to Preview the html page in Firefox, the browser goes directly to the "landing page" I've set in my Firefox prefs instead of the Firefox page displaying my "local" file. Trashed the new
-
Adobe photoshop cs 4 wont reinstall
hi a couple months back i had to recover my computer and i lost all my programs now when i try to reinstall my photoshop cs 4 it gets stuck on checking system profile and will not finish
-
Transferring my library to a new computer - errors galore
I recently purchased a Retina iMac running OS 10.10.1. My previous computer is a Mac Pro (2006) with 10.7.5 (latest OS it will support). The Mac Pro has iTunes 12.0.1 with the database files on the system hard drive and the media files on a second
-
when we post using F-28, Cash Discount is automatically calculated by SAP. but user is able to override the system calculated discount. can SAP block the User Override option? how to achieve it, thanks
-
Completion indicator vs. liquidating a funds reservation
Hi all, Can someone clearly explain what the difference between liquidating a funds reservation versus marking the completion indicator or completing a funds reservation is? How does one liquidate a funds reservation? FMRE_SERLK or FMX6? fmz6? Finall