Link to home
Start Free TrialLog in
Avatar of Peter Kroman
Peter KromanFlag for Denmark

asked on

Undefined property error

Hi,

I have this page:
https://kroweb.dk/gfdev/arkivalier/canvas3/sognefakta_ByLand2.php?sogn=+Knudsker&amt=Bornholm
which I am working on at the moment.

This is about the first column of the page - the one to the left.
I am working on establishing a link attatched to the first column of the table - the one with the head 'Sogn'.
This link should do the following:
1. Attatch some values to the form at the top of the page
2. Open a new file and append these values to the link that is fired

To do that I have defined (what I believe is) the proper variables in my classes.php file, like this:
class KbSogn
{
    public $link;
    public $narrowlink;
    public $amt;


    function __construct()
    {
         $this->link = sprintf("<a href='%s' target='_blank'>%s</a>", $this->URL, $this->Kirkebog);
         
         $this->narrowlink = sprintf("<a href='%s' target='_blank'>%s</a>", $this->URL2narrow, $this->Sogn); 
                 
         $this->amt = $this->Amt;

    }
}

Open in new window


And in my kb_table.php file I am trying to present the table like this:

<table id="KbTable" class="table">

        <thead>
            <tr>
                <th>Sogn</th>
                <th>Amt</th>
                <th>Kirkebog</th>             
            </tr>
        </thead>

        <?php foreach ($data as $record): ?>

            <tr>
                <td><?php echo $record->narrowlink ?></td>
                <td><?php echo $record->amt ?></td>        
                <td><?php echo $record->link ?></td> 
                
            </tr>

        <?php endforeach; ?>

    </table>

Open in new window


I also have defined the column URL2narrow in the database (holding the name of the file that should be opened), and I am selecting it in the SQL query along with the other needed columns.

Well - I have managed to establish the link, and when clicking the link the form is filed correctly, and a page with the values of the form appended is opened.

BUT - I get this Undefined property error referring to the classes.php file in and the name of the column holding the file i need the link to open (URL2narrow), and where line 108 in this file is equal to line 12 in the code from classes.php above.

So the link is opening a wrong file - in fact a file with the same filename as the one we are comming from. But the right vaues are appended to it.

I have tried everything I can think of trying to fix this. The console gives no messages, and there don't seem to be any HTML errors in the code.

I'm sure that when this error is fixed, everthing will work as it is supposed to work.

 If someone can give me the right guidance to fix this, I would be a very happy man :)
ASKER CERTIFIED SOLUTION
Avatar of Peter Kroman
Peter Kroman
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Kroman

ASKER

Closed