Downloading and running
programs written by unknown parties is a dangerous proposition. A program
available on the Web could work as advertised, but then again it could also
install spyware, a backdoor into your system, or a virus, or exhibit even worse
behavior such as stealing or deleting your data. The decision to take the risk
of running executable programs is typically explicit; you have to download the
program and assert your desire to run it by confirming a dialog box or
double-clicking the program’s icon. But most people don’t think about the fact
that nearly every time they load a Web page, they’re doing something very
similar: inviting code—in this case, JavaScript—written by an unknown party to
execute on their computer. Since it would be phenomenally annoying to have to
confirm your wish to run JavaScript each time you loaded a new Web page, the
browser implements a security policy designed to reduce the risk such code poses
to you.
Reserved Words in JavaScript
PMA04:09
>abstract
|
else
|
instanceof
|
switch
|
>boolean
|
enum
|
int
|
synchronized
|
>break
|
export
|
interface
|
this
|
byte
|
extends
|
long
|
throw
|
case
|
false
|
native
|
throws
|
catch
|
final
|
new
|
transient
|
char
|
finally
|
null
|
true
|
class
|
float
|
package
|
try
|
const
|
for
|
private
|
typeof
|
continue
|
function
|
protected
|
val
|
debugger
|
goto
|
public
|
var
|
default
|
if
|
return
|
void
|
delete
|
implements
|
short
|
volatile
|
do
|
import
|
static
|
while
|
double
|
in
|
super
|
with
|
php exec
PMA02:56
The exec() function is one of several functions you can use to pass commands to
the shell. The exec() function requires a string representing the path to the command
you want to run, and optionally accepts an array variable that will contain
the output of the command and a scalar variable that will contain the return value
the shell. The exec() function requires a string representing the path to the command
you want to run, and optionally accepts an array variable that will contain
the output of the command and a scalar variable that will contain the return value
mod_rewrite?
PMA02:51
Rewrites the requested URL on-the-fly based on configuration directives and rules.
You are using system paths. Apache mod_rewrite only works with URLs,
You are using system paths. Apache mod_rewrite only works with URLs,
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(favicon\.ico|assets) [NC]
RewriteRule ^(.*)/?$ DestinationFolder/$1 [L]
php file_get_contents
PMA00:44
|
This function is the preferred way to read the contents of a file into
a string.
The function itself does nothing but puts the source of the web page you supply it into a string available for use throughout your script. <?php echo file_get_contents("dtd.txt"); ?> You can use either the curl or the http library. You send a http request, and can use the library to get the information from the http response. $dat = @file_get_contents( "http://www.bbc.co.uk/" ); if( $dat ) echo htmlentities( $dat ); |
Cannot modify header information
PMA00:37
Check that
and remove
Use a better text editor to remove what's invisible now before the opening
<?php is at the very start of the functions.php file (before any whitespace)and remove
?> at the end of that file.headerorsetcookieor anything else that sends HTTP headers has
to be done before
any other output, or you'll get that warning/error.
Remember... anything not inluded in <?php ... ?>
Use a better text editor to remove what's invisible now before the opening
<?php. Use $_POST to get input values
PMA00:04
It will execute the whole file as PHP. The first time you open it,
$_POST['submit']
won't be set because the form has not been sent.
<?php
if (isset($_POST['submit'])) {
$example = $_POST['example'];
$example2 = $_POST['example2'];
echo $example . " " . $example2;
}
?>
<form action="" method="post">
Example value: <input name="example" type="text" />
Example value 2: <input name="example2" type="text" />
<input name="submit" type="submit" />
</form>
PHP Write and Read from File
PMA00:00
$fp = @fopen ("text1.txt", "r");
$fh = @fopen("text2.txt", 'a+');
if ($fp) {
//for each line in file
while(!feof($fp)) {
//push lines into array
$thisline = fgets($fp);
$thisline1 = trim($thisline);
$stringData = $thisline1. "\r\n";
fwrite($fh, $stringData);
fwrite($fh, "test");
}
}
fclose($fp);
fclose($fh);
Check if image file ??
PMA23:56
allow_url_fopen is activated in your PHP config
$filename = "http://".$_SERVER['SERVER_NAME']."
/media/img/".$row['CatNaam'].".jpg";
echo" <img src=\"".$filename."\" alt=\"".$row['CatNaam']."\">";
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}