Errata amendments

This commit is contained in:
RobinNixon
2021-11-16 12:23:58 +00:00
parent eeb4267820
commit fc6b9f4df3
11 changed files with 27 additions and 59 deletions
+1 -1
View File
@@ -7,6 +7,6 @@
function mysql_fix_string($pdo, $string) function mysql_fix_string($pdo, $string)
{ {
if (get_magic_quotes_gpc()) $string = stripslashes($string); if (get_magic_quotes_gpc()) $string = stripslashes($string);
return $pdo->real_escape_string($string); return $pdo->quote($string);
} }
?> ?>
+1
View File
@@ -1,5 +1,6 @@
<form method="post" action="calc.php"><pre> <form method="post" action="calc.php"><pre>
Loan Amount <input type="text" name="principal"> Loan Amount <input type="text" name="principal">
Monthly Repayment <input type="text" name="monthly">
Number of Years <input type="text" name="years" value="15"> Number of Years <input type="text" name="years" value="15">
Interest Rate <input type="text" name="interest" value="3"> Interest Rate <input type="text" name="interest" value="3">
<input type="submit"> <input type="submit">
View File
-28
View File
@@ -1,28 +0,0 @@
<script>
function asyncRequest()
{
try // Non IE Browser?
{ // Yes
var request = new XMLHttpRequest()
}
catch(e1)
{
try // IE 6+?
{ // Yes
request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch(e2)
{
try // IE 5?
{ // Yes
request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch(e3) // There is no asynchronous support
{
request = false
}
}
}
return request
}
</script>
-1
View File
@@ -3,7 +3,6 @@
{ {
echo file_get_contents('http://' . SanitizeString($_POST['url'])); echo file_get_contents('http://' . SanitizeString($_POST['url']));
} }
function SanitizeString($var) function SanitizeString($var)
{ {
$var = strip_tags($var); $var = strip_tags($var);
+1 -2
View File
@@ -11,8 +11,7 @@
let nocache = "&nocache=" + Math.random() * 1000000 let nocache = "&nocache=" + Math.random() * 1000000
let XHR = new XMLHttpRequest() let XHR = new XMLHttpRequest()
XHR.open("POST", "http://127.0.0.1/18/urlget.php?url=news.com" + nocache, true) XHR.open("GET", "http://127.0.0.1/18/urlget.php?url=news.com" + nocache, true)
XHR.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
XHR.send() XHR.send()
XHR.onreadystatechange = function() XHR.onreadystatechange = function()
+1 -2
View File
@@ -1,7 +1,6 @@
<?php // xmlget.php <?php
if (isset($_GET['url'])) if (isset($_GET['url']))
{ {
header('Content-Type: text/xml');
echo file_get_contents("http://".sanitizeString($_GET['url'])); echo file_get_contents("http://".sanitizeString($_GET['url']));
} }
+2 -2
View File
@@ -1,9 +1,9 @@
<?php // urlget.php <?php
if (isset($_GET['url'])) if (isset($_GET['url']))
{ {
header('Content-Type: text/xml');
echo file_get_contents("http://".sanitizeString($_GET['url'])); echo file_get_contents("http://".sanitizeString($_GET['url']));
} }
function sanitizeString($var) function sanitizeString($var)
{ {
$var = strip_tags($var); $var = strip_tags($var);
View File
+1 -1
View File
@@ -4,7 +4,7 @@
<title>RSS Feed</title> <title>RSS Feed</title>
<link>http://website.com</link> <link>http://website.com</link>
<description>website.com's RSS Feed</description> <description>website.com's RSS Feed</description>
<pubDate>Mon, 11 May 2020 00:00:00 GMT</pubDate> <pubDate>Mon, 10 May 2027 00:00:00 GMT</pubDate>
<item> <item>
<title>Headline</title> <title>Headline</title>
<guid>http://website.com/headline</guid> <guid>http://website.com/headline</guid>
-2
View File
@@ -8,8 +8,6 @@
background:linear-gradient(top, #fb0, #f50); background:linear-gradient(top, #fb0, #f50);
background:-moz-linear-gradient(top, #fb0, #f50); background:-moz-linear-gradient(top, #fb0, #f50);
background:-webkit-linear-gradient(top, #fb0, #f50); background:-webkit-linear-gradient(top, #fb0, #f50);
background:-o-linear-gradient(top, #fb0, #f50);
background:-ms-linear-gradient(top, #fb0, #f50); }
</style> </style>
</head> </head>
<body> <body>