Search code examples
phphrefrequire

url does not work on server but does on localhost


I got a problem with my page loader, I have a "buttons" function that I have placed in my pagebanner controller (pagebanner.php). It looks like this:

<?php
   if(isset($buttons)){
    foreach($buttons as $button) {
        echo "<a href='$button[1]' class='w3-btn w3-dark-gray w3-margin-
left'>$button[0]</a>";
     }
  }
?>

When I am making a new file, I require the pagebanner.php So i can make buttons in the new file, Like this:

   $buttons = Array(

     ['Inplannen', '/?page=onderhoudInplannen&kid='.$_GET['kid'] 
    .'&id='.$row['id']],
     ['Afboeken', '/?page=onderhoudAfboeken&kid='.$_GET['kid'] 
    .'&id='.$row['id']],
);

But the problem is, that it doesn't lead me to that particular page, but I leads my to my default page where I go when the program doesn't recognize the page name. In my url bar it will show me the good url with the good id's but it just doesn't go to the page.

The first link doesn't work, it is on my server:

Link: 192.168.1.9:8000/?page=onderhoudAfboeken&kid=18&id=217

But the second link does work and it is on my localhost:

Link: http://localhost:8000/?page=onderhoudAfboeken&kid=18&id=217

I want the link to work on my server. How can i solve this? Thanks,


Solution

  • Check if your server isn't a Linux machine, if it is a Linux machine you have to make all your URL's lowercase. Otherwise your Linux server won't find them.