php link doesn't work correctly : I'm having an imagehover on a php page and that image should link to a certain url. 

    if(file_exists($actionsloaded)) 
    echo '<a href=\"index.php\"><img src="/wp-content/uploads/2017/07/'.$image_on.'" onmouseover="this.src=\'/wp-content/uploads/2017/07/'.$image_off.'\';" onmouseout="this.src=\'/wp-content/uploads/2017/07/'.$image_on.'\';"/></a>';
    else

Problem is, when I click the link it goes to url.com/"index.php/"

any ideas what might be wrong with it? 

