Need Help with PHP please!!!
I'm trying to create a contact us page and my web host needs it in php and I have no clue how to do it.
I am using Dreamweaver Cs3 I have flash but am new to it.
Thank You
LB
it will be a learning curve, but look into david's books, http://foundationphp.com/index.php. He goes through all your php contact form step by step, I am still using one that I did in dw 8 book.
Similar Messages
-
I have need help with something Please respond Quickly :)
I have need help with something Please respond Quickly ok so i have the linksys wrt54g Version 2.2 and i upgraded the firmware to V4.21.4 from this site http://homesupport.cisco.com/en-us/wireless/lbc/WRT54G and i clicked V2.2 for the router. So after i upgraded i lost internet ability i can't use the internet so i had to downgrade back to V4.21.1 but i want the things that newer update sloves. Please Help. Everything thing says DNS error? aka Modem.
$$Cgibbons$$Ya i tried that i tried restoring and redoing everything when i downgrade back to .1 it works fine though?
$$Cgibbons$$ -
Need help with PHP contact form
Hi guys,
I've made a PHP contact form for my site and need help with a couple of things:
The form action links an external PHP script (scripts/contact-form-script.php) but is there a way I can have it so the PHP script for the form is contained within the same PHP file as my contact form (contact.php)?
I tried just putting the form code at the top of contact.php but the browser automatically reads the anti-spam re-direct, so maybe that needs revising too?
The second thing is, how can I make the Name, Email and Message fields mandatory? So if a user tries to submit the form and hasn't filled in one of the required fields and clicks submit, contact.php reloads with a message at the top of the form saying something like 'Complete the required fields' and highlights the relevant field with a red border?
Here's the code for contact.php:
<form action="http://www.mydomain.com/scripts/contact-form-script.php" method="post" name="contact" id="contact">
<p><strong>Name:*</strong><br />
<input name="name" type="text" class="ctextField" /></p>
<p><strong>E-mail:*</strong><br />
<input name="email" type="text" class="ctextField" /></p>
<p><strong>Telephone:</strong><br />
<input name="telephone" type="text" class="ctextField" /></p>
<p><strong>Company:</strong><br />
<input name="company" type="text" class="ctextField" /></p>
<p><strong>Address:</strong><br />
<input name="address1" type="text" class="ctextField" /></p>
<p><input name="address2" type="text" class="ctextField" /></p>
<p><strong>Town:</strong><br />
<input name="town" type="text" class="ctextField" /></p>
<p><strong>County:</strong><br />
<input name="county" type="text" class="ctextField" /></p>
p><strong>Postcode:</strong><br />
<input name="postcode" type="text" class="ctextField" /></p>
<p><strong>Message:*</strong><br />
<textarea name="message" cols="55" rows="8" class="ctextField"></textarea></p>
<p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
And this is the PHP I'm using to submit the form data for contact-form-script.php:
<?php
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$to = "[email protected]";
$subject = "Contact from website";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$message= '
<table cellspacing="0" cellpadding="8" border="0" width="500">
<tr>
<td colspan="2"></td>
</tr>
<tr bgcolor="#eeeeee">
<td width="154" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
<td width="314" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$name.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>E-mail address:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$email.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Telephone number:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$telephone.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Company:</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$company.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Address</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address1.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$address2.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Town</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$town.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>County</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$county.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Postcode</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$postcode.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Message</strong></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$message.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
</table>
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mydomain.com/sent.php' ) ;
?>
Any help on this would be greatly appreciated.
Thank you and I hope to hear from you!
SMRevised code with form validation for Name Email and Message:
<?php
if (array_key_exists('submit', $_POST)) {
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$company = $_POST['company'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$town = $_POST['town'];
$county = $_POST['county'];
$postcode = $_POST['postcode'];
$formMessage = $_POST['message'];
if (empty($name)) {
$warning['name'] = "Please provide your name";
if (empty($email)) {
$warning['email'] = "Please provide your email";
if (empty($formMessage)) {
$warning['message'] = "Please provide your message";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$to = "[email protected]";
$subject = "Contact from website";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$message= "
<table cellspacing='0' cellpadding='8' border='0' width='500'>
<tr>
<td colspan='2'></td>
</tr>
<tr bgcolor='#eeeeee'>
<td width='154' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Name</strong></td>
<td width='314' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$name."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>E-mail address:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$email."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Telephone number:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$telephone."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Company:</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$company."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Address</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address1."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$address2."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Town</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$town."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>County</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$county."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Postcode</strong></td>
<td style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$postcode."</td>
</tr>
<tr bgcolor='#eeeeee'>
<td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'><strong>Message</strong></td>
</tr>
<tr bgcolor='#eeeeee'>
<td colspan='2' style='font-family:Verdana, Arial; font-size:11px; color:#333333;'>".$formMessage."</td>
</tr>
<tr><td colspan='2' style='padding: 0px;'><img src='images/whitespace.gif' alt='' width='100%' height='1' /></td></tr>
</table>
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
if (!isset($warning)) {
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mydomain.com/sent.php' ) ;
?>
<!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=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
p {
margin: 0;
padding: 10px 0 0 0;
.warning {
color:#C00;
</style>
</head>
<body>
<form action="" method="post" name="contact" id="contact">
<p><strong>Name:*</strong><br />
<input name="name" <?php if (isset($warning['name'])) { echo "style='border: 1px solid #C00'"; } ?> type="text" class="ctextField" />
<?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['name']."</p>"; }?>
</p>
<p><strong>E-mail:*</strong><br />
<input name="email" <?php if (isset($warning['email'])) { echo "style='border: 1px solid #C00'"; } ?>type="text" class="ctextField" />
<?php if (isset($warning['name'])) { echo "<p class='warning'>".$warning['email']."</p>"; }?>
</p>
<p><strong>Telephone:</strong><br />
<input name="telephone" type="text" class="ctextField" /></p>
<p><strong>Company:</strong><br />
<input name="company" type="text" class="ctextField" /></p>
<p><strong>Address:</strong><br />
<input name="address1" type="text" class="ctextField" /></p>
<p><input name="address2" type="text" class="ctextField" /></p>
<p><strong>Town:</strong><br />
<input name="town" type="text" class="ctextField" /></p>
<p><strong>County:</strong><br />
<input name="county" type="text" class="ctextField" /></p>
<p><strong>Postcode:</strong><br />
<input name="postcode" type="text" class="ctextField" /></p>
<p><strong>Message:*</strong><br />
<?php if (isset($warning['message'])) { echo "<p class='warning'>".$warning['message']."</p>"; }?>
<textarea name="message" <?php if (isset($warning['message'])) { echo "style='border: 1px solid #C00'"; } ?> cols="55" rows="8" class="ctextField"></textarea></p>
<p><input name="submit" value="SEND MESSAGE" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
</body>
</html> -
Need help with PHP mail script
I have created a log in system . In that when the user completes the registration process an auto reply(auto-reply@domain) will generate and sent this to users email id regarding about the user name and password (Lo gin Details). After formal approval from the admin the user will get a user activation mail with log in link.
But , my problem is these are work only for mail accounts from my domain only(test@domain). its not send any of above mentioned details to other mail services like gmail or yahoo etc.
i discussed this with some others, they said its the problem with your mail function configuration. but i didn't get any needful information as am a beginner in PHP scripting.
i have contacted this with my hosting service they said its the problem with php mail () function and use php mailer() instead mail().
please give me a solution for the same..
Here am ataching my code..
<?php
include 'dbc.php';
$err = array();
if($_POST['doRegister'] == 'Register')
foreach($_POST as $key => $value) {
$data[$key] = filter($value);
if(empty($data['full_name']) || strlen($data['full_name']) < 4)
$err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
//header("Location: register.php?msg=$err");
//exit();
// Validate User Name
if (!isUserID($data['user_name'])) {
$err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
//header("Location: register.php?msg=$err");
//exit();
// Validate Email
if(!isEmail($data['usr_email'])) {
$err[] = "ERROR - Invalid email address.";
//header("Location: register.php?msg=$err");
//exit();
// Check User Passwords
if (!checkPwd($data['pwd'],$data['pwd2'])) {
$err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
//header("Location: register.php?msg=$err");
//exit();
$user_ip = $_SERVER['REMOTE_ADDR'];
// stores sha1 of password
$sha1pass = PwdHash($data['pwd']);
// Automatically collects the hostname or domain like example.com)
$host = $_SERVER['HTTP_HOST'];
$host_upper = strtoupper($host);
$path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
// Generates activation code simple 4 digit number
$activ_code = rand(1000,9999);
$usr_email = $data['usr_email'];
$user_name = $data['user_name'];
$rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
list($total) = mysql_fetch_row($rs_duplicate);
if ($total > 0)
$err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
if(empty($err)) {
$sql_insert = "INSERT into `users`
(`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
VALUES
('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
,now(),'$user_ip','$activ_code','$data[country]','$user_name'
mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
$user_id = mysql_insert_id($link);
$md5_id = md5($user_id);
mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
// echo "<h3>Thank You</h3> We received your submission.";
if($user_registration) {
$a_link = "
*****ACTIVATION LINK*****\n
http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
} else {
$a_link =
"Your account is *PENDING APPROVAL* and will be soon activated the administrator.
$message =
"Hello \n
Thank you for registering with us. Here are your login details...\n
User ID: $user_name
Email: $usr_email \n
Passwd: $data[pwd] \n
$a_link
Thank You
Administrator
$host_upper
THIS IS AN AUTOMATED RESPONSE.
***DO NOT RESPOND TO THIS EMAIL****
mail($usr_email, "Login Details", $message,
"From: \"Member Registration\" <auto-reply@$host>\r\n" .
"X-Mailer: PHP/" . phpversion());
header("Location: thankyou.php");
exit();
?>I have created a log in system . In that when the user completes the registration process an auto reply(auto-reply@domain) will generate and sent this to users email id regarding about the user name and password (Lo gin Details). After formal approval from the admin the user will get a user activation mail with log in link.
But , my problem is these are work only for mail accounts from my domain only(test@domain). its not send any of above mentioned details to other mail services like gmail or yahoo etc.
i discussed this with some others, they said its the problem with your mail function configuration. but i didn't get any needful information as am a beginner in PHP scripting.
i have contacted this with my hosting service they said its the problem with php mail () function and use php mailer() instead mail().
please give me a solution for the same..
Here am ataching my code..
<?php
include 'dbc.php';
$err = array();
if($_POST['doRegister'] == 'Register')
foreach($_POST as $key => $value) {
$data[$key] = filter($value);
if(empty($data['full_name']) || strlen($data['full_name']) < 4)
$err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
//header("Location: register.php?msg=$err");
//exit();
// Validate User Name
if (!isUserID($data['user_name'])) {
$err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
//header("Location: register.php?msg=$err");
//exit();
// Validate Email
if(!isEmail($data['usr_email'])) {
$err[] = "ERROR - Invalid email address.";
//header("Location: register.php?msg=$err");
//exit();
// Check User Passwords
if (!checkPwd($data['pwd'],$data['pwd2'])) {
$err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
//header("Location: register.php?msg=$err");
//exit();
$user_ip = $_SERVER['REMOTE_ADDR'];
// stores sha1 of password
$sha1pass = PwdHash($data['pwd']);
// Automatically collects the hostname or domain like example.com)
$host = $_SERVER['HTTP_HOST'];
$host_upper = strtoupper($host);
$path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
// Generates activation code simple 4 digit number
$activ_code = rand(1000,9999);
$usr_email = $data['usr_email'];
$user_name = $data['user_name'];
$rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
list($total) = mysql_fetch_row($rs_duplicate);
if ($total > 0)
$err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
if(empty($err)) {
$sql_insert = "INSERT into `users`
(`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
VALUES
('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
,now(),'$user_ip','$activ_code','$data[country]','$user_name'
mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
$user_id = mysql_insert_id($link);
$md5_id = md5($user_id);
mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
// echo "<h3>Thank You</h3> We received your submission.";
if($user_registration) {
$a_link = "
*****ACTIVATION LINK*****\n
http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
} else {
$a_link =
"Your account is *PENDING APPROVAL* and will be soon activated the administrator.
$message =
"Hello \n
Thank you for registering with us. Here are your login details...\n
User ID: $user_name
Email: $usr_email \n
Passwd: $data[pwd] \n
$a_link
Thank You
Administrator
$host_upper
THIS IS AN AUTOMATED RESPONSE.
***DO NOT RESPOND TO THIS EMAIL****
mail($usr_email, "Login Details", $message,
"From: \"Member Registration\" <auto-reply@$host>\r\n" .
"X-Mailer: PHP/" . phpversion());
header("Location: thankyou.php");
exit();
?> -
Need help with Fancybox please
Hola
I need some help with Fancybox.
I bought this template and it came without facybox, so I thought
that this will be a great help to learn some about jQuerry, but I'm lost
Why is NOT working on my page?
I just cannot figure this out.
Can you please check my page?
http://tummytime.biz/pages/portfolio_fancy.html
I got Windows 8, Dreamweaver CC
Thanks a lot.There are a couple things that could be causing a couple browsers' collective heads to implode.
Remove the <! right before your </head> tag...
</script>
<!
</head>
<body>
You have two calls to the fancybox css file, you only need one.
Aside from that I'm not seeing any code problems jump out at me.
EDIT: Ah, didn't scroll far enough. You have more than one reference to the jquery library. Typically, only one is needed and two or more will cause them all to fail. Usually, you can use the "latest" link and cover all your bases.
If you aren't using those referenced scripts at the bottom of your page, delete them. -
If anyone here is good with Java, I need serious help with my homework, please give me your instant messenger screen name and we can chat, thanks alot!!
AngelaI don't understand how people get themselves into
these situations as school, if you don't want to learn
it don't sign up for the class.....You never got yourself into this situation.... I think everyone has on occassion.
My very first "serious" university program was to solve a second order, non-linear differential equation using the Runge-Kutta method. This is NOT the easy way to learn a computer language and I have to admit I did take "shortcuts" using more experienced people than me.
That was before the web though...
God am I really that old? -
HT3702 need help with purchase please!!!
My husband mistakenly hit the purchase button las night for an apple app and now it has been taken out of our account, but was deleted off the phone as soon has he realized that he hit the purchase button how do we get a refund please we need HELP!!!
All sales are final
You can try contacting itunes and asking for an exception -
javax.servlet.ServletException
at com.evermind.server.http.EvermindPageContext.handlePageThrowable(EvermindPageContext.java:595)
at com.evermind.server.http.EvermindPageContext.handlePageException(EvermindPageContext.java:537)
at jsp.addservice._jspService(addservice.jsp:515)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:847)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
at mil.usmc.m4l.servlets.M4LServlet.forward(M4LServlet.java:34)
at mil.usmc.m4l.servlets.EditService.doGet(EditService.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at mil.usmc.m4l.filters.M4LCMSFilter.doFilter(M4LCMSFilter.java:150)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
Edited by: user11237193 on Apr 27, 2010 10:58 AM
I am getting error and I ned help with it Thank you for your help.I'd enter the dell service tags in here to find out what OS the pc was designed for.
http://www.dell.com/support/contents/us/en/19/Category/Product-Support/Self-support-Knowledgebase/locate-service-tag?~ck=mn
For windows I'd ask over here.
http://answers.microsoft.com/en-us/windows
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
Need help with debugging PLEASE
Hi,
I'm new to Java and was given an assignment to debug a program. I am completely lost and really havent gone over most of the stuff that is in this program. I would greatly appreciate any help with this that I can get.
Here is my code:
import java.util.*;
import javax.swing.*;
public class IndexHitFrequency
private final int NUMBER_OF_SIMULATIONS = 1000;
private int indexHit[] = new int [10];
public IndexHitFrequency()
Random generator = new Random(); // for generating random number
int array[] = {6, 2, 4, 8, 5, 0, 1, 7, 3, 9 };
//convert to ArrayList and sort it
List list = new ArrayList(Arrays.asList(array));
for (int i = 0; i < NUMBER_OF_SIMULATIONS; i++)
//generate random number
int randomNumber = generator.nextInt(array.length);
// get index hit
int index = Collections.binarySearch(list, randomNumber) ;
// save index hit to array
if(index > -1)
indexHit[index]++;
}//end for
String output = "Index\tFrequency\t\n";
//append the frequency of index hit to output
for (int i = 0; i < indexHit.length; i++)
output += i + "\t" + indexHit[i] + "\t\n";
//display result
JTextArea outputArea = new JTextArea();
outputArea.setText(output);
JOptionPane.showMessageDialog(null, outputArea, "Search random number 1000 times" ,
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}// end constructor
public static void main (String [] args)
new IndexHitFrequency();
} // end class IndexHitFrequency
I get these errors after trying to compile:
"IndexHitFrequency.java": Error #: 300 : method asList(int[]) not found in class java.util.Arrays at line 17, column 40
"IndexHitFrequency.java": Error #: 300 : method binarySearch(java.util.List, int) not found in class java.util.Collections at line 24, column 34C:\Java\Tutorial\rem>javac IndexHitFrequency.java
IndexHitFrequency.java:15: asList(java.lang.Object[]) in java.util.Arrays cannot
be applied to (int[])
List list = new ArrayList(Arrays.asList(array));
^
IndexHitFrequency.java:22: cannot find symbol
symbol : method binarySearch(java.util.List,int)
location: class java.util.Collections
int index = Collections.binarySearch(list, randomNumber) ;
^
2 errors
C:\Java\Tutorial\rem>Copied source and compiled in DOS window ( XP's cmd.exe) and got these error messages...
I think these error are more clear than the ones you posted, so this should help you resolve the problem...
- MaxxDmg...
- ' He who never sleeps... ' -
Need help with PHP mail script [was: Can someone please help me?]
I'm trying to collect data from a form and email it. I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
Here is the HTML code:
<!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>Contact Us</title>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {
font-size: 14px;
color: #000000;
body {
background-color: #FFFFFF;
body,td,th {
color: #CC3300;
.style3 {font-size: 14px; font-weight: bold; }
.style6 {font-size: 18px}
.style7 {font-size: 16px}
.style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style10 {color: #000000}
-->
</style>
</head>
<body>
<div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
<map name="Map2" id="Map2">
<area shape="rect" coords="560,9,684,38" href="accessories.html" />
<area shape="rect" coords="456,8,548,38" href="contact.html" />
<area shape="rect" coords="305,8,435,40" href="photog.html" />
<area shape="rect" coords="187,9,283,39" href="services.html" />
<area shape="rect" coords="81,10,167,39" href="aboutus.html" />
<area shape="rect" coords="5,10,68,39" href="index.html" />
</map>
<map name="Map" id="Map">
<area shape="rect" coords="9,9,69,39" href="index.html" />
<area shape="rect" coords="83,11,165,39" href="aboutus.html" />
<area shape="rect" coords="182,9,285,38" href="services.html" />
<area shape="rect" coords="436,14,560,37" href="contact.html" />
<area shape="rect" coords="563,14,682,38" href="accessories.html" />
</map>
</div>
<p> </p>
<form id="TheForm" name="TheForm" action="form2mail.php" method="post">
<p align="center" class="style2">P<span class="style1">lease fill out form below for a "free no obligation quote" then click submit.</span></p>
<p align="center" class="style3">(*Required Information)</p>
<div align="center">
<pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
<span class="style8"><strong>
Business Name </strong></span><input name="bn" type="text" id="bn" />
<span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
<strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" /> </strong> </pre>
<label><span class="style9">*Re-enter to confirm</span>
<input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
<label></label>
</span>
<p><span class="style9">*Best time to call </span>
<select name="name1[]" multiple size="1" >
<option>8am-9am</option>
<option>9am-10am</option>
<option>10am-11am</option>
<option>11am-12pm</option>
<option>12pm-1pm</option>
<option>1pm-2pm</option>
<option>2pm-3pm</option>
<option>3pm-4pm</option>
<option>4pm-5pm</option>
<option>5pm-6pm</option>
<option>6pm-7pm</option>
<option>7pm-8pm</option>
</select>
<br />
<br />
<span class="style9">Type of Location</span>
<select name="name2[]" multiple size="1" >
<option>Residential</option>
<option>Commercial</option>
</select>
<br />
<br />
<span class="style1"><br />
<strong><br />
<span class="style6">*Type of Services Requested:</span></strong><br />
</span><strong><span class="style10">(check all that apply)</span><br />
</strong><br />
<span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
<input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
<br />
</span><strong><br />
<span class="style8">Mobile Auto Detailing</span>
<input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
<br />
<br />
</strong><span class="style9">Moving/Hauling</span>
<input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Pressure washing</span>
<input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window washing</span>
<input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window Tinting</span>
<input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Boat cleaning</span>
<input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">RV cleaning</span>
<input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Motorcycle cleaning</span>
<input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
<br />
<br />
<br />
<br />
<input name="SB" type="button" class="style9" value="Submit" onClick="sendOff();">
</p>
</div></label>
<script language="JavaScript1.2">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
var good;
function checkEmailAddress(field) {
// Note: The next expression must be all on one line...
// allow no spaces, linefeeds, or carriage returns!
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
if (goodEmail){
good = true
} else {
alert('Please enter a valid e-mail address.')
field.focus()
field.select()
good = false
function autoTab(startPoint,endPoint){
if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
endPoint.focus();
function checkNumber(phoneNumber){
var x=phoneNumber;
var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
if (phoneNumber.test(x))
testResult=true
else{
alert("Please enter a valid number.")
phoneNumber.focus();
phoneNumber.value="";
testResult=false
return (testResult)
function sendOff(){
namecheck = document.TheForm.name.value
if (namecheck.length <1) {
alert('Please enter your name.')
return
good = false
checkEmailAddress(document.TheForm.email)
if ((document.TheForm.email.value ==
document.TheForm.emx.value)&&(good)){
// This is where you put your action
// if name and email addresses are good.
// We show an alert box, here; but you can
// use a window.location= 'http://address'
// to call a subsequent html page,
// or a Perl script, etc.
window.location= 'form2mail.php';
if ((document.TheForm.email.value !=
document.TheForm.emx.value)&&(good)){
alert('Both e-mail address entries must match.')
</script>
</form>
<p> </p>
</body>
</html>
and here is the form2mail.php:
<?php
# You can use this script to submit your forms or to receive orders by email.
$MailToAddress = "[email protected]"; // your email address
$redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
$MailSubject = "[Customer Contact Info]"; // the subject of the email
$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
$serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
# copyright 2006 Web4Future.com =================== READ THIS ===================================================
# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
# To block an IP, simply add it to the blockip.txt text file.
# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
# This is needed because the script tries to block the IP that tried to hack it
# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes
Web4Future Easiest Form2Mail (GPL).
Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
http://www.Web4Future.com/
This script was written by George L. & Calin S. from Web4Future.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.2";
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
//function blockIP
function blockip($ip) {
$handle = @fopen("blockip.txt", 'a');
@fwrite($handle, $ip."\n");
@fclose($handle);
$w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
if ($serverCheck) {
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
} else { $w4fy = TRUE; }
if (($w4fy === TRUE) && ($w4fx === FALSE)) {
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end else
$w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name <$email>\r\n";
$mailHeader .= "Reply-To: $name <$email>\r\n";
$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
if ($sendHTML) {
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
if ($sendHTML) {
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
if ($sendHTML === FALSE) {
$mailHeader .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
else { header("Location: ".$redirectURL); }
} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
?>
Thanks in advance,
Glenn
[Subject line edited by moderator to indicate nature of request]Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
First of all, create a PHP page called mailtest.php containing the following script:
<?php
$to = '[email protected]'; // use your own email address
$subject = 'PHP mail test';
$message = 'This is a test of the mail() function.';
$sent = mail($to, $subject, $message);
if ($sent) {
echo 'Mail was sent';
} else {
echo 'Problem sending mail';
?>
Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
$sent = mail($to, $subject, $message, null, '[email protected]');
Obviously, replace "[email protected]" with your own email address.
If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
Change it to this:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
Again, use your own email address instead of "[email protected]".
Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
<form id="form1" name="form1" method="post" action="form2mail.php">
<p>
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
</p>
<p>
<label for="email">Email:</label>
<input type="text" name="email" id="email" />
</p>
<p>
<label>
<input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
Boat cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
RV cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
Motorcycle cleaning</label>
</p>
<p>
<input type="submit" name="send" id="send" value="Submit" />
</p>
</form>
If that works, you can start to make the form more complex and add back your JavaScript validation. -
Need help with php registration form! (Dreamweaver cs5)
Im creating an advanced php registration form in dreamweaver. I need the following code for:
ZIP / Postal code, date of birth.
or
if u can help me how to create the entire form with the following fields That will be nice! Im a Newbie:
First name, lastname, country, zip / postal code, date of birth, username, password, email, verified, and token.
This is the database i have in mysql:
User_id, INT, (10), UNSIGNED, NOT NULL, A_INCREMENT
Firstname, VARCHAR, (50), NOT NULL
Lastname, VARCHAR, (50), NOT NULL
Country, VARCHAR, (20), NOT NULL
Zip, INT, (12), NOT NULL
Birth_date, DATE, NOT NULL
Username, VARCHAR, (15), NOT NULL
Password, VARCHAR, (40), NOT NULL
Email, VARCHAR, (100), NOT NULL
Verified, ENUM, ('n','y'), NOT NULL
Token, VARCHAR, (40), NOT NULL
I need to know how to apply the insert recorset server behavior in dreamweaver cs5 so I can get it to run.
I have been trying diff ways and i just can't get it right.
Please help! Thanks!!!I'm not sure how much you know but first you have to connect your form to the database
$con = mysql_connect("hostname","admin_name","password");
Then you have to choose the database you want information be added to.
mysql_select_db("database name goes here", $con);
Then you have to write an sql function which will write it in the appropiate columns in your database
$sql="INSERT INTO what column e.g members (First name, Last name, age, etc)
VALUES (the names of the textfields on your form), actually double check that part
('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
$result = mysql_query($sql);
This is the first and most basic part just to give you an idea how it works.
Within these snippets you will have to write much more which will beef up the security aswell as check if everything has been entered correctly etc -
Need help with PHP form with checkboxes, radio buttons and file attachment
Hi guys,
I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
Here is the HTML of contact.php:
<form action="" method="post" name="contact" id="contact">
<p>Job Title:*<br />
<input name="position" type="text" /></p>
<p>Nationality:*<br />
<select name="nationality">
<option value="">-- select one --</option>
<option value="Afghan">Afghan</option>
<option value="Albanian">Albanian</option>
<option value="Algerian">Algerian</option>
<option value="Zambian">Zambian</option>
<option value="Zimbabwean">Zimbabwean</option>
</select>
</p>
<p>Which country are you currently living in?*<br />
<select name="country">
<option value="">-- select one --</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Africa">Africa</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
</select>
</p>
<label class="radio" for="checkRight">Yes/No question?</label><br />
<input class="radio" type="radio" name="right" value="Yes" /> Yes
<input class="radio" type="radio" name="right" value="No" /> No
<input class="radio" type="radio" name="right" value="N/A" /> Not applicable
<p>Yes/No question?<br />
<select name="continue">
<option value="">-- select one --</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</p>
<p>Select your resorts:<br />
Resort 1<input name="res1" type="checkbox" value="Resort 1" />
Resort 2<input name="res2" type="checkbox" value="Resort 2" />
Resort 3<input name="res3" type="checkbox" value="Resort 3" />
Resort 4<input name="res4" type="checkbox" value="Resort 4" />
Resort 5<input name="res5" type="checkbox" value="Resort 5" />
Resort 6<input name="res6" type="checkbox" value="Resort 6" />
</p>
<p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
<p>Date of arrival: <input name="arrive" id="datepick" /><br />
Date of departure: <input name="depart" id="datepick2" /></p>
<script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
<link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
<script type="text/javascript">
new datepickr('datepick');
new datepickr('datepick2', {
</script>
<p>Name:*<br />
<input name="name" type="text" /></p>
<p>E-mail:*<br />
<input name="email" type="text" /></p>
<p>Telephone:*<br />
<input name="telephone" type="text" class="ctextField" /></p>
<p>Upload CV (Word of PDF formats only):<br />
<input type="file" name="cv" class="textfield"></p>
<p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
By the way, the date boxes work so excuse the Javascript in there!
To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
Below is where I'm at with the PHP which is placed above the header of contact.php...
<?php
if (array_key_exists('submit', $_POST)) {
$position = $_POST['position'];
$arrive = $_POST['arrive'];
$nationality = $_POST['nationality'];
$parttime = $_POST['parttime'];
$depart = $_POST['depart'];
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$to = "[email protected]";
$subject = "Recruitment Application";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= 'From: My Website <[email protected]>' . "\r\n";
$message= "
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
if (!isset($warning)) {
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mywebsite.co.uk/sent.php' );
?>
I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
Can anyone help me get my form working?
Thank you and I hope to hear from you!
SMHi Nancy,
Great stuff, thank you for the reply.
I've managed to get the Formm@iler working and running as I need it to.
The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
How can I have it so the user is taken to the form results in the websites' page layout?
I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
Thank you for your help! -
New to itunes and need help with library please
some of my albums have various artists. i cant get them to show up as 1 album it shows as an album for every song. can anyone help me please?
another problem i am having is my album artwork does not show up when I insert a cd to rip. I am also having trouble with the itunes suddenly getting all garbled up so i cant even see the screen untill I close itunes and open it back up. grrrr!! i sold my Zune to get this ipod touch and am wondering if I have made a mistake.
thanks for any help you can give me
Carriaccording to you we are on the same page here. When you rip a regular cd into itunes, it does not have the album artwork engrained into the song file. This is just an example, Say you ripped a Metallica cd into itunes such as "Master of Puppets." The song on the album "Disposable Heroes" will not have the album artwork with it.
You need to get an apple account, just go to the itunes store and sign up. After you do that you can click on one of the songs from the album you ripped. Right click it, and go to the choice "get album artwork". itunes will automatically modify the artwork for all the songs on that album. That is it. I may have a post later on your other problems. Ask me if you don't fully understand what i said. -
I need help with hyperlink PLEASE!!!!!!!
I hope somebody can help me with this question. I create some
button in flash 8. My web page is divided in three frames( using
the frame tag), two rows and the second row has two colums. My
question is how can i make one of my buttons to open a new web page
but in a different frame. The button is in column number 1 of row 2
and when the user click this button i want that this new page open
in column number 2 of row 2. How can ia do that? please help
mevalla23 wrote:
> I hope somebody can help me with this question. I create
some button in flash
> 8. My web page is divided in three frames( using the
frame tag), two rows and
> the second row has two colums. My question is how can i
make one of my buttons
> to open a new web page but in a different frame. The
button is in column number
> 1 of row 2 and when the user click this button i want
that this new page open
> in column number 2 of row 2. How can ia do that? please
help me
Always best to google before posting, especially if you
urgent to meet deadline.
Forum archives:
http://groups.google.com/advanced_group_search?q=group:macromedia.flash.*&hl=en&lr=&ie=UTF -8
Search "flash in frames"
the very second result, so happen to be from me, exhaling
exactly how to set it up.
http://groups.google.com/group/macromedia.flash/browse_thread/thread/6b0047b0a65be8a0/9f8f c0765bf2297e?lnk=st&q=&rnum=2&hl=en#9f8fc0765bf2297e
Personally posted that couple of hundreds of times in past 8
years.
Please try to utilize the search before posting so we don't
need to hammer same
topic over and over and over and over and over .....again...
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Hi,
hopefully anyone can help me out here I am working on a site
that has part flash and html in it. I am using php to dynamically
pull in the flash files from an includes folder. In doing so I have
uploaded everything to our preview server where I tested the site.
It works in firefox but not in the ie browsers, I thought this had
to do with active control, so I downloaded the extension but
nothing happened, still it works in firefox and not ie either 6 or
7. t
click
here to view the site I am working on. If you have suggestions
please let me know. I have attached the code as well for one of the
flash animations.
ThanksLooking at the source of your page, I note that you missed a
couple lines in the AC_FL_RunActiveContent embed. These 2 lines go
in the head of the page.
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
Maybe you are looking for
-
Fail to open PDF file. Error for trying to paste in object.
So occasionaly, i will paste in a PDF into my InDesign document and this error will pop up, Fail to open PDF file. It's not like im opening the file im just trying to paste it in. I try other pdf files and the same error comes up. Usually this err
-
Webdynpro application deployment failed.
Our development team working on NWDS to develop some webdynpro application, but they are unable to deploy the application on one of portal. Error Logs Jul 29, 2011 8:46:28 AM Info: The SDM client uses an old SDM client API. Jul 29, 2011 8:46:28 AM
-
have a laptop with a smaller hard drive. Last night, I synced the iPod Touch with my laptop to upload the music. I didn't have room on the hard drive for as many albums that I wanted, so I deleted the ones from the iTunes that I had already uploaded.
-
Need Help. Since update the reader as changed program association
Since I don't trust updates I held out for months on XI but finally succumbed and after installation I noticed that many files that relate to another specific program now carry the Reader icon. Since the files are not pdf, they won't open. As a Win
-
I recently upgraded from PSE 6 to PSE 8 (I have Windows 7). I have been using it less than a month. The first problem started when I would get an error when using the Organizer to upload photos to Shutterfly. The error said the Organizer stopped w