refiking Posted January 3, 2008 Share Posted January 3, 2008 How can I make the borrower's name a link? The section that is the borrower's name is this: <tr><td>{$row[bln]}, {$row[bfn]}</a></td> Here is the code: echo "<a href="$loan_id.".php""<tr><td>{$row[bln]}, {$row[bfn]}</a></td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td>{$row[status]}</td></tr>"; Here is what is returned when I run the script: Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /home/public_html/test/test.php on line 10 Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/ Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 <?php echo "<a href=$loan_id.php<tr><td>{$row[bln]}, {$row[bfn]}</a></td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td>{$row[status]}</td></tr>"; ?> Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429741 Share on other sites More sharing options...
papaface Posted January 3, 2008 Share Posted January 3, 2008 Try: ?> <a href="<?= $loan_id;?>.php"><tr><td><?= $row[bln];?>,<?= $row[bfn]; ?></a></td><td><?= $row[cln];?>, <?= $row[cfn]; ?></td><td><?= $row[loan_id]; ?></td><td><?= $row[status]; ?></td></tr> <?php I prefer to do it like that personally. Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429744 Share on other sites More sharing options...
redarrow Posted January 3, 2008 Share Posted January 3, 2008 papface does the code look correct to u have a look at the arrays there self $row['what_ever'] Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429748 Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 Short tags will bite you sooner or later. Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429749 Share on other sites More sharing options...
duclet Posted January 3, 2008 Share Posted January 3, 2008 Here you go: echo "<tr><td><a href='$loan_id.php'>{$row[bln]}, {$row[bfn]}</a></td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td>{$row[status]}</td></tr>"; Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429787 Share on other sites More sharing options...
papaface Posted January 3, 2008 Share Posted January 3, 2008 papface does the code look correct to u have a look at the arrays there self $row['what_ever'] Not sure what you mean to be honest?? Short tags will bite you sooner or later. Yeah don't usually use them in my coding. This is what I usually do because I find it easier to see the PHP parts and HTML parts this way. I have edited the code: ?> <a href="<?php echo $loan_id;?>.php"><tr><td><?php echo $row['bln'];?>,<?php echo $row['bfn']; ?></a></td><td><?php echo $row['cln'];?>, <?php echo $row['cfn']; ?></td><td><?php echo $row['loan_id']; ?></td><td><?php echo $row['status']; ?></td></tr> <?php Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429789 Share on other sites More sharing options...
refiking Posted January 4, 2008 Author Share Posted January 4, 2008 OK, so here is the current code as it is. echo "<tr><td><a href='borrower.php?loan_id=$loan_id'>{$row[bln]}, {$row[bfn]}</a></td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td>{$row[status]}</td></tr>"; The links show up on each one, but it doesn't show the $loan_id in the address. For example, when I click on the first link, here is where it tries to take me to: www.mydomain.com/test/borrower.php?loan_id= How can I get it to actually insert that loan_id for that entry? Link to comment https://forums.phpfreaks.com/topic/84374-solved-create-link/#findComment-429874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.