Javascript link to plain html..please help!

Discussion in 'JavaScript' started by netpox, Nov 27, 2007.

  1. #1
    Can someone make tell me how i would make this into a regular link that is not javascript. I want it to be a plain link, linking to the URL given. No popups, open as a full webpage.

    Thanks
     
    netpox, Nov 27, 2007 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <a href="template.php?idt=123" class="mypyx">
    HTML:
    change the idt value to the id of the template you wanna show
     
    selling vcc, Nov 27, 2007 IP
  3. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #3
    i can't enter the number it has to pull it from the database, so i need to use the variables in the script.
     
    netpox, Nov 27, 2007 IP
  4. James McMurray

    James McMurray Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <a href="template.php?idt=<? echo $row1['nIdTempl'] ?> class="mypyx">
     
    James McMurray, Nov 27, 2007 IP
  5. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <a href="template.php?idt=<?php echo $row1['nIdTempl']; ?>" class="mypyx">
    PHP:
    Please do not use the <? tag and always use <?php... or <script language="php">... this will work no matter what is the server configuration
     
    selling vcc, Nov 27, 2007 IP
  6. KatieK

    KatieK Active Member

    Messages:
    116
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Here's a way to keep using the PHP variable inside an HTML link.

    
    <a href='/template.php?idt=$row1["nIdTempl"]' class='mypyx'>
    
    Code (markup):
    Be careful of the quotes when you put it in PHP.

    Is this what you needed? You'll need something to generate the variable, be it PHP or Script. HTML couldn't generate the variables all by itself, since it's only a markup language.
     
    KatieK, Nov 27, 2007 IP
  7. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This doesn't look like PHP !!!
     
    selling vcc, Nov 27, 2007 IP
  8. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #8
    Thanks guys i will try it and see if it works!
     
    netpox, Nov 27, 2007 IP