I'm working on a easier way of an existing page of mine and got a little problem.
I've tried to use $_GET to make it smaller, yet I get a lot of problems with this method.
Here's what I got:
$oc_a = file_get_contents('./'.$_GET.'/oc_info.html', true);
This is currently above this:
if ($_GET['pony'] == 'darkheart') die($header."<br><br>".$oc_a."<br>".$oc_b."<br>
<table style='width=80%;'>
<tr>
<td>
".$oc_c."
</td>
</tr>
</table>
");
And this is the error:
Notice: Array to string conversion in /home/rikuu/htdocs/twitter/index.php on line 12 Warning: file_get_contents(./Array/oc_info.html): failed to open stream: No such file or directory in /home/rikuu/htdocs/twitter/index.php on line 12
Can anyone tell me what I've done wrong so far?
$_GETis an associative array of key value pairs, so this is almost certainly not what you want. What are you wanting to get out of using$_GET? I would guess you are trying to do something like'./'.$_GET['pony'].'/oc_info.html'but please don't do this without ensuring your document root is locked down to prevent something like?pony=../../../../etc/passwd