Hey ,
I've just started doing PHP again after a long time of sitting it out. I wasn't the best back then so I'm hoping to improve myself now. I've got a simple script in which it apparently has errors which I'm unsure of and Google didn't exactly help me with.
First of all, some odd reason when I try to include an file in my config file its saying no such file or directory even when there is.
<?php// connect to DB include ("../includes/functions.php"); $Username = "*****";$Password = "******";$Database = "******";$Server = "localhost";
that is in the folder called includes.
And my main problem is about functions. I keep getting a fatal error saying "Unable to call undefined function" in my config file which is:
$YourIp = yourip();
In my functions that is:
function yourip(){$client = @$_SERVER['HTTP_CLIENT_IP'];$foward = @$_SERVER['HTTP_X_FORWARDED_FOR'];$remote = $_SERVER['REMOTE_ADDR']; if (filter_var($client, FILTER_VALIDATE_IP)){$ip = $client;}elseif (filter_var($foward, FILTER_VALIDATE_IP)){$ip = $foward;}else{$ip = $remote;}return $ip;}
(Yes I had help from online with the IP function, but I've got other functions which are exactly the same error)
For what I thought that was all fine, but some reason it isnt.
Any help getting me pass these error will be grateful.
Thanks