My links and addressing does not work any more

Hi,
I have a funny thing which is not so funny:

I have a HTML with a ref. like
<a href="index.php"><img src="/Buttons/Home.png" width="100" height="40" title="Home"</a>
Everything here is on localhost, but the same error happens on the server, I get:
http://localhost/messageboard.php/index.php
I have done this hundred times before, but years ago, start over. And it changed…
Any ideas?
Thanks in advance.
Dag JNJ

Welcome to the Forums, @webdesign23

I’m not sure if we’re seeing the whole picture of what you’re posting, because the forum seems to be chewing up your post.

Try wrapping your code sections in triple backticks:

```
Code Goes Here
```

so that the forum’s engine doesnt try and process it, and we can see what you’re working with :slight_smile:

Thanks
But I have not much more. Try to explain:

    <a href="index.php"><img src="/Buttons/Home.png" width="100" height="40" 
title="Home"</a>

(This is on localhost, but the same happens on the server).
It does not call the index.php
I get then in the address-line of the browser:

http://localhost/messageboard.php/index.php

I have done this hundred times before, but years ago, start over. And it changed…
webdesign23

That… would be exceedingly odd. Is the server version available online for us to view?

I logged in so I got to the messageboard.

https://bahia-dorada.es/messageboard.php/

It’s weird with the graphic to, it is under /Buttons/uc3.png, but look at the graphic address: Under construction.
Try to hit the Home button.

https://bahia-dorada.es/messageboard.php/

You sure that’s your URL? Have you named a directory “messageboard.php”?

If so, then your link is doing exactly what you told it to do.

“index.php” means “stay in the current directory, and go to index.php”
“/index.php” means “go to the root of the server, and then go to index.php”

No(of course) I have no directory named messageboard.php.
But following: I redirected to the page messageboard.php in a PHP called sendlogin.phph with header. Like this:

$urll=substr($_SERVER["REMOTE_ADDR"],0,3);
$url="https://bahia-dorada.es/messageboard";
if ($urll=="127"){
    $url="localhost/messageboard.php";
}
header("Location: http://$url/messageboard.php");

It seems to have something to do with that, beacae on the previous page:

http://localhost/members.php

the link Home works

If the following link to an image is what you want then there is a missing leading slash in the URL"

Oh yes, thank you. Emarrassing…

1 Like

This now works localhost.
Seems I have to look what happens on the server, have a problem with header already sent.

Now I have a problem with something that just worked, sending username and pwd.

<form action="loginsend.php" method="post">
  <label for="uname">Usuario/Username:
    <input id="uname" name="uname">
  </label>

  <label for="pwd">Clave/Password:
    <input id="pwd" name="pwd">
  </label>
  <br>
  <input type="submit" value="send">
</form>

And in the receving php I have

    $uname="";
    $pwd="";
   if(isset($_REQUEST['uname']))
    {
        $uname = $_REQUEST['uname'];
    } 
    if(isset($_REQUEST['pwd']))
    {
        $pwd = $_REQUEST['pwd'];
    }
if ($uname=="" || $pwd==""){
      echo "Fehler";
 }

which (of course because of the output “Fehler” leads to

Fehler
Warning: Cannot modify header information - headers already sent by (output started at /home/www/webp/loginsend.php:9) in /home/www/webp/loginsend.php on line 26

The problem is, the uname and pwd is not chatched by the session, and I can*t see why

I solved It. Only some misunderstandings between POST and SESSION. Using

$_SESSION['uname'] = $uname;

in the calling PHP and

$uname = $_SESSION['uname'];

in the receiving PHP does the work.

 <?php
    session_start();
?> 

at the beginning of the page of the page is MUST

I just want to thank the two of you who helped me

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.