repl.it
@rpat/

phpTest

PHP Web Server

No description

fork
loading
Files
  • index.php
  • cart.db
  • credentials.db
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
  <head>
    <title>PHP Test</title>
  </head>
  <body>
    <?php\]
		    addMovieToCart("sfds");
				include "jbjbjds.html";
				?> <h2> lbjkjbfjevbr </h2><?php
			
function addMovieToCart($movieID){

    $movieData = readMovieData();
    array_push($movieData,$movieID);
    writeMovieData($movieData);
   // displayCart();

}
function readMovieData(){
    $file = fopen("cart.db",'r');
    $fileRead = fread($file,filesize("cart.db"));
    $dataArray = array_map('trim',explode(",",$fileRead));
    fclose($file);
    return $dataArray;
}

function writeMovieData($array){
    $file = fopen("cart.db", "w");
    $str = implode(", ", $array);
    fwrite($file,$str);
    fclose($file);

}     ?> 
  </body>
</html>
Fetching token
?