Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

  1. Hi, I try to use a python script what give stable solutions for the roommate problem. I have found this script: path to github. I get it to run from php with $output1 = exec(. /stableroomate.py ./solution_prefs.csv 2>&1", $output2) var_dump ($output1); But I get an error: string(27) "SyntaxError: invalid syntax" Array ( [0] => File ".stableroomate.py", line 170 [1] => holds = dict( (name, None) for name in prefs.keys() ) [2] => ^ [3] => SyntaxError: invalid syntax ) This refers to python (see attached stableroomate.py) # holds holds = dict( (name, None) for name in prefs.keys() ) What is wrong with this syntax? I tried to contact the author and the university where this came from, but there is little response. I am not familiar with python. Help here is greatly appreciated. README.md solution_prefs.csv stableroomate.py
  2. hi everyone, i am basically new to this forum so i didn't really know where to post this question, basically what happened i made a site. on this site is a particular commenting system where i used php ajax on the jquery way, my teacher saw my website and wanted to test something so he left a comment with <b>exampe</b> and his comment turned out to be bold text. to me and the safety of my site it is a dangerous thing as peope are required to leave their email in the form (not shown in actual comment but saved in the db) he also said that with his knowlege he could use <script>alert(document.cookie)</script> to make me use his cookie to log in to phpmyadmin, esentially granting him acces to all my databases. now is my question "how can i use htmlentities() on ajax?" he suggested "$comment = htmlentities( $_POST['comment'] );"but since all of my fields are written like this: $commentId = isset($_POST['comment_id']) ? $_POST['comment_id'] : ""; $comment = isset($_POST['comment']) ? $_POST['comment'] : ""; $commentSenderName = isset($_POST['name']) ? $_POST['name'] : ""; $date = date('Y-m-d H:i:s'); there is no way i can figure out where to put it... these are my php files, take a loo if you wish, but i removed my db.php database password and replaced my database name in the form (for security reasons) (you may lso see comments.php as index.php since i already had index so i renamed it to something else comment-add.php comment-list.php comments.php comment-add.php comment-list.php comments.php db.php
  3. Hi new to this so hopefully, someone can point me in the right direction.. currently trying to use this https://www.w3schools.com/howto/howto_js_collapsible.asp to create a staff profile element. i have changed it so the elements sit side by side but when I click on the hidden content it pushes the other two elements down the page. I would like them to stay in line with the content appearing below. my reworking of the code is this.. HELP /*the team section CSS*/ .the-team{ clear: both; } .the-team-inner{ margin: 0 auto; width: 80%; padding: 4.5em; } .team-members{ width: 25%; display: inline-block; padding: 3.8em; } .team-members img{ width: 100%; } .collapsible { background-color: #777; color: white; cursor: pointer; padding: 18px; width: 100%; border: none; text-align: left; outline: none; font-size: 1.4em; } .active, .collapsible:hover { background-color: #555; } .collapsible:after { content: '\002B'; color: white; font-weight: bold; float: right; margin-left: 5px; } .active:after { content: "\2212"; } .content { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.2s ease-out; background-color: #f1f1f1; } <!-- THE TEAM HTML--> <div class="the-team"> <div class="the-team-inner"> <div class="team-members"> <img src="images/headshot.png" alt="headshot one"> <button class="collapsible">Ronnie Garrick</button> <div class="content"> <p>Ronnie has over 30 years of global energy industry experience and has played an integral role within a number of technology-focused companies. Ronnie has a strong a track record of internationalisation and export in both the onshore and offshore markets – his expertise has been gained within key Director roles in operations, sales, finance and board level activity.</p> <p>Starting his career with BP working at the Grangemouth Oil refinery in Scotland, Ronnie has successfully led a number of M&A’s including the sale of a global oilfield service firm to Lime Rock Partners in 2007. He continued as CEO to lead the company with its international expansion in regions including the US, Norway, Middle East and Europe until his exit following the successful sale to Buckthorn Partners in 2017. </p> <p>He currently sits as a Non-Exec Director on the investor Board of TWMA and is looking forward to assisting and transforming businesses through the combined expertise of Garrick Group. </p> </div> </div> <div class="team-members"> <img src="images/headshot.png" alt="headshot one"> <button class="collapsible">Davie Garrick</button> <div class="content"> <p>Davie started his career in Shetland as an apprentice plant mechanic and has gained years of experience both on and offshore. Playing a key role across multiple disciplines, Davie has been integral in building the capabilities and global reach of oil service businesses within the energy sector.</p> <p>Following the merger to form TWMA, and subsequent sale to Lime Rock Partners in 2007, Davie exited the business in 2017 and continues to sit as a non-exec Director on the Investor Board.</p> <p>With an operational, technical and commercial skillset, he aims to use his experience and track record in the industry for further non-exec and investment opportunities. </p> </div> </div> <div class="team-members"> <img src="images/headshot.png" alt="headshot one"> <button class="collapsible">Douglas Garrick </button> <div class="content"> <p>Douglas has over 25 years of experience gained in directing businesses through acquisitions, disposals, funding and private equity. As Finance Director, Douglas led a global oil services firm from a privately owned SME to become an equity backed £50million turnover organisation with 550 staff. Following his exit from TWMA, Douglas now aims to use his finance and commercial track record to assist other growing businesses in related industries.</p> <p>His other areas of expertise include legal disputes and resolutions, disposals, funding, property management and insurances. </p> <p>Douglas has completed the Non-Executive Director Programme at the University of Edinburgh Business School and Institute of Directors. </p> </div> </div> </div> </div>
  4. I have spent many hours (over many days) trying to find out how to align a <script></script> within HTML5 specifically one that creates a canvas using . There is a page referring to centering images... https://www.w3schools.com/howto/howto_css_image_center.asp useless! There is a page referring to CSS Layout.... https://www.w3schools.com/css/css_align.asp useless! And heres another one on Canvas reference.... https://www.w3schools.com/tags/ref_canvas.asp useless! https://www.w3schools.com/tags/tag_canvas.asp useless! https://www.w3schools.com/tags/tag_script.asp useless! https://www.w3schools.com/html/html5_canvas.asp also useless! This is so basic a feature you would think that there would be examples of this in some of your examples. but no! Here is the code I have been trying to center.....as you can see I have tried quite a few different methods. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <style> canvas { border:1px solid #d3d3d3; background-color: #f1f1f1; margin: auto; text-align: center; object-position:center } .center { display: block; margin-left: auto; margin-right: auto; width: 50%; } </style> </head> <body onload="startGame()"> <div class="center"> <script> var myGamePiece; function startGame() { myGamePiece = new component(30, 30, "red", 10, 120); myGameArea.start(); } var myGameArea = { canvas : document.createElement("canvas"), start : function() { this.canvas.width = 800; this.canvas.height = 600; this.canvas.x = 100; this.canvas.y = 50; this.canvas.style.cursor = "none"; //hide the original cursor this.context = this.canvas.getContext("2d"); document.body.insertBefore(this.canvas, document.body.childNodes[0]); this.interval = setInterval(updateGameArea, 20); window.addEventListener('mousemove', function (e) { myGameArea.x = e.pageX; myGameArea.y = e.pageY; }) }, clear : function(){ this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); } } function component(width, height, color, x, y) { this.width = width; this.height = height; this.speedX = 0; this.speedY = 0; this.x = x; this.y = y; this.update = function() { ctx = myGameArea.context; ctx.fillStyle = color; ctx.fillRect(this.x, this.y, this.width, this.height); } } function updateGameArea() { myGameArea.clear(); if (myGameArea.x && myGameArea.y) { myGamePiece.x = myGameArea.x; myGamePiece.y = myGameArea.y; } myGamePiece.update(); } </script> </div> <p>Move the cursor inside the canvas to move the red square.</p> </body> </html> Please can you place more references to alignment as this issue has become somewhat annoying considering how easy this is in p5 javascript for instance. In p5 its - var canvas = createCanvas(1000, 350); canvas.position(x,y); So please make some kind of reference to centering js and <script> in some of the other pages using the term center, like <center> (yes I know its deprecated - but what are the alternatives?) as the search for this info is rather long. Thankyou in advance.
  5. hi there... i use the dot slideshow indicator with the carousel code for automatic advance images, but can´t make points changes togheter with the image changes with the code... any ideas? sorry about my english.... here is the code... thanks in advance. <header class="w3-display-container w3-center" id="home" style="padding-top: 150px"> <div class="w3-content w3-display-container" style="max-width:800px"> <img class="mySlides" src="img-1.jpg" style="width:100%"> <img class="mySlides" src="img-2.jpg" style="width:100%"> <img class="mySlides" src="img-3.jpg" style="width:100%"> <img class="mySlides" src="img-4.jpg" style="width:100%"> <div class="w3-center w3-container w3-section w3-large w3-text-white w3-display-bottommiddle" style="width:100%"> <div class="w3-left w3-hover-text-khaki" onclick="plusDivs(-1)">&#10094;</div> <div class="w3-right w3-hover-text-khaki" onclick="plusDivs(1)">&#10095;</div> <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(1)"></span> <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(2)"></span> <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(3)"></span> <span class="w3-badge demo w3-border w3-transparent w3-hover-white" onclick="currentDiv(4)"></span> </div> </div> </header> <script> //slideshow carousel var myIndex = 0; carousel(); function carousel() { var i; var x = document.getElementsByClassName("mySlides"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } myIndex++; if (myIndex > x.length) {myIndex = 1} x[myIndex-1].style.display = "block"; setTimeout(carousel, 9000); } //new code var slideIndex = 1; showDivs(slideIndex); function plusDivs(n) { showDivs(slideIndex += n); } function currentDiv(n) { showDivs(slideIndex = n); } function showDivs(n) { var i; var n = document.getElementsByClassName("myIndex");//quitar var x = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("demo"); if (n > x.length) {slideIndex = 1} if (n < 1) {slideIndex = x.length} for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" w3-white", ""); } x[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " w3-white"; } </script>
  6. Is it possible to have a Read More Read Less Button with parallax scrolling? Scrolling causes the text to flash. I am using the following script: function myFunction() { var dots = document.getElementById("dots"); var moreText = document.getElementById("more"); var btnText = document.getElementById("myBtn"); if (dots.style.display === "none") { dots.style.display = "inline"; btnText.innerHTML = "Read more"; moreText.style.display = "none"; } else { dots.style.display = "none"; btnText.innerHTML = "Read less"; moreText.style.display = "inline"; } } Above my head!
  7. I am a complete beginner and am trying to learn HTML at the same time as modifying an existing website to be mobile friendly @media only screen and (max-width: 500px) { body { background-color: lightblue; } } @media only screen and (min-width: 500px) { body { background-color: coral; } } </style> </head> <body> <div id="slSection"> <umbraco:Macro splashMedia="[#splashMedia]" Alias="SplashScreenSlideshow1" runat="server"></umbraco:Macro> </div> Above is a code fragmant I need help with, as a test I haveset the page to change background colour from lightblue to corel when viewed on a smaller screen and this works. Further down the code calls a script called SplashScreenSlideshow1 My problem is I would like call a different script based on the size of the viewing screen. How do I define a script name based on the screen size? Any help gratefully received Thanks Andrew
  8. Please Wotz The Difference Between And nd thier application...as wel as wen nd wer to use them
  9. I found a code to automatically connect people on linkedin, but it is not working. It says, illegal character. Found it here http://www.iftiseo.com/2015/02/code-to-increase-linkedin-connections.html What is wrong?
  10. Hello. Here I have a VBScript which shows the installed programs of the local machine in a txt-file with name and versionnumber. What I want is filter some programs, so you don't see them in the txt-file. For example Microsoft Word 2013 and Microsoft Excel 2013. Can someone help me with this? See the script as attachment. softwarelist with filter.txt
  11. Hello everyone here m new i need help if u can do i want make a mp3 music site with download fecture so anyone can explan it how i can make i want show mp3 file detail like airtest , file name , size, album name and then show 3 type of music download option like 48,128,320kbps if u know how i done plz help me for this
  12. Hello, I'm trying to reload only a script instead of entire page. And I want to apply it in an ajax script. How could I do that? My web contains a map(script of openlayers) and I put data into the map. So when I remove this data by a button I would like reload only the map. Here is my code. It only shows an alert if the object has been removed or not: // Autor: @jqcaper// Configuraciones Generalesvar nombre_tabla_pozos = "#tabla_pozos"; // idvar nombre_boton_eliminar_pozo = ".deletepozo"; // Clasevar nombre_formulario_modal_pozo = "#frmEliminarpozo"; //idvar nombre_ventana_modal_pozo = "#pozoModal"; // id// Fin de configuraciones$(document).on('ready',function(){ $(nombre_boton_eliminar_pozo).on('click',function(e){ e.preventDefault(); var Pid_pozo = $(this).attr('id'); var name_pozo = $(this).data('name'); $('#modal_idPozo').val(Pid_pozo); $('#pozo_name').text(name_pozo); }); var options_pozo = { success:function(response) { if(response.status=="True"){ alert("¡Object removed!"); var idPozo = response.pozo_id; var elementospozo= $(nombre_tabla_pozos+' >tbody >tr').length; if(elementospozo==1){ location.reload(); }else{ $('#tr'+idPozo).remove(); $(nombre_ventana_modal_pozo).modal('hide'); } }else{ alert("¡There was an error when remove!"); $(nombre_ventana_modal_pozo).modal('hide'); **RELOAD SCRIPT }; } }; $(nombre_formulario_modal_pozo).ajaxForm(options_pozo);}); Thank you very much!
  13. Does anyone know how I can get the Text Image to be in the same line as the search bar? Right now the Image sits on top of the Search Bar. This is what I have for the code so far... <!DOCTYPE html><html><script> (function() { var cx = '015893638143991805514:c78o5hkpg04'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })();</script><body><div style="background-color:white; color:white; margin:15px 0px 0px 0px; padding:0px"><img src="http://www.weebly.com/uploads/1/4/3/9/14399682/357638_orig.jpg" border="0" width="220" /><gcse:search></gcse:search></div> </body></html>
  14. Hi all PHP newbie and first post! I hope someone can help. I have looked at some of the tutorials but still can't get my head around how to get the data from within a PHP script. Trying to create a form with two fields "Date" and "Channel" to look at the 'calldate' and 'channel' columns and then give a count result, so just want to find whatever specified on the form and give the number of ocurrences found grouped by date. Ie, how many ocurrences for specified 'chanel' %CLI/1234567% for a given date. Thanks
  15. Hi there, I´m new at this forum and a beginner with PHP. I used the here offert "PHP - Complete Form Example" and it works fine. Thanks for that.But the submit button just proves the form and doesnt send the variables to the next page. Does anyone know a way to send the proven variables to another page? I tried: 1) Print the variable on my secound page with echo $var; --> that didnt work. I guess my secound page doesnt know where to get the variable from. I also dont know where and if my variables are saved after I press the submit button on my page. 2) Create two actions in the form like <form action="<?php echo htmlspecialchars($SERVER[...]);?>"> action=page2.php method="post"> That also didnt work. Probably because you cant use 2 actions in one form. 3) I dont want to work with url links, because you can see the variables in the url. 4) I dont want to work with sessions. 5) One of my ideas was to work with another php-script after my form, which will send my variables from the form to the secound page. I figured out how to activate the scrip, when the form is filled out correctly, but I have no idea how to send my data. How would it work with the here offert form? Thanks for your help guys.
  16. Looking for a code that's uninfected, preferably code that you can post using the Facebook script code tags. Does anyone have a script code for tagging all frinds in a post, if not then .... Just like all the rest of the auto tag scripts for Facebook on youtube they are not working. I have found one script that works but I can't post what I want, I am not allowed to tag the post that I want. I am only allowed to post what the creator wants me to tag. Make sense? Can you edit the script to allow me to post what I want then tag all my friends?
  17. etsted

    concatenation

    the thing whit this pagination script is that it works, but then thing is that it concatenates all of my "titles" into on link. But if i take away the concatenation then the pagination will only display one item from my database. include "connect.php"; $count_query = mysqli_query($con, "SELECT NULL FROM videos"); $count = mysqli_num_rows($count_query); if(isset($_GET['search'])) { $page = preg_replace("#[^0-9]#","",$_GET['search']); } else { $page = 1; } $perPage = 2; $lastPage = ceil($count/$perPage); if($page < 1) { $page = 1; } else { if($page > $lastPage) { $page = $lastPage; } } $limit = "LIMIT " . ($page - 1) * $perPage . ", $perPage"; $query = mysqli_query($con, "SELECT * FROM videos ORDER BY id DESC $limit"); if($lastPage != 1) { if($page != 1) { $prev = $page - 1; $pagination .= '<a href="pagination.php?search='.$prev.'">Previous</a> '; } if($page != $lastPage) { $next = $page + 1; $pagination .= '<a href="pagination.php?search='.$next.'">Next</a>'; } } while($row = mysqli_fetch_array($query)) { $title .= $row['title'] . "<br />"; $url .= $row['url']; $description .= $row['description'] . "<br />"; } echo "<h3><a href='$url'>$title</a><h3> $description"; echo $pagination;
  18. etsted

    video upload

    does anyone know how i can make a php video uploader script?
  19. Hi,i need help for a script that on a evet or condition to take screen shot ot save the web page on my PC. Can you help methe event is when its played a sound ... using firefox and Greasemokey to start the script Pls help we thank you
  20. Hello, i'm wondering is it possible to pass variable inside <script></script> to another <script></script> field. Example i have <script>var message = "Hello";</script><script>alert(message);</script> I know i could add them together in this script i write, but my actual codes is separating the scripts.
  21. dedi

    upload many files

    I want to upload multiple files only with php.for example like my picture.when pressing the Add button, the file appears under the Add button.and after selecting a file, press the update button when the data is saved to the database.I want your help.I was confused to find references to complete my work.thank you
  22. Can someone please give me some example code so I can link a webpage to another using javascript? This is my code at the moment:- document.onkeydown = function(e) { e = e || window.event; // because of Internet Explorer k = e.which || e.charCode || e.keyCode; // because of browser differences... if (k == 49 && !e.altKey && !e.ctrlKey && !e.shiftKey) { string.link(link.html) } else { return true; } return false; } This won't link me to the other link when "1" on the keyboard is pressed... Please Help!
  23. Hi All, I'm new to web programming in general and need some advice for a site that I'm trying to pull together. The best I can do is try to describe what I'm trying to do because I really have no idea of how to implement this idea.The primary purpose of the site is to be a blog with separate directories for different themes. I was hoping to have a navigation menu on the side of the site with sort of an archive list in which a user could select the article they wish to read by selecting their way through directories as displayed in the menu. I want to be able to just bring up the article without having to redirect to a different page or reload the current one when an article is selected.I would be putting this together with Dreamweaver, but have no idea what to build this element in (JScript, VBScript, or flash item?) Thanks for any advice or guidance!
  24. My goal is to send an email at the time indicated below. (Every weds at 12). Here is my current code: <?php date_default_timezone_set('MST');$file = $_SERVER['DOCUMENT_ROOT'] . "/entries.txt"; //Path to your *.txt file$contents = file($file);$string = implode("", $contents); $to = "april@coastalmountaincreative.com";$subject = "My subject";$txt = $string;$header = "From: scott@avvecc.com"; $d = date( "w");$h = date( "G"); if ($d == 3) {if ($h == 12) { mail($to,$subject,$txt,$header);file_put_contents("entries.txt", "");}} ?> It works great, however if no one visits the page at 12 that day it never gets sent. How can I make it so it sends no matter what? Thanks.
  25. Are there any articles from W3Schools about CGI scripts? I want my forms to send info like username and password to a server so I can process that information with a script in like a mySQL database (so that the user can log on to their customized page in the future). I think that's right at least. Two questions: First: Where and how can I utilize a server to contain this user login info(for now)? Would I use like GoDaddy to get my own server?Second question: How would a CGI script have to be coded in order for it to process this info for later use on my website? or do I need to use PHP for that. I've heard that mentioned in conjunction with mySQL databases.I know this all sounds pretty vague, but I'm continually doing more research on the topic, just wanted to know if anyone could shed some light on the topic. This is a great site, thanks for any and all replies.
×
×
  • Create New...