Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Elemental

  1. dsonesuk, Thank you for your colorful syntax and use of expression's, I surely appreciate a colorful vocabulary. Peace,
  2. justsomeguy, thanks for the info. Peace,
  3. Holo, A couple of quick questions ... First: The following is working ... HTML <input type="checkbox" name="bookme" value="Yes" id="book_me" class="checkBx" /> PHP php if(empty($_POST['bookme'])) { $bookme = ""; } When I select the box and submit the form I receive an email and see that the box has been selected; my question is, is this the correct way to code a checkbox to achieve the result I want? ==================================================== Second question ... I would like to format my <textarea> so that the "Message" I receive, via form submit, has a border? I can format the html page with css, but when the form is submitted there's no outline (border) around the "Message" to make it stand out. Can this be done on my end using js or php or am I subject to the email application my hosting company offers? Peace
  4. Ingolme, Thanks for your prompt reply, Unfortunately I'm not an easy learner; html and css were fairly simple for me to learn but learning code, PHP, JS and the like has been a HUGE challenge for me. I find that I learn, a little better, when I can take the code apart, kind of dissecting it if you will. But if you were to ask me to write one on my own I wouldn't know where to start; one of the reasons I didn't proceed further with Flash, and I love Flash, but the coding side of it was not sticking. Anyway, thank you my friend, I'll look into the sendMail, perhaps I haven't asked the GoDaddy people the correct question. Peace, UPDATE Turns out it was a setting on the server, MX setting, that was preventing the script from working, so that's been fixed and that, as they say, is that. Thank You
  5. Quick question ... I downloaded a contact form script from www.freecontactform.com, their free version; html, php and js. If the script works when I use easyPHP DevServer, should it not also work when I upload it to a live server? I'm not getting any errors but I'm not getting any emails either. Peace,
  6. justsomeguy, Thank you for your reply, Thanks for pointing out the "Hyphen" error, I totally missed that; now corrected. As for the code, I believe you're referencing the following: if ($_SERVER["REQUEST_METHOD"] == "POST"){ if (empty($_POST["name"])){ $nameError = "Name is required"; } else { $name = test_input($_POST["name"]); //check if name contains only letteres and whitespce if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameError = "Only letters and white-space allowed"; } } and they all look the same but for the "variable names", I took it straight from the W3Schools tutorial page on PHP I only changed a couple of things from the original code. If I'm wrong then please advise but are you referring to the if / else statement, should the if section read: if ($_SERVER["REQUEST_METHOD"] == "POST"){ if (empty($_POST[""])){ echo $nameError = "Name is required"; } else { ... so that the error message fires? But I'm guessing that the example on W3Schools, as is written, only works when the PHP is within the same document of the HTML. Peace,
  7. Ingolme, Thanks for your reply, unfortunately changing my contact.html to contact.php didn't work. When I submit the page no validation takes place and no redirect to contact.php, a blank page loads with the following URL http://joseantonio.biz/contact_form.php which is the php document I'm using to validate the form. ??????? The only thing that happened after changing the file to .php was that now a 0 appears under "enter text as seen above". Even though it does not appear when I edit the document (I use Notepad) nor does it appear when I view it locally nor does it appear when the document is HTML; still, there it is. The weird thing is that when I view the contact.php page source (Firefox) there is a 0 between two <span> tags that don't appear otherwise. A new dilemma to add to my quest. Peace,
  8. Hello, I recently had to migrate from one hosting package to another (Classic to cPanel) and in the process my Contact Form stopped functioning. Using the W3Schools PHP tutorials I created the following PHP file: <?php // define variables and or set to empty values $to = "jose@joseantonio.biz"; $subject = "Web Contact Form"; $name = ""; $email = ""; $message = ""; $value-check = ""; $header = "From: $email"; // define Error variables $nameError = ""; $emailError = ""; $messageError = ""; if ($_SERVER["REQUEST_METHOD"] == "POST"){ if (empty($_POST["name"])){ $nameError = "Name is required"; } else { $name = test_input($_POST["name"]); //check if name contains only letteres and whitespce if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameError = "Only letters and white-space allowed"; } } if (empty($_POST["email"])){ $emailError = "Email is required"; } else { $email = test_input($_POST["email"]); // check if e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailError = "Please check email format"; } } if (empty($_POST["message"])){ $messageError = "Message is required"; } else { $message = test_input($_POST["message"]); } if (empty($_POST["value-check"])){ $value-checkError = "Please Enter Value"; } else { $value-check = test_input($_POST["value-check"]); } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } // send email mail($to, $subject, $message, $header); header('Location: contact.html'); // End PHP Script ?> And here's the HTML form section: <!-- ** BEGIN form ** //--> <form method="post" action="contact_form.php" name="contactForm" id="contactForm"> <fieldset id="fieldSet-01"> <label for="name" id="name-label"> Name: <input type="text" name="name" id="name" value="" maxlength="60" title="type your name" autocomplete="off" /><span class="error"><?php echo $nameError;?></span></label> <label for="email" id="email-label"> Email: <input type="text" name="email" id="email" value="" maxlength="60" title="type your email" autocomplete="off" /><span class="error"><?php echo $emailError;?></span></label> <label for="message" id="message-label"> Message: </label> <textarea onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name="message" id="message" cols="45" rows="6" wrap="hard" maxlength="250" title="type your message"></textarea><span class="error"><?php echo $messageError;?></span> </fieldset> <fieldset id="fieldSet-02"> <label for="word-count" id="word-count"><input size="2" value="250" readonly name="text_num" /><span id="countTxt"> = Characters Left</span></label> <p id="checkImg"><img src="images/checkImg.jpg" alt="" /><input id="value-check" name="value-check" autocomplete="off" size="5" maxlength="5" /><span>enter text as seen above</span><span class="error"><?php echo $value-checkError;?></span></p> <input name="submitBtn" id="submitBtn" type="image" value="Submit" src="images/submitBtn_link.png" title="Submit Form" onmouseover="mouseOver()" onmouseout="mouseOut()" /> <label for="required" id="required">all fields are required</label> </fieldset> </form> <!-- **** END form **** //--> A couple of notes / questions I tried using the form action:"" method from the tutorial: <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" name="contactForm" id="contactForm"> but the last two characters of the form tag "> kept showing up in the browser window; any clues as to why? Other examples, else where, showed that you can place the PHP script on the server and have it called when you submit the form by placing the name of the PHP file in the action section of the form tag: <form method="post" action="contact_form.php" name="contactForm" id="contactForm"> Neither form approach Validates the form. The redirect: header('Location: contact.html') in the PHP file is not working either. Where am I off?; a hint would be helpful. Should I be using some kind of call within the html's head tag for the "contact_form.php" file? In case the URL to the online contact page helps: http://joseantonio.biz/contact.html Any help or advise would be appreciated. Peace,
  9. Okay, For those who may be following this thread and wondering; has this fool figured it out yet? I removed the btnsMC from the timeline and simply used the colorsBtn, and the other three as well. So, no tweening, a straight jump from small btns to large btns, and used the following code: on (release) { _root.colorsBtn.enabled = true; unloadMovie(mcHolder);} and it worked. (??????) So, I aks, why did the above code work but this one: on (release) { _root.btnsMC.colorsBtn.enabled = true; unloadMovie(mcHolder);} did not? The only difference is that I removed the btnsMC where all four btns, colorsBtn being one of them, were placed? Some how by removing the btnsMC from the equation it all fell into place. Of course I changed the code as well from "_root.btnsMC.colorsBtn.enabled = true;" to "_root.colorsBtn.enabled = true;" (minus the "") I checked the spelling of all four of the btns instances, I even checked and confirmed the path for the btns and they all returned the same path _root.btnsMC.(place name of btn here) So, again I ask; what gives? Any takers? I'm open for constructive criticism? ============================================================ ============================================================ UPDATE Okay, so ..... I mentioned tweening before. I had placed the btns into an MC, btnsMC, and then tweened that MC from a small MC to a large MC which would take up the whole stage. So, just for the hech of it, I removed the tweening. But, before I did that I added a Keyframe before and after the large frame, I then changed those two frames and the first and last frames of the tween to graphics instead of movieclips but left the center frame as a movieclip, same instance; btnsMC. And wouldn't you know it, yup, it worked. I guess flash didn't like that the tween was a movieclip and that I was targeting it as well ???? I don't know, all I know is that by making the changes I did, it worked. Done. Peace, Elemental
  10. I created a new file testONE.fla I copied the btnsMC onto layer two. created a new mcHolder mc and placed it above the btnsMC, layer one, just like in my original file. all the AS is the same as in my original FLA I tested the movie and then I published the movie and everything worked accordingly. SO WHY ISN'T MY original not working? Makes no sense, obviously something's wrong somewhere
  11. Hey Man, You rock, both are available to me in MX 6.0 and they worked like a charm; went with enabled, on (release){this.colorsBtn.enabled = false;loadMovie("movies/colorsMC.swf", _root.mcHolder);} That said, the reversal, having the colorsBtn re-enabled when I unLoadMovie (mcHolder) isn't working. I know it's a target issue but I can't figure it out. The colorsBtn, along with three other buittons, is nested on the _root of an MC; btnsMC. I did it this way so they'd all be on the same layer and I could just simply fade the btnsMC in and out. I then placed a button on the root of colorsMC.swf with the following AS on (release) { unloadMovie(mcHolder);} This works fine but, of course, the button "colorsBtn" retains the enabled = false so I added the following to the on (release) code: _root.btnsMC.colorsBtn.enabled = true; but that didn't work. I've tried various different combinations but nothing's working for me. If colorsMC.swf takes on the properties of mcHolder shouldn't that work? Please, a suggestion, a shove in the right direction ... Peace, Elemental
  12. I know Flash MX 6.0 is older than dirt but its what I use, im not a developer, im an artis/actor so please help if you can. I have a button on one layer that when clicked will load an swf into an empty MC on the layer above it, everything works fine except that the button remains active under the MC. How can I disable the button so that it doesn't trigger any of its events? Peace, Elemental
  13. Got it, My error was the way I was targetting the compText movie clip. Instead of: _root.compInfo.compText._y = 30.1; I should have been using: _parent.compText._y = 30.1; where _parent is the main timeline of the movie clip compInfo, the mc where compText resides (is nestted) If you're reading this and find that I'm wrong, please correct me. Peace, Elemental
  14. I'll skip the intro and get right to the point. I have the following code on Buttons top Button / text to scroll up on (press, keyPress "<Down>") { compText.onEnterFrame = function() { if (this._y<30.1) { this._y += 25; } };}on (release, releaseOutside, rollOut) { compText.onEnterFrame = "0";} bottom Button / text to scroll down on (press, keyPress "<Up>") { compText.onEnterFrame = function() { if (this._y>-365) { this._y -= 25; } };}on (release, releaseOutside, rollOut) { compText.onEnterFrame = "0";} these work fine scrolling the text field within the compText mc, no problem. the problem is resetting the compText mc to it's original _y point with a single button click within the mc I have another button (the single button click) that would take visitors to my contact page, and reset the _y position to its oroginal state 30.1 I've tried using a modified version of the bottom Button's code: on (release) { if (_root.compInfo.compText._y != 30.1) { _root.compInfo.compText._y = 30.1;} _root.gotoAndPlay("contact");} but this is not working; the gotoAndPlay works fine but the compText mc does not reset to _y = 30.1 or anything else for that matter obviously I'm doing something wrong, Any help would be appreciated Peace, NOTE: I'm still in the stone ages, using Flash MX 6.0 - hope it doesn't create a problem.
  15. Hello Folks, Okay, so after working on the wife's site and realizing I'm better suited for what I love to do... Don't get me wrong you guys rock and I'll probably work on really simple stuff (simple to me) or help out here and there when I'm not on stage or shooting... So, in her words... What platform would you guys recommend for a non-technical person to be able to create and update, on her own, a business website; platform should include but not be limited to: email marketing, ecommerce, blogging, video conferencing, pod casting, etc. I would appreciate any suggestions you may have. Peace,Elemental
  16. thescientist, ShadowMage, Thank you again, your tag-team approach was much appreciated. ShadowMage - thanks for the explanation; I actually understood what you wrote... scary, right? FYI,display:none; did not work for me (IE or FF), it kept the modal and event information dialog box hidden, and I cleared the cookie twice; however, visibility:hidden; worked like a charm. Unless a reply is required I'm good to go, thanks again; however, here's my CSS just in case... #modal{position:fixed;visibility:hidden; // this is the only change due to your commentz-index:900;width:100%;height:100%;top:0;left:0;padding-top:10px;background:url(images/background-gradient.png);} #modal-header{width:700px;height:30px;margin:0 auto -12px auto;padding:0;background:#ffffff url(images/gradient-bar.png) left center no-repeat;border-top:2px solid #FF9900;border-right:2px solid #FF9900;border-bottom:1px solid #ff9900;border-left:2px solid #FF9900;} #clsBtn{position:relative;float:right;top:4px;right:12px;margin:0 auto;width:20px;height:20px;} #modal-header span a{background:url(images/x-Black.png) center no-repeat;border:1px solid #000000;} #modal-header span a:hover{background:url(images/x-Red.png) center no-repeat;border:1px solid #cd0a0a;} #eventInfo{position:relative;width:700px;height:auto;margin:0 auto;padding:0;font-family:'times new roman','century schoolbook','courier new',georgia;background:#ffffff;border-top:0;border-right:2px solid #FF9900;border-bottom:2px solid #FF9900;border-left:2px solid #FF9900;} #eventInfo p{text-align:center;} #eventInfo-title{margin:12px auto 0 auto;padding:10px 0;font-size:30pt;font-weight:bold;} #eventInfo-sub-title{margin:0px auto 15px auto;font-size:18pt;font-weight:bold;font-style:italic;} #eventInfo img{width:200px;height:180px;margin:0 auto;padding:0;border:2px solid #000;} .style_01{margin:10px auto;font-size:14pt;} .style_02{margin:0 auto;font-size:20pt;font-weight:bold;} .style_02 span{display:block;font-size:16pt;} #register{margin:15px auto 0 auto;font-size:20pt;} #register span{display:block;margin:0px auto 0 auto;font-size:10pt;color:#000000;} #eventInfo p a {outline:0;border:none;font-weight:bold;} #eventInfo p a:link {color:#c00;}#eventInfo p a:visited {color:#c00;}#eventInfo p a:hover {color:#0cf;} Peace,Elemental
  17. ShadowMage, Actually yes; thanks again, you were very helpful. I added an "else if" so that the "modal" won't show up on reload or refresh -although it still does for a moment and then goes away- and I changed the onclick() event to simply hide the "modal" since it's already set. I get that in my case I don't need to give a name to the value argument but since one is still required how are you setting it?Is it the 1 in the +1 in the following? y=ARRcookies.substr(ARRcookies.indexOf("=")+1); //Parse cookie value Peace,Elemental
  18. ShadowMage, Again, thank you; specially for your persistence and patience. Before I go any further let me see if I finally understand this So, the "value" argument, is one I create if I want to check for a specific thing, such as: username, the known answer to a given question -Are Dolphins mammals? ("true") or what does 2+2 equal ("4") etc...; then, the cookie, specific to that particular event, checks the known value to the one given or previously set by the user/visitor as in "username"? Peace,Elemental
  19. Okay, After re-reading and re-googling I went with the following simplified code. <script type="text/javascript"><!--window.onload = function checkCookie(hcpEvent){if (document.cookie!="hcpEvent"){document.getElementById("modal").style.visibility="visible";alert("Thanks for visiting"); // used to check script}else if (document.cookie=="hcpEvent"){document.getElementById("modal").style.visibility="hidden";alert("Thanks for coming back"); // used to check script}} function setCookie(){document.cookie="hcpEvent=hcp;expires=Tue, 06 Mar 2012 24:00:00 GMT";document.getElementById("modal").style.visibility="hidden";alert("Cookie Set"); // used to check script}//--></script> The cookie is being set, I checked and it's there; however, the checkCookie function is not working. When I reload or refresh the page the overlay and the event information dialog box are still showing. Peace,Elemental As for the value thing... I needed to assign value a variable, I chose "hcp", in order for the function to work. However, to me, that variable means nothing, it has no real value other than a requirement to make the script work and hense my confution. name, is required to set, check and delete the cookie.expires, is required to set the length of time the cookie will live.But, value, to me, has no meaning; no reason why it's even used other than, in the above example, a requirement to make the script work. Am I making sense?
  20. thescientist, Thanks for your reply, I will re-read what I have on functions again, I apologies I just feel burnt after so many days of trying to figure this out. The tutorial on w3schools on cookies isn't commented enough for me to understand how it works; unfortunately for me, on some things, I need a blow by blow explanation in order to get it. I'm not understanding the value argument at all, is this the value (the id) of the element I'm setting the cookie for? The name argument I get, we have to name the cookie in order to check for it or delete it and we do so with the setCookie function, which in my case should be set when I close the event information content window. The time or date argument I understand; although, I may not quite understand the code completely, yet, I get that we have to set a time value in order to know how long the cookie will live. This argument, when we check it on page load, will either read true or false, or yes the argument is set, you've been here before, so don't show the modal and event information or no the argument is not set, this is your first time here, so show the modal and event information. In Firefox:Tools / Web Developer / Web ConsoleI'm not getting any JavaScrip error messages / both alerts fire, I'm able to close the modal and the event information content. In IE 8Tools / Developer Tools (F12)Object doesn't support this property or method index.html. line 82 character 1 82| hcp=document.getElementById("modal");83| hcp.style.visibility="hidden";the createCookie function which is suppose to be set on an onclick() event isn't firing and the first alert("") only fires on the initial page load not on refresh (F5). Peace,Elemental
  21. thescientist, Thanks for your input, you too ShadowMage... I ain't gettin it guys; I'll just keep at it, maybe the light bulb will go off at some point. Peace,Elemental
  22. ShadowMage, Thanks and I'm sorry, I'm just burnt... HTML text, basically I'm calling it on an onclick="setCookie()" event, see first <p> element; thanks again. <!-- ** BEGIN of modal ** //--><div id="modal"> <p id="modal-header"><span><a id="clsBtn" href="#" title="close window" onclick="setCookie()"></a></span></p> <!-- ** BEGIN of flyer ** //--><div id="eventInfo"><p id="eventInfo-title">Life is a Balancing Act</p><p id="eventInfo-sub-title">How to Keep the Balls in the Air Without Dropping Them!</p><img class="centered" src="modal/images/juggling.jpg" alt="" /><p class="style_01">Please join us:</p><p class="style_02">Saturday, February 25th. from: 9am to 4pm</p><p class="style_02"><span>at</span>Glendale Community College</p><p id="register"><a href="https://cse.glendale.edu/CourseStatus.awp?&course=12WPD042" title="link to the the Glendale Community College">Register Now</a><span>(Page opens in a New Window)</span></p><p>For more information about the workshop view the <a href="modal/LifeisaBalancingAct_flyer.pdf" title="link to an Adobe PDF document">Life is a Balancing Act</a> Flyer.</p><!-- **** END of flyer **** //--></div><!-- **** END of modal **** //--></div>
  23. ShadowMage, Thanks for the help and the link but I still can't figure out what I'm doing wrong. The link shows a cookie that stores and then retrieves a persons name and although this example should explain to me how it all works it doesn't; or rather, I ain't getting it. As simple as setting a cookie may be, or so I keep reading in all the tutorials I've looked at, I can't seem to read between the lines and get the concept. Here's the ORIGINAL CODE function getCookie(c_name){var i,x,y,ARRcookies=document.cookie.split(";");for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } }} function setCookie(c_name,value,exdays){var exdate=new Date();exdate.setDate(exdate.getDate() + exdays);var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());document.cookie=c_name + "=" + c_value;} function checkCookie(){var username=getCookie("username");if (username!=null && username!="") { alert("Welcome again " + username); }else { username=prompt("Please enter your name:",""); if (username!=null && username!="") { setCookie("username",username,365); } }} Here's what I did window.onload = function checkCookie(){var c_name=getCookie("c_name"); if (c_name != null && c_name != "") {document.getElementById("modal").style.visibility="hidden"; } // since I'm not asking for a username I did the following else if (c_name == null && c_name == "") {document.getElementById("modal").style.visibility="visible";}alert("Test 1");} function getCookie(c_name){var i,x,y,ARRcookies=document.cookie.split(";");for (i=0;i<ARRcookies.length;i++){x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if (x==c_name){return unescape(y);}}} function setCookie(c_name,value,exdays){var exdate=new Date();exdate.setDate(exdate.getDate() + exdays);var c_value=escape(value) + ((exdays==null) ? "" :"; expires="+exdate.toUTCString());document.cookie=c_name + "=" + c_value; // I added this to close the overlay document.getElementById("modal").style.visibility = "hidden"; alert("Test 2");} The alerts are both firing but the setCookie is still not working What am I doing wrong?
  24. ShadowMage, Thanks for your reply and help, much appreciated. I got the "overlay and dialog" elements to show and hide using JavaScript with an onclick() event but I can't seem to get the cookie to remember the settings, the "overlay/dialog" keep's popping up every time I refresh or close and reopen the browser window.if it makes things easier here's a link to the test page http://www.heartcenteredprograms.com/test, I've added the JavaScript to the header and separated it all along with the HTML element id to make it easier to find and read. Again, thanks for the help. Peace,Elemental
  25. ShadowMage,If it’s not too much trouble could you please expand a little bit on the above bold text?I took your advice and created my own modal effect, I got the html & css working, I even got a small script to close it using an onclick() event:function closeThis(){hcp = document.getElementById("modal");hcp.style.visibility = "hidden";} For me this was a big deal; trust me.However, I've spent all day trying to get the cookie/JavaScript part to work with no luck; my brain just ain't computing this stuff and all the tutorials I've read over the last couple of days just make me feel like I'm a complete idiot; no comments please.This is what I think I need to do but haven't been able to implement, please correct me if my logic is wrong.On page load check to see if first time visitor, if yes then show modal.(this tells me that they have been to the site and have clicked on one of the three links I have on the dialog box: close modal, register for workshop or read more about it)If not first time visitor, check the date of last visit (the cookie should have this info).If last visit was >= to 3 days show modal again else continue hiding the modal.If, show modal, then when they click on any of the three links again the cookie is reset for the next 3 days.I think if I had a database set up I could check to see if they had registered for the workshop in which case I would hide the modal from them permanently but I would continue to show it periodically, after 3 days, for the other two.This is what I have so far. window.onload = function checkCookie(){document.cookie = "cookieName=hcpEvent";if(checkCookie="false"){hcp=document.getElementById("modal");hcp.visibility="visible";}else if (checkCookie="true"){hcp.visibility="hidden";}alert("is the cookie set ?????"); // the alert fires}function closeThis(){myDate = new Date("02/22/2012 04:30:00 AM");document.cookie = "cookieName=hcpEvent; expires=" + myDate.toString + ";";hcp = document.getElementById("modal"); // This workshcp.style.visibility = "hidden"; // as does this alert("cookie set"); // and this } Any help would be appreciated, not asking for you to write me the script just to point out where I missed the boat or if I'm gonna drown anyway. Peace,Elemental
  • Create New...