Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. justsomeguy

    Curl not returning values

    Well, the HTTP code of 0 indicates that there's a problem, because that's not a valid response code. You need to check if curl_exec returns false and print an error message. http://php.net/manual/en/function.curl-error.php
  3. Hello & Thanks , Seems to me that I once saw a chart of Html elements showing the allowable properties and values and inheritances of each element . Anyone know where this is located ? Ugh ! I forgot to bookmark it . Thanks
  4. vmars316

    How to scroll left side menu ?

    hanks All ; Looks like this is as close as I am going to get . <!DOCTYPE html> <html> <head> <style> body { margin: 0; } ul { list-style-type: none; margin: 0; padding: 0; width: 15%; background-color: #D3DDEB; text-align: center; position: fixed; height: 85%; border-style: solid; border-color: #5A697D; border-width: 1px; overflow: auto; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } li a.active { background-color: #4CAF50; color: white; } li a:hover:not(.active) { background-color: #eef0f2; <!-- #cdd2d8; #BDC3CB; --> color: white; } .button { background-color: #5A697D; border-style: 1px; border-width: 1px; border-color: black; color: #C8982B; color: #D9B04E; text-align: center; text-decoration: none; text-shadow: 1px 1px #000000; <!-- text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; --> font-family: "Comic Sans MS", cursive, sans-serif; font-size: 24px; cursor: pointer; } </style> </head> <body> <div style="border-style: solid; border-color: black; border-width: 4px;"> <div style="border-style: solid; border-color: #5A697D; border-width: 16px;"> <div style="border-style: solid; border-color: black; border-width: 4px;"> <!-- <ul style="border-style: solid; border-color: black; border-width: 2px;"> --> <ul> <br> <li><a href="http://vmars.us/automaton/automaton-index.html" target="_blank"> <button class="button">Automaton</button></a> <li><a href="http://vmars.us/freeware/index.html" target="_blank"> <button class="button">Freeware</button></a> <li><a href="http://vmars.us/javascript/ListOfGames.html" target="_blank"> <button class="button">Games</button></a> <li> <a href="http://vmars.us/Helps/HelpsPage.html" target="_blank"> <button class="button">Helps</button></a> <li><a href="http://vmars.us/myFavsLinks.html" target="_blank"> <button class="button">Links</button></a> <li><a href="http://vmars.us/Spiritual/SpiritualPage.html" target="_blank"> <button class="button">Spiritual</button></a> </li> </ul> <div style="margin-left:18% ;padding:0px 0px;height:600px; text-align: center; font-size: 16px; border-style: solid; border-color: #5A697D; border-width: 1px;"> <span style="display: block;"><img src="http://vmars.us/javascript/images/myPic-min.jpg" alt=""> <a href="http://vmars.us/index.html"" > <br><button class="button" > Welcome ! </button> </a></span> <br><br> Thanks for stopping by ! <br><br> Here you will fnd freeware and browser games I have written , <br><br> some automata I enjoy , and some I am working on , <br><br> a Build your own 'Dancing Man Automaton Kit' , <br><br> plus some helps and information I hope you will find useful . <br><br> My freeware includes : <br><br> <a href="http://vmars.us/freeware/clipLog/clipLog-Help.html" target="_blank" style="text-decoration: underline;"> clipLog/clipFind : Personal Information Manager</a> <br><br> <a href="http://vmars.us/freeware/myFavs/myFavs_Help.html" target="_blank" style="text-decoration: underline;"> myFavs : Internet Bookmark Manager</a> <br><br> <a href="http://vmars.us/freeware/mySort/mySort_Help.html" target="_blank" style="text-decoration: underline;"> mySort : Handy Text Sorter</a> <br><br> <br><br>"All things in moderation , except for love and forgiveness" <br><br> </div> <!-- <style="margin-left:22%;padding:1px 16px;height:1000px; "> --> </div> <!-- style="border-style: solid; border-color: black; border-width: 4px;" --> </div> <!-- style="border-style: solid; border-color: #5A697D; border-width: 16px;" --> </div> <!-- style="border-style: solid; border-color: black; border-width: 4px;" --> </body> </html>
  5. Today
  6. ameliabob

    Curl not returning values

    OK, My error moving from Javascript to PHP. Fixed that and now get but still nothing back Array ( [url] => https://api.iextrading.com/1.0/stock/market/batch?types=quote&filter=symbol,latestPrice,&symbols=T,IBM [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 20 [redirect_count] => 0 [total_time] => 0.156 [namelookup_time] => 0.047 [connect_time] => 0.11 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => 35.224.167.123 [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => 10.0.0.167 [local_port] => 53785 ) 1alertjresult is alertresult is putting the url into a browser gives the answer result as {"T":{"quote":{"symbol":"T","latestPrice":32.97}},"IBM":{"quote":{"symbol":"IBM","latestPrice":145.23}}} Now what is missing??
  7. justsomeguy

    Curl not returning values

    What does that mean? The first element in the array says http://0/, so your URL is "0". That's because you're using the plus sign on the line where you define the URL, and the plus sign is for addition. You use a dot to concatenate strings.
  8. justsomeguy

    Login user leven

    Store whatever information you need to know about a user in the session, and when you're printing the navigation bar check the values in the session to see if you should print each item.
  9. dsonesuk

    Responsive Menu Breakpoints

    This is a job for those with telepathy powers, who can see what the problem is the OP website, especially on line 840 in script.js, sorry my powers don't extend to telepathticness so i and many more can't help in this situation.
  10. ameliabob

    Curl not returning values

    I am trying to get to a site with the following code: $syms ="T,IBM"; $closeDict = array(); $url = "https://api.iextrading.com/1.0/stock/market/batch?types=quote&filter=symbol,latestPrice,&symbols="+$syms; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $jresult = curl_exec($ch); $info = curl_getinfo($ch); echo(print_r($info)); echo("alertjresult is ".$jresult); and several things are or are not happening. 1) the url doesn't get put into the header 2) There is no response Notice the alerts at the end. I seem to recall reading that there is an option to set when accessing a https site. However there is no password or other sign in function. If you cut and paste the url into a browser it operates just fine. What I have I overlooked?? [code}] Array ( => http://0/ [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.594 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 ) 1alertjresult is alertresult is [/code]
  11. m_hutchins

    Responsive Menu Breakpoints

    Hello there, I'm trying to have the responsive/"hamburger" menu appear at a slightly larger display screen width (probably around 1024-ish) and not having very much luck. I've tried altering and making this happen with css, but again, no luck. I believe it's being controlled (or somewhat) by JS (and I could be wrong...). Seeing that I'm not much of a JS guy, I'm having some issues figuring this out. I see some breakpoints that I've tried to edit at around line 840 in the /js/scrip.js file...and I didn't have any luck there as well. Any and all help would be greatly appreciated! Thanks in advanced! mh
  12. ~Code&Anime~

    Defining and Calling a Function within a Function

    function selectAndList(propertyName, inputArr) { const propertyArr = []; inputArr.map(function(item) { propertyArr.push(item[propertyName]); }); return propertyArr; } function countOccurences(propertyArr, value){ const values =propertyArr.filter(function(prop){ return prop==value }) return values.length } function countOccurences(propertyArr){ const map=new Map() propertyArr.map(function(val){ if(map.has(val)){ map.set(val, map.get(val)+1) }else{ map.set(val, 0) } }) return map } Apologies for this previous misunderstanding. I have rewritten my code in addition as to not use arrow functions as you mentioned you are not familiar with this. I thought it best to mention this as this may be useful when looking up info online. This is how such works for information, this was introduced in ES6: function myFunc(val){ } const myFunc = (val)=>{ } You would call both with myFunc(val), this does not change. also you should use const and let instead of var, var is defined globally, even when within a function. I have rewritten the function to reduce time complexity. There is no need to create multiple arrays. I have also defined a function to count occurences for a given property value
  13. rizwansyed

    Refresh the page

    Thank you Dsonesuk It works fine
  14. Max21

    Login user leven

    Hello, I am Max and new here. sorry for the spelling but my English is not so good. I create a website in php. after logging in I will go to the "Home.pgp". Now I do not want to show all navagation buttons for certain level users on the home page. how can I do this best? have already tried everything but do not get out of it. I have a sql database with username, password and level (admin / user / service) this is my code from the home page in which I enter the username of the login call : <?php // Include config file require_once 'config.php'; // Initialize the session session_start(); // If session variable is not set it will redirect to login page if(!isset($_SESSION['gebruikersnaam']) || empty($_SESSION['gebruikersnaam'])){ header("location: Index.php"); exit; } ?> <!DOCTYPE html> <html> <title>Mack Projects @ Techniek</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="Css/Index.css"> <style> html,body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif} </style> <body class="w3-light-grey"> <!-- Top container --> <div class="w3-bar w3-top w3-black w3-large" style="z-index:4"> <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i> Menu</button> <span class="w3-bar-item w3-left"><img src="Afbeeldingen/Index/Techniek_Poppetje_Home.jpg"> </span> <span class="w3-bar-item w3-right">Mack Projects @ Techniek</span> </div> <!-- Sidebar/menu --> <nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;" id="mySidebar"><br> <div class="w3-container w3-row"> <div class="w3-col s4"> <img src="/w3images/avatar2.png" class="w3-circle w3-margin-right" style="width:46px"> </div> <div class="w3-col s8 w3-bar"> <span><br><br> Welkom <b><?php echo htmlspecialchars($_SESSION['gebruikersnaam']); ?></b></span><br> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-envelope"></i></a> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-user"></i></a> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a> </div> </div> <hr> <div class="w3-container"> <h5>Dashboard</h5> </div> <div class="w3-bar-block"> <a href="#" class="w3-bar-item w3-button w3-padding-16 w3-hide-large w3-dark-grey w3-hover-black" onclick="w3_close()" title="close menu"><i class="fa fa-remove fa-fw"></i> Close Menu</a> <a href="#" class="w3-bar-item w3-button w3-padding w3-blue"><i class="fa fa-users fa-fw"></i> Overview</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-eye fa-fw"></i> Views</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-users fa-fw"></i> Traffic</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bullseye fa-fw"></i> Nieuws</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-diamond fa-fw"></i> ToDo</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bell fa-fw"></i> Agenda</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bank fa-fw"></i> Magazijn</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-history fa-fw"></i> Zone's</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-cog fa-fw"></i> Instellingen</a><br><br> </div> I want to thank you for the help! this is something purely as a hobby and not commercial that I do this
  15. dsonesuk

    Back button press

    You can't, you at very least require JavaScript, using JavaScript you can use window.onload=function(){ setTimeout(function() { window.location.href = "whereever.html"; //will redirect to your required page }, 1000); } on the page it lands on. The form needs to submit using default method, or JavaScript through AJAX where form values are sent using JavaScript/script code (that can read the post value usually server script such as PHP) as post/get to wherever, to process as it normally would, without the need to leave the form page.
  16. Hi I need to get a selected data from drop down list and then use it in other tab. For example , If i have 2 tabs and in tab 1 if i select "SI units" then in other tab only "A" should be visible and "B" should be hidden or disabled if i select "US units" then in other tab only "B" should be visible and "A" should be hidden or disabled. I have attached a text file for this Please suggest Thanks In advance accessing different tab content.txt
  17. The CSS height property as described on https://www.w3schools.com/cssref/pr_dim_height.asp, does not yet include the remark that the property is ignored for inline elements. Many HTML elements are inline by default, so this remark might be included? Current text: "The height of an element does not include padding, borders, or margins!" Suggested text: "The height of an element does not include padding, borders, or margins! The height property is ignored on inline elements."
  18. rizwansyed

    Back button press

    Hi We need HTML only, as customer dont need any other language except HTML I have found https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_button_formtarget which uses target="_blank" and posts it in other page. but is any alternative , so that we can avoid going to other page also....just submit and be in same page
  19. Funce

    How to scroll left side menu ?

    Oops! It seems I may have quoted the wrong property value. Very sorry. `Overflow: Auto;` works a little better for this.
  20. Yesterday
  21. ~Code&Anime~

    Defining and Calling a Function within a Function

    Yes but it seems that all the values for a given property are pudhed into an array, then the occurences are counted. This isn't very efficient. Edit: just realized i misunderstood the function. Will get back tomorrow.
  22. justsomeguy

    basic php - mySQL database login question

    The only danger there is if an attacker has access to your filesystem then they can read the contents of files like that. But if an attacker has access to your filesystem then you have bigger problems than leaking a database password.
  23. dsonesuk

    basic php - mySQL database login question

    True the password for an example is simple text, but unless you can view that file through an actual editor, all you will ever see opening the php file with just that snippet on the server is a blank page.
  24. Ingolme

    basic php - mySQL database login question

    The password is never sent over the internet, this is just source code of a program that only ever gets executed on the server.
  25. The w3schools tutorials are well written and very clear, but when I got to the MySQL database section red flags went up: https://www.w3schools.com/php/php_mysql_connect.asp specifically this code snippet: <?php $servername = "localhost"; $username = "username"; $password = "password"; yada yada yada... ?> The password in plain text? Just so? Without comment or explanation? That CAN'T be right... Surely the password should be obscured somehow, correct? Aren't there security concerns here? Regardless this should be explained or commented on somewhere on that page. Today I put this php code snippet in a protected folder and used the "include" keyword to access the database, but still the password is saved in plain text.
  26. justsomeguy

    Mysql db data doesn't register

    I can't fix something if I don't know what the problem is, and I haven't seen the error messages saying what the problem is. Literally the first step in debugging is getting the error messages, and we haven't gotten there yet. So there's nothing that I can suggest. It's like calling a mechanic and telling them something is wrong with your car but not giving any other details, they can't be expected to make any suggestions.
  27. Html

    Mysql db data doesn't register

    Hmm. That is quite a perspective on the subject in hand. I don't know what to do really now. You state to try and do some small tutorials on processing data. The books are so much the problem, but it is the way they express everything, in a video you have something visually displaying what is going on, even though as you've stated a lot of these aren't good quality. So in the end a video series is unlikely, unless somebody creates one for the right reason. As for patching up the code there, well if you could in anyway get something going, but in the long run it won't serve much of anything. I could suggest the free host I use, may be you could tailor it to that. If you are up for it then may be. Otherwise forget it. Thanks.
  1. Load more activity
×