{"id":27294127,"url":"https://github.com/samuelgrahame/projectweb","last_synced_at":"2026-04-30T10:03:48.050Z","repository":{"id":99242751,"uuid":"164768648","full_name":"samuelGrahame/ProjectWeb","owner":"samuelGrahame","description":"csharp like php using CSharpScript","archived":false,"fork":false,"pushed_at":"2019-02-14T03:42:55.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T22:45:59.219Z","etag":null,"topics":["csharp","csharpscript","php","web"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuelGrahame.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-09T02:09:50.000Z","updated_at":"2022-08-14T09:07:13.000Z","dependencies_parsed_at":"2023-04-14T23:32:43.775Z","dependency_job_id":null,"html_url":"https://github.com/samuelGrahame/ProjectWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samuelGrahame/ProjectWeb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelGrahame%2FProjectWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelGrahame%2FProjectWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelGrahame%2FProjectWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelGrahame%2FProjectWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelGrahame","download_url":"https://codeload.github.com/samuelGrahame/ProjectWeb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelGrahame%2FProjectWeb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","csharpscript","php","web"],"created_at":"2025-04-11T22:45:52.298Z","updated_at":"2026-04-30T10:03:48.045Z","avatar_url":"https://github.com/samuelGrahame.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProjectWeb\nC# like php interface\n\nCreate a wwwroot folder in the working directory of the application.\n\nDefault document is: index.html\n\nI currently use .html to process the documents.\nYou can write HTML outside the \u003c?cs ?\u003e tags or write html using Echo(string);\ninclude and include_once are partially supported - use literal strings - doesn't support include_once x;\n\nsupports Echo - there are no overloads so to Echo you need to cast all values to string\nsupports Die - you can pass an Exception or Text - this will stop code from running.\nif an exception is thrown the file is not cached.\nyou can access the Context for the http request using the global variable Context which is of type HttpListenerContext (I will be adding the php functions too)\n\nhttps://docs.microsoft.com/en-us/dotnet/api/system.net.httplistenercontext?view=netframework-4.7.2\n\nBelow is an example of how close the code can be.\n\n# php code:\n\nhttps://www.w3schools.com/php/php_mysql_select.asp\n\n```php\n\u003c?php\n$servername = \"localhost\";\n$username = \"username\";\n$password = \"password\";\n$dbname = \"myDB\";\n\n// Create connection\n$conn = new mysqli($servername, $username, $password, $dbname);\n// Check connection\nif ($conn-\u003econnect_error) {\n    die(\"Connection failed: \" . $conn-\u003econnect_error);\n} \n\n$sql = \"SELECT id, firstname, lastname FROM MyGuests\";\n$result = $conn-\u003equery($sql);\n\nif ($result-\u003enum_rows \u003e 0) {\n    echo \"\u003ctable\u003e\u003ctr\u003e\u003cth\u003eID\u003c/th\u003e\u003cth\u003eName\u003c/th\u003e\u003c/tr\u003e\";\n    // output data of each row\n    while($row = $result-\u003efetch_assoc()) {\n        echo \"\u003ctr\u003e\u003ctd\u003e\".$row[\"id\"].\"\u003c/td\u003e\u003ctd\u003e\".$row[\"firstname\"].\" \".$row[\"lastname\"].\"\u003c/td\u003e\u003c/tr\u003e\";\n    }\n    echo \"\u003c/table\u003e\";\n} else {\n    echo \"0 results\";\n}\n$conn-\u003eclose();\n?\u003e\n```\n\n# CSharp code:\n\n```csharp\n\u003c?cs\nvar servername = \"localhost\";\nvar username = \"username\";\nvar password = \"password\";\nvar dbname = \"myDB\";\n\nvar conn = new Mysql(servername, username, password, dbname);\n\nif (!conn) {\n    Echo(\"Connection failed: \" + conn.Error());\n\treturn;\n}\n\nvar results = conn.Query(\"SELECT id, firstname, lastname FROM MyGuests\");\n\nif (results.NumberRows \u003e 0) {\n    Echo(\"\u003ctable\u003e\u003ctr\u003e\u003cth\u003eID\u003c/th\u003e\u003cth\u003eName\u003c/th\u003e\u003c/tr\u003e\");\n    // output data of each row\n\t  MysqlRow row;\n    while(row = results.FetchAssoc()) {\n        Echo(\"\u003ctr\u003e\u003ctd\u003e\" + row[\"id\"] + \"\u003c/td\u003e\u003ctd\u003e\" + row[\"firstname\"] + \" \" + row[\"lastname\"] + \"\u003c/td\u003e\u003c/tr\u003e\");\n    }\n    Echo(\"\u003c/table\u003e\");\n} else {\n    Echo(\"0 results\");\n}\nconn.Close();\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgrahame%2Fprojectweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelgrahame%2Fprojectweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgrahame%2Fprojectweb/lists"}