Jump to content

Search the Community

Showing results for tags 'function'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 60 results

  1. I want to add elements by the browser into an array with the name $map I wrote the next piece of code for this: <?php $var = $_POST["var"]; function addIntoArray($var) { global $map; if (($var != ".") || ($var != "..")) { array_push($map, $var); echo $var . " succesfully added to the array!"; } return; } ?> The problem though, is not having an error code, but the screen just does not give an output at all while I did make an echo line. Whats going wrong here?
  2. So I have this function that firsts asks the player, which player they are, then asks them a question. if they get it right their score increases by one, and an alert pops up that says correct. The problem is, after you answer a question, an alert pops up that says correct, and then another question pops up. No matter what your answer is nothing happens afterwards. Basically after everything happens, another question comes up but it shouldn't. Can anyone tell me if there is anything wrong with my code that might make this happen? function question(question, answer) { this.question = question; this.answer = answer;}var a = new question("What letter comes after 'a'?", "b")var b = new question("What letter comes after 'b'?", "c")var allquestions = [a, b];var player1total = 0;var player2total = 0;var player3total = 0; function ask(){ var num = Math.floor(Math.random() * allquestions.length); var questions_obj = allquestions[num]; var player = prompt("What player are you?" + " (Hint: use your player number not your name.)"); if (player = "1"){ var trivia = prompt(questions_obj.question); if (trivia === questions_obj.answer){ player1total = player1total + 1; document.getElementById("player1score").innerHTML = player1total; var correct = alert("That is correct!"); $("#character1").animate({top: "-=100px"}, 500); } else{ var incorrect = alert("That is incorrect!"); } } if (player = "2"){ var trivia = prompt(questions_obj.question); if (trivia == questions_obj.answer){ player2total = player2total + 1; document.getElementById("player2score").innerHTML = player2total; var correct = alert("That is correct!"); } else{ var incorrect = alert("That is incorrect!"); } } if (player = "3"){ var trivia = prompt(questions_obj.question); if (trivia == questions_obj.answer){ player3total = player3total + 1; document.getElementById("player3score").innerHTML = player3total; var correct = alert("That is correct!"); } else{ var incorrect = alert("That is incorrect!"); } }}
  3. $email = $_POST['email'];require_once "/var/www/html/swift_mailer/swift_required.php";// Create the Transport$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com',***,'ssl')->setUsername('*******@****.com')->setPassword('***');// Create the Mailer using your created Transport$mailer = Swift_Mailer::newInstance($transport);// Create a message$message = Swift_Message::newInstance('Test Swift Mail Setup')->setFrom(array('******@***.com' => 'Statreferral Admin'))->setTo($email)->setBody($content,'text/html');// Send the message$result = $mailer->send($message); What is the wrong in this code pplease suggest me...... how can i check whether username contain mail server or not.....
  4. Hey, so I have another question about how to write a function. What I have is a prompt, that asks, what does "..." mean? What I want is a function that randomly chooses a word from a dictionary to enter in the quotation marks. Here is my dictionary: var translation = {};// Spanish dictionarytranslation.spanish = {};translation.spanish["gato"] = "cat";translation.spanish["perro"] = "dog";translation.spanish["hola"] = "hello";// English dictionarytranslation.english = {};translation.english["cat"] = "gato";translation.english["dog"] = "perro";translation.english["hello"] = "hola"; There are two buttons. When I press the spanish button I want a spanish word to go in the quotes, and I would respond with the word translated in english. When I press the english button I want an english word to go in the quotes, and I would respond with the word translated in spanish. I would use this to review spanish vocab. How would I make a function that randomly chooses a word to go in the quotes. I know I would have to use math.random, but otherewise I do not know how to set it up. Please provide suggestions and ideas, thanks!
  5. Hello everyone, I'm having a problem executing a function, I have now tried different methods for hours and can't understand anything anymore. Now when I execute the fuction infoApp(); in this function below, then it works. function editCat(ids){ $('.mode').hide(); $('.editmode_'+ids).show(); $('.save_category_'+ids).click(function(){ var getThisName = $('.category_'+ids).val(); infoApp('cat_edit',getThisName); }); } But when I try to execute the funtion automaticly then it does not work.Like this: var getThisName = 'test value';infoApp('cat_edit',getThisName); Here's the function function infoApp(app,usedata){ $('.infomsg').show(); if(app == "cat_edit"){ $('.infomsg').text("Information, "+ usedata +" category was saved"); } $('.infomsg').fadeOut(3600); } Hope anyone got some advice for me.Kris
  6. Hello everyone, I did try to search alot for an answer on this one, but I could not find it anywhere. I'm trying to have a simple search feature for my site, but I keep getting a blank page when doing a search containing multiplie words "like this" Tried to work it out with a str_replace but did not do the trick, have done this before, and it does work when just outputing the val as an echo instead of a query, so I'm blank now and appreciate any help! //function for replacing empty space with % function moreWords($val){$val = str_replace(" ","%", $val);return $val;} //Query$getCategoriesResults = mysql_query("SELECT * FROM `database`.`forumCategories` WHERE description LIKE '%".moreWords($_GET['search'])."%'");
  7. ronald

    step zero js

    hello, i tried to build a very simple function, and i failed allready. dissapointing. I can not find where i went wrong. plz help me. button 1: it should change the wordt "haai" to "yoyo" and then to "hallo". it does change haai to yoyo, but not beyond. button 2: it should change color (it does, so works fine). regards, ronald <script> function hello() { var x = document.getElementById("hey"); if(x = "haai"){ var y = "yoyo"; }else{ var y = "hallo"; } document.getElementById("hey").innerHTML = y; } function red(){ document.getElementById("hey").style.color = "red"; } </script> <button onClick="hello()">click me</button> <button onClick="red()">click me</button> <p id="hey">haai</p>
  8. I am trying to run a function that will convert a number and output it to a program. I have 2 different buttons and i want them to do a different event but i dont know what parameter to send to the function. Html code <input name="COM1" type="button" id="COM1" value="COM1 A" onClick="COMSET(paramter1)"><input name="COM1S" type="button" id="COM1S" value="COM1 S" onClick="COMSET(parameter2)"> Javascript function COMSET(){var FREQ = Number(prompt ("Frequency"));var jqXHR;$.ajaxSetup({ async: false });jqXHR = $.getJSON("http://" + location.hostname + "/clear_events", function(dane) {});jqXHR = $.getJSON("http://" + location.hostname + "/add_event?name=COM1A&eventname=COM_RADIO_SET", function(dane){});jqXHR = $.getJSON("http://" + location.hostname + "/add_event?name=COM1S&eventname=COM_STBY_RADIO_SET", function(dane){});$.ajaxSetup({ async: true });FREQ = FREQ.toFixed(2);alert(FREQ);var n1 = FREQ.substr(0, FREQ.indexOf("."));n1 = n1.substr(n1.length-2);alert(n1);var n2 = FREQ.substr(FREQ.indexOf(".")+1,2);alert(n1 + " : " + n2);var bcd = (parseInt(n1.charCodeAt(0) - 0x30 )<<12) + (parseInt(n1.charCodeAt(1) - 0x30 )<<8) + (parseInt(n2.charCodeAt(0) - 0x30 )<<4) + parseInt(n2.charCodeAt(1) - 0x30 );alert(bcd);var jqXHR;jqXHR = $.getJSON("http://" + location.hostname + "/set_event_value?name=COM1&value=" + bcd, function(dane) {});jqXHR = $.getJSON("http://" + location.hostname + "/set_event_value?name=com1s&value=" + bcd, function(dane) {});}
  9. Hi, friends, this is my first time here (sorry for my english). I have rpoblem in my code and I've tryed hard to solve it unsucessfully! I hope someone can help me...The problem: The form runs almost perfectly, except for the javascript function "mostrarCampo()". It should show an "imput field" each time I check the checkbox beside it. It happens that it shows only the first input. Here is the code: [background='light grey']//-----------------function Javasscript (in a file .js)------------------//function mostrarCampo(){ var nameForm = document.forms[0].name; switch (nameForm) { case "f_Ins_Suprimento": document.f_Ins_Suprimento.sClaNome.style.visibility="visible"; document.f_Ins_Suprimento.tfSupNome.style.visibility="visible"; document.f_Ins_Suprimento.tfSupEstoque.style.visibility="visible"; break; . . . case "f_Solicitacao_2": est = document.getElementsByName("tfEst[]"); for(var i = 0; i<est.length; i++){ document.f_Solicitacao_2.tfEst[i].style.visibility="visible"; } break; default: break; }}[/background] [background='light grey']//------------------THE FORM--------------------------------------------------//<!-- FORMULARIO DINÂMICO COM TRECHOS EM PHP QUE TRAZEM DADOS PARA SEREM MANIPULADOS --><form name="f_Solicitacao_2" action="index.php" method="post"><div align="center"><table id="tabRel"> <tr> <th colspan="4">SOLICITAÇÃO DE ALOCAÇÃO DE RECURSOS</th> </tr> <tr><td colspan='2'>Equipamentos</td><td>Estoque</td><td></td></tr><?php/*RESCUING A VRIABLE */ $proId = $_REQUEST['id'];/* CAPTURANDO E TRATANDO UMA EXCEPTION*/ try {/*GETTING DATA*/$lista = Equipamento::listarEquipamento();/*FOR EACH DATA IN ARRAY LIST, GET...*/foreach($lista as $value){$equ_Id = $value['equ_Id'];$equ_Nome = $value['equ_Nome'];$equ_Est = $value['equ_Estoque'];/*WRITTING IN SCREEN A TABLE WITH FOLLOWING ROWS* IN THE FIRST ROW, THE FUNCTION 'mostrarCampo() RUNS WHEN* THE CHECKBOX IS CHECKED AND SHOULD TURN "VISIBLE" THE "INPUT"* ON NEXT ROW */echo " <tr><td colspan='2'><input type='checkbox' id='chEquName' name='chEquName[]' onclick='mostrarCampo();' value="".$equ_Id."" />".$equ_Nome."</td> <td>Estoque :<input name='tfEst[]' id='tfEst[]' type='text' size='4' style='visibility:hidden;' value="".$equ_Est."" /></td> <td><input type='hidden' name='hProId' value="".$proId."" /></td></tr>";}/* CASO A EXCEÇÃO TENHA SIDO CAPTURADA, EXEBE MENSAGEM*/} catch (N_ListaVazia $exc) {echo $exc->getMessage();}?></table> <input type='hidden' name='hLabel' value='tela_Solicitacao_2' /> <p align="center"><input type="submit" name="bSubmit" value="confirmar"/></p><p align="center"><a href="?acao=tela_Servicos">VOLTAR</a></p><p align="center"><a href="?acao=logout">SAIR</a></p></div></form>[/background]
  10. Hi guys, I just have a dumb question but looks like I can't find the answer anywhere at all. What is a global function? specifically, how do I determine the scope of a function? I know the definition of the variable scope, but function scope, I don't, hope you guys could clarify this for me. One more thing. I have this code down below about the "this" keyword. Doesn't the "this" keyword refer to the element that triggers the event? if so, why it pops up "undefined" when I click on the paragraph? I'm pretty positive "this" in my case is bound to a global variable(that's why it gives me an "undefined" id) which is the window object, but I don't understand why "this" is not referring to the "<p>" element at all. Any tips and hints are greatly appreciated brothers(Please take it easy on me if I sound dumb, I just started teaching myself JS a couple weeks ago or so, so) Thank you very much guys. <!DOCTYPE html><html><head><script>function myFunction(){ alert(this.id);}</script></head><body><p id = "myPa" onclick="myFunction()">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p></body></html>
  11. Here's a fragment of working code with "functions inside functions". It has a "= function" definition. Here the word function is used too many times. It's a function inside a function and inside the next one. And finally the last function calls the first with all of them inside.Actually, the program has a very simple algorithm of counting typing speed:1 Starts the timer on a key-press2 Iterates every time as every next key is pressed and the stop point is in it's last key-press3 Outputs the delta in milliseconds (even without any conversion). The whole program: <script type="text/javascript"> var timing = { st: null, en: null, tx: null }; // start, end, textbox function initpr() { timing.tx = document.getElementById('prin'); var tx = timing.tx; tx.onkeypress = function () { timing.st = timing.en = new Date(); timing.tx.onkeypress = function (en) { if (!en) en = event; timing.en = new Date(); } } } function clc() { r = document.getElementById('resultpr'); deltams = timing.en.getTime() - timing.st.getTime(); chars = timing.tx.value.length; cpms = chars / deltams; snippets = [chars, " chars (in ", deltams, " ms): ", cpms, " cpms"]; r.innerHTML = snippets.join(""); initpr(); }</script><form name="foo" onsubmit="return false;"> <textarea id="prin"></textarea> <br /> <input id="btnclc" /> <span id="resultpr"></span> </form><script type="text/javascript"> document.getElementById('btnclc').onclick = clc; initpr();</script> Function initpr have additional nested functions: function initpr() { timing.tx = document.getElementById('prin'); var tx = timing.tx; tx.onkeypress = function () { timing.st = timing.en = new Date(); timing.tx.onkeypress = function (en) { if (!en) en = event; timing.en = new Date(); } } } It looks like cycle inside another one. Though it's not. Is there any possible way how to eliminate those that join?
  12. etsted

    live chat

    I have live chat that is supposed to display the "sender" and the "message", but instead give me some weird result. script: function get_msg(){ global $con; $query = "SELECT Sender, Message FROM chat"; $run = mysqli_query($con, $query); $messages = array(); while($message = mysqli_fetch_assoc($run)){ $messages = array('sender' => $message['Sender'], 'message' => $message['Message']); } return $messages; } <div id="messages"> <?php $messages = get_msg(); foreach($messages as $sender => $message){ echo "Sender: " . $sender . "<br >"; echo "Message: " . $message . "<br />"; } ?></div> this is what it outputs: Message has been sent. Sender: senderMessage: hiSender: messageMessage: message
  13. I have run the gradient creation code on its own as the page loads, but now I want to use it in a button click event, so I have tried to enclose it as a function that the button onclick event calls. I get no response at all so I assume I need to pass something in as a parameter, but I cant see what. or does it need an event listener somewhere? index.html testprojectcss.css
  14. Ignotas

    PHP forms

    Hello I now I am going to ask stupid question which is not worth new topic but I can't find answer any where. Can I run function in same page after clicking submit button and how do I do it ? Thank you for your answers. New guestion How do I keep form select type values after reloading page ?
  15. I have a mail function in my signup.phpBut, i don't know how to check if the mail function works... I used this code $delivery = mail ($to, $subject, $msg, 'From: ' . $email); if ($delivery) {echo 'Your form has been sent to Admin' . '<br />';}else{echo 'Failed to send the form. Try Again' . '<br />';} I had thought that it would solve the problem.. But, it would not ! I disconnected from the internet then i opened my signup.php, click 'submit'..But, it said that the form has been sent although i had disconnected from internet.. Would you please tell me the correct code to make the function-checker work ?
  16. I have this issue with a function where I want to execute 4 different actions inside an if statement. My code looks like this: function deltagare(){var myTextField1 = document.getElementById('namn');var myTextField2 = document.getElementById('epost'); if(myTextField1.value != "" && myTextField2.value != "")document.getElementById("deltagare-list").value+=myTextField1.value+" "+"("+myTextField2.value+")"+"\n",document.getElementById("deltagare-emaillist").value+=myTextField2.value+",",document.getElementById('namn').value="",document.getElementById('epost').value=""; elsealert("Skriv in både namn och epost!"); } In this way only the first action gets executed. How can I add the other ones properly?
  17. Okay. So, in my ongoing attempt to learn JavaScript, I've been given the following task. Write a function greaterThan, which takes one argument, a number, and returns a function that represents a test. When this returned function is called with a single number as an argument, it returns a boolean: true if the given number is greater than the number that was used to create the test function, and false otherwise. Please see the solution they provided below. function greaterThan(x) {[indent=1]return function(y) {[/indent][indent=2]return y > x;[/indent][indent=1]};[/indent]} var greaterThanTen = greaterThan(10); show(greaterThanTen(9)); Why would I write a function, like the one above, when I could write a function like the one below? function greaterThan(x, y) {[indent=1]return y > x;[/indent]}; show(greaterThan(10, 9)); And, secondly, how is the first code actually being interpreted? Why do we have to create a new variable storing the value of "greaterThan(10)"? Why can't we simply write show(greaterThan(10(9))); ? Perhaps I need to find some better resources to study from. I'm clearly missing something.
  18. I'm trying to learn Javascript and I've just briefly read about recursion in functions. I've been given the following task. Consider this puzzle: By starting from the number 1 and repeatedly adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of additions and multiplications that produce that number? For example, the number 13 could be reached by first multiplying 1 by 3, and then adding 5 twice. The number 15 can not be reached at all. Here is the solution: function findSequence(goal) { function find(start, history) { if (start == goal) return history; else if (start > goal) return null; else return find(start + 5, "(" + history + " + 5)") || find(start * 3, "(" + history + " * 3)"); } return find(1, "1");} print(findSequence(24)); If this code is run the following is printed to the console: (((1 * 3) + 5) * 3) In my head, the code is processed in the following steps. 1. findSequence is called, with a parameter value of 24.2. findSequence calls find giving the first parameter a value of 1 and the second parameter a value of "1".3. The find function looks to see if the start parameter value is equal to the value of the goal parameter.4. As the start parameter value, in this particular case, is not equal to the value of the goal parameter, check to see if the start parameter value is larger than the goal parameter value.5. As the start parameter value, in this particular case, is not equal to the value of the goal parameter, return one of the following statements:find(start + 5, "(" + history " + 5)")orfind(start * 3, "(" + history + " * 3)" However, this is then where I become stuck. I can't quite understand the statements it's trying to then run. I can see that find(start + 5, changes the value of history to 5. Then "(" + history + " + 5)") . This to me would print (1 + 5 ( + 5) + 5)). Similarly I see the other statment printing as (1 * 3 ( + 3) * 3)). I just can't quite grasp what I'm missing. I suspect it's something obvious and really simple but it would be great if someone could provide me with the missing pieces. I appreciate that there is most likely an alternative way of coming to the same result. However, I'd like to fully understand what is being shown to me here before I move on. Many thanks.
  19. Hi, I'd like some help please. I'm trying to create a pagination that will display the links of the pages like this:<a href="#">First Page</a><a href="#">Previous Page</a><a href="#">Next Page</a><a href="#">Last Page</a>Not showing numbers Here's my code so far: <?php$per_page = 20;$page = (isset($_GET['page']) === true) ? (int)$_GET['page'] : 0;$start = $page * $per_page; $query = "SELECT `users`.`user_id` AS `id`, `users`.`first_name` AS `firstname` , `users`.`last_name` AS `lastname`, `users`.`email` AS `email`, FROM `users` ORDER BY `users`.`user_id` DESC"; $query_limit = sprintf("%s LIMIT %d, %d", $query, $start, $per_page);$sql = mysqli_query($connection, $query_limit) or die(mysqli_error());$row_sql = mysqli_fetch_assoc($sql); $all = mysqli_query($connection, $query);$total_rows = mysqli_num_rows($all); $total_pages = ceil($total_rows/$per_page)-1;//$previous_page = ($page > 0) ? $page - 1 : 0;//$next_page = $page + 1;?><html>....<?php do { ?><td><?php echo $row_sql['firstname']; ?></td><td><?php echo $row_sql['lastname']; ?></td><td><?php echo $row_sql['email']; ?></td><?php } while ($row_sql = mysqli_fetch_assoc($sql)); ?>...<!--- pagination links go here ---> Is it also possible to put it and inside a function where I can pass the $query and the $per_page so that I can re-use it???
  20. Hi, I'd like some help please, if its possible. I have created two functions in order to display some messages when is set a $_GET after a redirect. Here's the code: function display(){if(isset($_GET['cnf_upd']) && $_GET['cnf_upd'] == '1'){ $value = "The update was successful!"; $type = "confirm"; construct_the_div($value, $type);}if(isset($_GET['err_upd']) && $_GET['err_upd'] == '1'){ $value = "The Update failed."; $type = "error"; construct_the_div($value, $type);}if(isset($_GET['cnf_del']) && $_GET['cnf_del'] == '1'){ $value = "Deleted completely."; $type = "confirm"; construct_the_div($value, $type);}if(isset($_GET['err_del']) && $_GET['err_del'] == '1'){ $value = "Unable to delete."; $type = "error"; construct_the_div($value, $type);}}function construct_the_div($value, $type){// creating a div to display the message results$div = "<div class=\"{$type}Msg\">\n";$div .= "<p>{$value}</p>\n";$div .= "</div><!-- end of {$type}Msg -->\n";echo $div;} What I'd like to make is to try to improve the display function, as it gets longer and longer, so that there whould be only one (or two at most) if statement(s). So the value of the GET will be dynamicly inside if condition and also if it has the preffix 'cnf_' it wil be a 'confirmMsg' and if it has the preffix 'err_' it wil be a 'errorMsg'. Is it possible to make something like this???
  21. I was looking through one of my web dev books when I found a javascript function I just didn't get. it was used in a cookie that stored info about radio buttons chosen. the function is escape() and here is the line document.cookie="optFont=" +escape(fontChoice)+";expires="+expire.toUTCString(); can anyone tell me what this function does and some common uses
  22. Hello everyone, I'm new to php so please bare with me on this. Before i explain my problem, let me give you guys a brief background on what i'm doing.i have a list of existing clients in my database that have a client# hence $code. Every clients will be sent an email that contain a link with their # aka $code. so when they arrive at my page, the address bar should also contain their $code.At the same time, there are also potential clients going to my webpage without client# ($code). Eventually both existing and potential clients will have to fill out a form. with their name and email. Problem #1:This is where I have difficulty in. Instead of making 2 separate website, which is very unnecessary. I want to set the form up according to those that enter the website with $code or without. Those with $code will be directed to request.php where they will fill in more information and those without will go to thankyou.php where the message "thank you for your request, a client id will be email to you shortly ." Unfortunately I can't get it to work, it only directs to thankyou.php with or without $code on the address bar. Please help me out. This is what I have on my index page. <?php $code=$_REQUEST['code'];$email=$_REQUEST['email'];?><html><head><title></title></head><body><form action="<?php if (isset($code)) echo 'request.php'; else echo 'thankyou.php'; ?>" method="post"> <input type="text" class="inputbg" name="FullName" id="FullName" onfocus="if (this.value == 'Your Name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Name';}" value="Your Name" /> <input type="text" class="inputbg" name="Email" id="Email" onfocus="if (this.value == 'Your Email') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Email';}" value="Your Email" /> <input type="hidden" name="Code" value="<?=$Code;?>" /> <input type="submit" class="submit" name="submit" value="<?php if (isset($code)) echo 'More Info'; else echo 'Continue';?>" /> </form> </body></html> Problem #2:I want to make the thankyou.php the result page where clients review their input for both sets of clients.Those with $code, I would want the page to show Name, email, phone, and appointment.For those without, I just want to show Name and email. This is what I have: <?php $FullName=$_REQUEST['FullName'];$Code=$_REQUEST['Code'];$Email=$_REQUEST['Email'];$Phone=$_REQUEST['Phone'];$BestTime=$_REQUEST['BestTime'];$theDate = isset($_REQUEST["date5"]) ? $_REQUEST["date5"] : "";$theDate = date('F-j-Y', strtotime($theDate));?><html><head><title></title></head><body><h1 class="heading" style="font-size:40px;">Thank you <?=$FullName;?> for your submission!</h1> <p style="padding:20px 0px 0px"> <h5>Your Email is: <?=$Email?>. </h5><?phpif (isset($code)) echo '[i]<h5>Your Personalized Code is: $Code. </h5>[/i][i]<h5> The phone number we had on file is $Phone</h5>[/i][i]<h5> You have scheduled a phone call on $theDate ,[/i][i]$BestTime -EST.</h5></p>[/i][i]<p style="color:#ffffff;"> *Selected appointment will adjust accordingly to Eastern Standard Time (-EST).</p>'[/i] [i]else[/i] echo "An email with a client I.D. will be email to you shortly."?> </body></html> I honestly thought the string if (isset($code)) ""; else ""; sting is all i need but no matter what, it only shows the second echo and never the first. I'm a little confuse at this point so if anybody out there knows how to fix this, please help me out. thank you! P.S. if anyone is confused by what i type, please let me know. Thank you.
  23. Hi there! I've built the following code snippet in order to animate a div element by using the setInterval() function to change the div element's height and width at a specified rate. the problem is that according to the arguments I've provided to the function, I've expected it to last 2 seconds. but unfortunately, actually the function executed during approximately 8 seconds and I don't understand why. please help me figure it out what is going here. <html><head><title></title><script type="text/javascript">try{function start(){var divFirst = document.getElementById("divFirst");var divControl = document.getElementById("divControl");function expand(eID, exHeight, exWidth, timing){i = 0;t = setInterval(innerExpand, timing);function innerExpand(){i++;eID.style.height = exHeight++;eID.style.width = exWidth ++;s = new Date();s = s.getSeconds();divControl.innerHTML = i + "---" + s;if(i == 1000){clearInterval(t);}//end if.}//end innerExpand().}//end expand().divFirst.onclick = function(){expand(divFirst, 20, 100, 2);}}//end start().}//end try statement.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor + "\n and the error stack is: \n" + err.stack);}//end catch statement.</script><style type="text/CSS">div#divFirst {background-color:red;}div#divControl {position:absolute; top:10px; left:200px;}</style></head><body onload="start()"><div id="divFirst">my first div!!</div><div id="divControl"></div></body></html> Any help will be appreciated! Thanks in advance! atar.
  24. Hi there Fellows!! I've encountered at a bizarre behavior at the underneath code snippet. what I've tried to do is to turn on the visibility of the second div element when the mouse hovers on the first div element. and then, when the mouse goes over the second div element, it triggers a CSS animation on the third div element. but strangely, when the mouse hovers on the second div element, it indeed triggers the CSS animation, but the second div element itself disapper although it wasn't requested to do so. can someone here figure out why does this occur and how to prevent it? any help will be appreciated!! thanks in advance!! atar. <html><head><title></title><script type="text/javascript">try{function start(){var divFirst = document.getElementById("divFirst");var divSecond = document.getElementById("divSecond");var divThird = document.getElementById("divThird");divFirst.onmouseover = function(e){divSecond.style.visibility = "visible";}divSecond.onmouseover = function(e){divSecond.style.visibility = "visible";}divSecond.onmouseover = function(e){divThird.style.width = window.innerWidth;}divThird.onmouseout = function(e){divThird.style.width = "0px";}divFirst.onmouseout = function(e){divSecond.style.visibility = "hidden";}}//end start().}//end try statement.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor + "\n and the error stack is: \n" + err.stack);}//end catch statement.</script><style type="text/CSS">div#divFirst {background-color:red;}div#divSecond {background-color:blue; visibility:hidden;}div#divThird {background-color:green; -o-transition:width 1s; -webkit-transition:width 2s; width:0px; overflow:hidden;}</style></head><body onload="start()"><div id="divFirst">my first div!!</div><div id="divSecond">my second div!!</div><br /><div id="divThird">my third div!!</div></body></html>
  25. This may be an HTML or PHP problem, or Java as well. I am trying to write an alphabetical index from inside a php file. Here's what I'm trying to accomplish: PHP script searches the My SQL table A link is generated out of each itemOn clicking on the link, a php variable is setand the script moves on. I need information for a function that the onClick refers to. I've only found rudimentary examples, and none are any help. So, I'm sending the problem to you. tim
  • Create New...