Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Very Quick PHP/ MySql problem

  • 26-02-2009 01:27PM
    #1
    Registered Users, Registered Users 2 Posts: 3,875 ✭✭✭


    Hi I am having trouble placing links within if loops,

    this is what I am trying

    <?php $coursename =$row_chosencourse ; ?>


    <?php if ($coursename == "course1") {

    echo "You selected course";
    echo "<a href="venuetables.php">link</a>" ;

    }?>

    can you tell me where I am going wrong?

    and how can I add it to send a parameter eg venuetables.php?student=<?php echo $row_chosenstudent; ?>

    thanks for any help!


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Look at your quotes in the link echo. You are using the same quote types internally and externally.


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    aidan_wals is right.
    should be
    [php]
    echo "<a href=\"venuetables.php\">link</a>" ; //backslash the "

    //or

    echo "<a href='venuetables.php'>link</a>" ; //use single quote
    [/php]


Advertisement