Jump to content

Search the Community

Showing results for tags 'linux'.

  • 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

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

Found 4 results

  1. Dear all, In my project, I am using an emebedded webserver LIGHTTPD with PHP. Within the main webpage, I use slider to write its value within a local file on my Linux OS. I wrote the slider like this: <input type="range" name="lightInputName" id="lightInputId" value="1" min="1" max="20" onchange="getvalor(this.value);" oninput="lightOutputId.value = lightInputId.value"> <input size="1" type="text" name="lightOutputName" id="lightOutputId"></input> What I want to do is to know if a javascript and/or PHP script is able to read the value of the slider, and copy it onto a local file. I don't have any idea on how to do this. Many thanks for your guidance. Best regards,
  2. hello dear all new to this forums and also new to php. so do not bear with me.well i am not too familiar with PHP. We just should run a few more xpath queries inside the loop for all the address keys and the website. we need to do this here <?php/** * OSM Overpass API with PHP SimpleXML / XPath * * PHP Version: 5.4 - Can be back-ported to 5.3 by using 5.3 Array-Syntax (not PHP 5.4's square brackets) *///// 1.) Query an OSM Overpass API Endpoint//$query = 'node ["amenity"~".*"] (38.415938460513274,16.06338500976562,39.52205163048525,17.51220703125);out;';$context = stream_context_create(['http' => [ 'method' => 'POST', 'header' => ['Content-Type: application/x-www-form-urlencoded'], 'content' => 'data=' . urlencode($query),]]);# please do not stress this service, this example is for demonstration purposes only.$endpoint = 'http://overpass-api.de/api/interpreter';libxml_set_streams_context($context);$start = microtime(true);$result = simplexml_load_file($endpoint);printf("Query returned %2$d node(s) and took %1$.5f seconds.nn", microtime(true) - $start, count($result->node));//// 2.) Work with the XML Result//# get all school nodes with xpath$xpath = '//node[tag[@k = "amenity" and @v = "school"]]';$schools = $result->xpath($xpath);printf("%d School(s) found:n", count($schools));foreach ($schools as $index => $school){ # Get the name of the school (if any), again with xpath list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; printf("#%02d: ID:%' -10s [%s,%s] %sn", $index, $school['id'], $school['lat'], $school['lon'], $name);}?> i just have had a quick view on the above mentioned site. i try to figure out how to do this - for any and all hints i am thankful The following code lists all schools and tries to obtain their names as well. I have not covered translations yet because my sample data didn't have those, but you can also look for all kind of names including translations and just prefer a specific one): //// 2.) Work with the XML Result//# get all school nodes with xpath$xpath = '//node[tag[@k = "amenity" and @v = "school"]]';$schools = $result->xpath($xpath);printf("%d School(s) found:n", count($schools));foreach ($schools as $index => $school){ # Get the name of the school (if any), again with xpath list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; printf("#%02d: ID:%' -10s [%s,%s] %sn", $index, $school['id'], $school['lat'], $school['lon'], $name);} The key point here are the xpath queries.In the above mentioend example two are used, the first xpath queriy is to get the nodes that have certain tags.I think this is the most interesting one for me: //node[tag[@k = "amenity" and @v = "school"]] This line says: Give us all node elements that have a tag element inside which has the k attribute value "amenity" and the v attribute value "school". This is the condition we have to filter out those nodes that are tagged with amenity school.Further on xpath is used again, now relative to those school nodes to see if there is a name and if so to fetch it: tag[@k = "name"]/@v' This line says: Relative to the current node, give me the v attribute from a tag element that as the k attribute value "name". As you can see, some parts are again similar to the line before. I think you can both adopt them to your needs.Because not all school nodes have a name, a default string is provided for display purposes by adding it to the (then empty) result array: list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; ^^^^^^^^^^^^^^^ Provide Default Value So here my results for that code-example: and now i try to figure out how i can enter more xpath queries at the above mentioned codeand get out even more important data - see here Key:contact - OpenStreetMap Wiki i will digg into all documents and come back later the weekend... and report all the findingswell - i think that i need to extend the xpath requests within the loop where xpath is used again,now relative to those school nodes to see if there is a name and if so to fetch it: tag[@k = "name"]/@v'tag[@k = " contact:website"]/@v'tag[@k = " contact:email"]/@v' What do you say...?many many thanks to you for all your help. You are very supportive. Keep up the superb work here....
  3. Hey All! I currently running Nginx as my web server, and I want to create a kind of catch all domain name handle, but cant seem to find any documentation on how to do this. Heres the use case... Lets say I changed the A Record for a site "superawesometest.com" to point at my server. But on my web server, running Nginx I don't have a site listening for that domain name. So instead of throwing an error, or sending the request to my Default Site, I want it to handle it by passing the requested domain name as a query parameter to a handler domain name. i.e. www.superhandler.com?requested_uri=superawesometest.com Any thoughts on how to do this? Thanks so much.
  4. So i am building an admin page as part of a project for the course I am doing. I want to execute the remote command "top" (it doesn't matter if i execute it by php ssh connection) on linux and than I want to store the output of the command in a variable called $data. Is that possible? I tried doing it with shell_exec() and exec() but couldn't get it to work. Thanks before hand.
×
×
  • Create New...