Jump to content

Shizlles

Members
  • Posts

    15
  • Joined

  • Last visited

About Shizlles

  • Birthday 04/24/1989

Previous Fields

  • Languages
    Html, Css, Java and learning Php!

Contact Methods

  • AIM
    none
  • MSN
    Verbeek2@hotmail.com
  • Website URL
    http://www.av-fine-art.com
  • ICQ
    0
  • Yahoo
    none

Profile Information

  • Location
    Netherlands
  • Interests
    Webdesign, Music, Sports, Games, Movies, Travelling..

Shizlles's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Ah i found the solution <?php if($messageSent){ echo '<script type="text/javascript"> sNotify.addToQueue("Your message has been sent");</script>'; };?> This code works, double quotes save the day!
  2. Hey, I have a variable set up when a message is sent or a post is made on my website. Now i would like to spice it up and instead of just displaying a messagei found a script that creates a neat little popup on the right hand side. For this to work i tried someting like this: <?php if($messageSent){ echo '<script type='text/javascript'> sNotify.addToQueue("You message has been sent");</script>'; };?> But this doesnt seem to work. Any suggestions on what im doing wrong? Help would greatly be appreciated as im still quite new to this.Thanks
  3. Shizlles

    Preloader

    Hey, I've been busy trying to build a website with some flash objects.I've got a loader atm and im trying to get it work with the code below.Everytime i get the same error: "1084: Syntax Error: Expecting identifier before rightparen." on line 4 Im pretty new to actionscript, does anyone have any ideas? It's made around actionscript 3.0.Greetz Paul 1. function loadProgress(my_content:ProgressEvent):void { 2. 3. var percent:Number=Math.floor((my_content.bytesLoaded*100)/my_content.bytesTotal); 4. loadPercentText.text = percent+ "%"; 5. LightDotsMask.width = percent* 3; 5. } 6. function loadComplete(e:Event):void{ 7. gotoAndStop(2); 8. } 9. loaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress); 10.loaderInfo.addEventListener(Event.COMPLETE,loadComplete);Edit: lol, i used the wrong isntance name. It should have been lightdotmask in my case. Sorry for the useless post :s
  4. I see my mistake now; i think the problem is that it can't connect to the database because there nothing stating it should. The upper part only initiates when something is submitted. Its a result of $messageSent. Im gonna try and redo the script now.Edit; I got it working, i just had to mkae the connection variables global. Thanks for helping me in the right direction.Now im gonna work on putting em where i want :)I haven't been able to make the UNIX_TIMESTAMP( ) appear on my site either. It gets stored as a number in seconds counting since UNIX. How can i show this as a normal date format? <?php//Connection to Database\\ //Connection to mysql server with user$link = mysql_connect('localhost', 'xxxxxx', 'xxxxx');if (!$link) { die('Not connected : ' . mysql_error());} // Target which db$db_selected = mysql_select_db('xxxxxxx', $link);if (!$db_selected) { die ('Can\'t use xxxxxx : ' . mysql_error());}//Retrieve Messages\\$gb = "SELECT * FROM Guestbook";$result = mysql_query($gb,$link) or exit(mysql_error());while($row = mysql_fetch_array($result)){ echo $row['name']." Said:<blockquote>".$row['comment']."</blockquote><br /r>";} //Save Messages\\ $messageSent = false; if(isset($_POST['submit'])){ //Variables $name = $_POST ['name']; $comments = $_POST ['comments']; //Values to be inserted into db $sql = "INSERT INTO `avfin425_guestbook`.`Guestbook` (`id` ,`name` ,`post_date` ,`comment`)VALUES (NULL , '".mysql_real_escape_string($name)."', UNIX_TIMESTAMP( ), '".mysql_real_escape_string($comments)."');";mysql_query($sql, $link);$messageSent = true; //if that all goes through};?>
  5. I tried both solutions offered but im still getting the same error :s
  6. I've tried both solutions suggestions but it still comes up with the same error. Then i thought maybe i should put $gb after $link in the query. This dind't dp the trick either. I then tried looking up the error codes but i could not find a solution. I only have one error code left now instead of two though. Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/xxxx/public_html/Guestbook.php on line 43//Show Messages.. $gb = "SELECT * FROM `Guestbook`LIMIT 0 , 30";$result = mysql_query($link,$gb) or exit(mysql_error());while($row = mysql_fetch_array($result)){ echo $row['name']." Said:<blockquote>".$row['comments']."</blockquote><br /r>";}
  7. Ok so im building this site where i want to put a guestbook. I've been trying some time now to get this script working.It already sends dat and saves it in the database. Now i'd like show all the data on my page. I've tried setting up some code to retrieve the data and i get the following error codes;Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/******/public_html/Guestbook.php on line 43Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/*****/public_html/Guestbook.php on line 44help appreciated <?php $messageSent = false; if(isset($_POST['submit'])){//Variables $name = $_POST ['name']; $comments = $_POST ['comments'];//Connection to mysql server with user$link = mysql_connect('localhost', '*****', '*****');if (!$link) { die('Not connected : ' . mysql_error());}// Target which db$db_selected = mysql_select_db('****', $link);if (!$db_selected) { die ('Can\'t use ******* : ' . mysql_error());}//Values to be inserted into db $sql = "INSERT INTO `******`.`****` (`id` ,`name` ,`post_date` ,`comment`)VALUES (NULL , '".mysql_real_escape_string($name)."', UNIX_TIMESTAMP( ), '".mysql_real_escape_string($comments)."');";mysql_query($sql, $link);$messageSent = true; //if that all goes through};//Show Messages.. $gb = "SELECT * FROM `Guestbook`LIMIT 0 , 30";$result = mysql_query ($gb, $link);while($row = mysql_fetch_array($result)){ echo $row['name']." Said:<blockquote>".$row['comments']."</blockquote><br /r>";}?><html><head></head><body><div id="shadow"><div id="wrapper"><div id="Banner"><div id="Logo"></div><div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.php">Contact</a><p></div></div><div id="spacer1"></div><div id="main"><div id="leftmain"><h4>Sign My Guestbook!</h4><p> Leave a message right here on the site and tell us what u think. Note that all fields are required.</p><form action="Guestbook.php" method="post" id="contactform"><table width="100%" border="0"><tr><td width="17%"><div align="right"><label for="name">Name:</label></div></td><td width="83%"><div align="left"><input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/></div></td><tr><td><div align="right"><label for="comments">Comments:</label></div></td><td><div align="left"><textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000; font-family: Arial; font-size: 13px;"></textarea></div></td></tr><tr><td><div align="right"></div><label for="clear"></label></td><td><div align="left"><label for="submit"></label><input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/><input name="submit" type="submit" id="submit" STYLE="font: arial;font-weight: bold; font-size: 10px;" onClick="MM_validateForm('name','','R','comments','','R');return document.MM_returnValue" value="Submit"/></div></td></tr><?php if($messageSent){ echo '<tr><td> </td> <td><p2>Your message has been saved!</p2></td> </tr>'; };?></table></form></div><div id="rightmain"><p></p></div></div><div id="spacer2"></div></div></div></div></body></html>
  8. Ok i got it nowAnd yeah the lengthy codebox is annoying, i'll use the code format the next time sorry.
  9. Ok so it worked berfore, but now it sends two messages again, these ones are double entries instead of one being blank. I've also tried merging a similar script to send emails which is also on the same site and had the same issue as the guestbook and it worked fine. <?php $messageSent = false; if(isset($_POST['submit'])){//Variables $name = $_POST ['name']; $comments = $_POST ['comments'];//Connection to mysql server with user$link = mysql_connect('localhost', 'xxxxxx', 'xxxxx');if (!$link) { die('Not connected : ' . mysql_error());}// Target which db$db_selected = mysql_select_db('xxxxxxx', $link);if (!$db_selected) { die ('Can\'t use xxxxx : ' . mysql_error());}//Values to be inserted into db $sql = "INSERT INTO `xxxxxxx`.`xxxxx` (`id` ,`name` ,`post_date` ,`comment`)VALUES (NULL , '".mysql_real_escape_string($name)."', UNIX_TIMESTAMP( ), '".mysql_real_escape_string($comments)."');";mysql_query($sql, $link); if(mysql_query($sql, $link)) $messageSent = true; //if that all goes through };;?><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Alexandra Verbeek Fine Art</title><link href="assets/layout/layout.css" rel="stylesheet" type="text/css" /><style type="text/css">#shadow #wrapper #main #leftmain {height: 600px;}#wrapper #main p2 {font-size: 13px;color: #A6A6A6;font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;}</style><link href="assets/layout/contact.css" rel="stylesheet" type="text/css" /><script type="text/javascript">function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');} }</script></head><body><div id="shadow"><div id="wrapper"><div id="Banner"><div id="Logo"></div><div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.php">Contact</a><p></div></div><div id="spacer1"></div><div id="main"><div id="leftmain"><h4>Sign My Guestbook!</h4><p> Leave a message right here on the site and tell us what u think. Note that all fields are required.</p><form action="Guestbook.php" method="post" id="contactform"><table width="100%" border="0"><tr><td width="17%"><div align="right"><label for="name">Name:</label></div></td><td width="83%"><div align="left"><input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/></div></td><tr><td><div align="right"><label for="comments">Comments:</label></div></td><td><div align="left"><textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000 ; font-family: Arial; font-size: 13px;"></textarea></div></td></tr><tr><td><div align="right"></div><label for="clear"></label></td><td><div align="left"><label for="submit"></label><input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/><input name="submit" type="submit" id="submit" STYLE="font: arial;font-weight: bold; font-size: 10px;" onClick="MM_validateForm('name','','R','comments','','R');return document.MM_returnValue" value="Submit"/></div></td></tr><?php if($messageSent){ echo '<tr><td> </td> <td><p2>Your message has been saved!</p2></td> </tr>'; };?></table></form></div><div id="rightmain"><p></p></div></div><div id="spacer2"></div></div></div></div></body></html>
  10. Ok, so if i undertsand correctly the message was only showing up as it was part of the php code and was actually undefined, showing it every time a message is submitted. changing the piece of code toif(mysql_query($sql, $link)){ $messageSent = true;};shows the message in the same manner but ONLY shows it on succes registering the message in the database?Edit: I understand it now, the variables for sending the msg is used to confirm the show of the confirm message.It's these insights that are still ahrd to grasp, i learned a lot today.
  11. Im working on what u suggested right now, ill post the code when im done.Edit: tried it out and worked like a charm, the page does't add empty values anymore to the db on load and the message only shows up when the submit button is clicked. My code now looks like this; It's also online here www.av-fine-art.com/Guestbook.phpNow i have to add a functionalty to retrieve the data from the db an show it on the same page. I bet u know this already but u rock thanks! <?php $messageSent = false; if(isset($_POST['submit'])){//Variables $name = $_POST ['name']; $comments = $_POST ['comments'];//Connection to mysql server with user$link = mysql_connect('localhost', 'xxxxx', 'xxxx');if (!$link) { die('Not connected : ' . mysql_error());}// Target which db$db_selected = mysql_select_db('xxxxx', $link);if (!$db_selected) { die ('Can\'t use xxxxxx : ' . mysql_error());}//Values to be inserted into db $sql = "INSERT INTO `xxxx`.`xxxxx` (`id` ,`name` ,`post_date` ,`comment`)VALUES (NULL , '".mysql_real_escape_string($name)."', UNIX_TIMESTAMP( ), '".mysql_real_escape_string($comments)."');";mysql_query($sql, $link); if(db_query_success == true) $messageSent = true; //if that all goes through };;?><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Alexandra Verbeek Fine Art</title><link href="assets/layout/layout.css" rel="stylesheet" type="text/css" /><style type="text/css">#shadow #wrapper #main #leftmain {height: 600px;}#wrapper #main p2 {font-size: 13px;color: #A6A6A6;font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;}</style><link href="assets/layout/contact.css" rel="stylesheet" type="text/css" /><script type="text/javascript">function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');} }</script></head><body><div id="shadow"><div id="wrapper"><div id="Banner"><div id="Logo"></div><div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.html">Contact</a><p></div></div><div id="spacer1"></div><div id="main"><div id="leftmain"><h4>Sign My Guestbook!</h4><p> Leave a message right here on the site and tell us what u think. Note that all fields are required.</p><form action="Guestbook.php" method="post" id="contactform"><table width="100%" border="0"><tr><td width="17%"><div align="right"><label for="name">Name:</label></div></td><td width="83%"><div align="left"><input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/></div></td><tr><td><div align="right"><label for="comments">Comments:</label></div></td><td><div align="left"><textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000 ; font-family: Arial; font-size: 13px;"></textarea></div></td></tr><tr><td><div align="right"></div><label for="clear"></label></td><td><div align="left"><label for="submit"></label><input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/><input name="submit" type="submit" id="submit" STYLE="font: arial;font-weight: bold; font-size: 10px;" onClick="MM_validateForm('name','','R','comments','','R');return document.MM_returnValue" value="Submit"/></div></td></tr><?php if($messageSent){ echo '<tr><td> </td> <td><p2>Your message has been saved!</p2></td> </tr>'; };?></table></form></div><div id="rightmain"><p></p></div></div><div id="spacer2"></div><div id="footer"><a href="Contactemail.html">Website design: ©Paul Verbeek, 2011 Artwork: © Alexandra Verbeek, 2011 All Rights Reserved.</a></div></div></div></div></body></html>
  12. So this means that i have to do something like this, basiclly putting all the php inside the form action?file saved as: Guestbook.php<html><head><body><form action="php code goes here, processsing and stuff" method="post" id="contactform">//more html</html> Edit: The email variable was for another page which sends an email to my mailbox. I used the same form on it. I cleaned up all the remains of the email textfield in the form and the validation script (standard dreamweaver validation)Im also trying to expand it on a per function basis. Trying to get the form to submit correctly first before i try and retrieve data from the database. The database is for test purposes atm.I just dont understand how to get the submit value working correctly so that it only sends data when clicking submit and not on the page load. The thing thats most confusing to me is that when it loads it sends empty data to the db but without showing the message.
  13. Ok it wasnt as easy as i presumed ha So for reason im getting an entry on each load of the page. I really have no clue at this moment, i really just started php .. the text is also appearing before the message has been sent to indicate this on the page. My guess was that it was executed it thus direclty. I'm trying to build this script as a guestbook and as it worked in post 1 only sent messages tothe database. Can i actually integrate the php for the function of retrieviong and displaying messages on the page in the same script?here is my code anyways Edit: I now understand what u meant with submitting it to itsself, I added the following line to form action; <?php echo $PHP_SELF;?>Is this the correct way? The script still initiates itsself on load of the page :s. <?php//Variables $name = $_POST ['name']; $email = $_POST ['email']; $comments = $_POST ['comments'];//Connection to mysql server with user$link = mysql_connect('localhost', 'xxxxxxxxxx', 'xxxxxx');if (!$link) { die('Not connected : ' . mysql_error());}// Target which db$db_selected = mysql_select_db('xxxxxxx', $link);if (!$db_selected) { die ('Can\'t use xxxxxxxxxx : ' . mysql_error());}//Values to be inserted into db $sql = "INSERT INTO `xxxxxxx`.`Guestbook` (`id` ,`name` ,`post_date` ,`comment`)VALUES (NULL , '".mysql_real_escape_string($name)."', UNIX_TIMESTAMP( ), '".mysql_real_escape_string($comments)."');";mysql_query($sql, $link);?><php? $messageSent = false; if(isset($_POST['submit'])){ //do all form precessing code, validation, email sending, etc $messageSent = true; //if that all goes through };?><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>xxxxxxxxxxx</title><link href="assets/layout/layout.css" rel="stylesheet" type="text/css" /><style type="text/css">#shadow #wrapper #main #leftmain {height: 600px;}#wrapper #main p2 {font-size: 13px;color: #A6A6A6;font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;}</style><link href="assets/layout/contact.css" rel="stylesheet" type="text/css" /><script type="text/javascript">function MM_validateForm() { //v4.0if (document.getElementById){var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);if (val) { nm=val.name; if ((val=val.value)!="") {if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';} else if (test!='R') { num = parseFloat(val);if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';if (test.indexOf('inRange') != -1) { p=test.indexOf(':');min=test.substring(8,p); max=test.substring(p+1);if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }} if (errors) alert('The following error(s) occurred:\n'+errors);document.MM_returnValue = (errors == '');} }</script></head><body><div id="shadow"><div id="wrapper"><div id="Banner"><div id="Logo"></div><div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.html">Contact</a><p></div></div><div id="spacer1"></div><div id="main"><div id="leftmain"><h4>Sign My Guestbook!</h4><p> Leave a message right here on the site and tell us what u think. Note that all fields are required.</p><form action="Guestbook.php" method="post" id="contacform"><table width="100%" border="0"><tr><td width="17%"><div align="right"><label for="name">Name:</label></div></td><td width="83%"><div align="left"><input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/></div></td><tr><td><div align="right"><label for="comments">Comments:</label></div></td><td><div align="left"><textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000 ; font-family: Arial; font-size: 13px;"></textarea></div></td></tr><tr><td><div align="right"></div><label for="clear"></label></td><td><div align="left"><label for="submit"></label><input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/><input name="submit" type="submit" id="submit" STYLE="font: arial;font-weight: bold; font-size: 10px;" onclick="MM_validateForm('name','','R','email','','RisEmail','comments','','R');return document.MM_returnValue" value="Submit"/></div></td></tr><?php if($messageSent){ echo '<tr><td> </td> <td><p2>Your message has been saved!</p2></td> </tr>'; };?></table></form></div><div id="rightmain"><p></p></div></div><div id="spacer2"></div></div></div></div></body></html>
  14. Im gonna try out the format suggested.Thanks very much
  15. Shizlles

    Send email script

    Hey, i've just recently started making websites and i really like it. I made a php script to send mails on my contact page (see code below), the contact page is in html referring to a php file on submit.The php sends the mail and it shows the same page with just one change (the msg has been sent!).The question is if i can combine the php file and the html file into one.I'd like it to go back to itself after information has been submitted and adds a line like: "the msg has been sent!" to the page. Any help is very appreciated!Greetz PaulThe php; contactemail.php <?php $emailSubject = 'mailbox site'; $emailadress = 'xxxxxxxxxxxxxx'; $name = $_POST ['name']; $email = $_POST ['email']; $comments = $_POST ['comments']; $body = <<<EOD<br><hr><br>Email:$email<br>Name:$name<br>Comments:$comments<br><br><hr><br> $headers = "From: $email\r\n"; $headers .= "content-type: text/html\r\n"; $success = mail($emailadress, $emailSubject, $body, $headers); $theResults = <<<EOD<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xxxxxx</title><link href="assets/layout/layout.css" rel="stylesheet" type="text/css" /><style type="text/css">#shadow #wrapper #main #leftmain {height: 600px;}#wrapper #main p2 {font-size: 13px;color: #A6A6A6;font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;}</style><link href="assets/layout/contact.css" rel="stylesheet" type="text/css" /><script type="text/javascript">function MM_validateForm() { //v4.0if (document.getElementById){var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);if (val) { nm=val.name; if ((val=val.value)!="") {if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';} else if (test!='R') { num = parseFloat(val);if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';if (test.indexOf('inRange') != -1) { p=test.indexOf(':');min=test.substring(8,p); max=test.substring(p+1);if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }} if (errors) alert('The following error(s) occurred:\n'+errors);document.MM_returnValue = (errors == '');} }</script></head><body><div id="shadow"><div id="wrapper"><div id="Banner"><div id="Logo"></div><div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.html">Contact</a><p></div></div><div id="spacer1"></div><div id="main"><div id="leftmain"><h4> Email me! </h4><p> For any information about the artist or artwork feel free to contact me though email or with the contact form below. Any feedback or comments are always welcome! Note that all fields are required.</p><form action="Contactemail.php" method="post" id="contacform"><table width="100%" border="0"><tr><td width="17%"><div align="right"><label for="name">Name:</label></div></td><td width="83%"><div align="left"><input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/></div></td></tr><tr><td><div align="right"><label for="email">Email:</label></div></td><td><div align="left"><input name="email" type="text" id="email" size="30" maxlength="90" STYLE="color: #000; font-family: Arial; font-size: 13px;"/></div></td></tr><tr><td><div align="right"><label for="comments">Comments:</label></div></td><td><div align="left"><textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000 ; font-family: Arial; font-size: 13px;"></textarea></div></td></tr><tr><td><div align="right"></div><label for="clear"></label></td><td><div align="left"><label for="submit"></label><input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/><input name="submit" type="submit" id="submit" STYLE="font: arial; font-weight: bold; font-size: 10px;" onClick="MM_validateForm('name','','R','email','','RisEmail','comments','','R');return document.MM_returnValue" value="Submit"/></div></td></tr><tr><td> </td><td><p2>The message has been sent succesfully!</p2></td></tr></table></form></div><div id="rightmain"></div></div><div id="spacer2"></div></div></div></div></body></html>EOD;echo "$theResults";?> The html; contactemail.html <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xxxxxx</title><link href="assets/layout/layout.css" rel="stylesheet" type="text/css" /><style type="text/css"></style><link href="assets/layout/contact.css" rel="stylesheet" type="text/css" /><script type="text/javascript">function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');} }</script></head><body><div id="shadow"> <div id="wrapper"> <div id="Banner"> <div id="Logo"></div> <div id="Navigation"><a href="index.html">Home</a> <a href="Portfolio.html">Portfolio</a> <a href="Gallery.html">Gallery</a> <a href="Contactemail.html">Contact</a><p> </div> </div> <div id="spacer1"></div> <div id="main"> <div id="leftmain"> <h4>Email Me!</h4> <p> For any information about the artist or artwork feel free to contact me though email or with the contact form below. Any feedback or comments are always welcome! Note that all fields are required.</p> <form action="Contactemail.php" method="post" id="contacform"> <table width="100%" border="0"> <tr> <td width="17%"><div align="right"> <label for="name">Name:</label> </div></td> <td width="83%"><div align="left"> <input name="name" type="text" id="name" STYLE="color: #000; font-family: Arial; font-size: 13px;" size="30" maxlength="80"/> </div></td> </tr> <tr> <td><div align="right"> <label for="email">Email:</label> </div></td> <td><div align="left"> <input name="email" type="text" id="email" size="30" maxlength="90" STYLE="color: #000; font-family: Arial; font-size: 13px;"/> </div></td> </tr> <tr> <td><div align="right"> <label for="comments">Comments:</label> </div></td> <td><div align="left"> <textarea name="comments" cols="49" rows="8" id="comments" STYLE="color:#000 ; font-family: Arial; font-size: 13px;"></textarea> </div></td> </tr> <tr> <td><div align="right"></div> <label for="clear"></label></td> <td><div align="left"> <label for="submit"></label> <input type="reset" name="clear" id="clear" value="Reset" STYLE="font: arial; font-weight: bold; font-size: 10px;"/> <input name="submit" type="submit" id="submit" STYLE="font: arial; font-weight: bold; font-size: 10px;" onclick="MM_validateForm('name','','R','email','','RisEmail','comments','','R');return document.MM_returnValue" value="Submit"/> </div></td> </tr></table> </form> </div> <div id="rightmain"><p></p> </div> </div> <div id="spacer2"></div> </div></div></div></body></html>
×
×
  • Create New...