Popups

Discussion in 'HTML & Website Design' started by chillinhh, Dec 23, 2006.

  1. #1
    I'm trying to add an onclick popup to my site.

    The problem is most popup generators on the net tell you to put code in the head of the popup page, but i'm using a php file...

    How would i do this with php?
     
    chillinhh, Dec 23, 2006 IP
  2. SamOwen

    SamOwen Peon

    Messages:
    865
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can add HTML to PHP files.
     
    SamOwen, Dec 23, 2006 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You would put the code inside the <head> and </head> tags on your page.

    If the HTML code is being generated by PHP, then you will either have to exit out of PHP or echo the script so that it is also generated by the parser before being sent to the browser.
     
    Dan Schulz, Dec 24, 2006 IP
  4. vanductai

    vanductai Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Put the code out of <?php ?> tag, it will work well as html file :) good luck
     
    vanductai, Dec 24, 2006 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    vanductai, it depends on how the PHP script is structured in the first place. If everything is being output by PHP (rather than just the dynamic parts being "inlined") then that would be one way to do it. Another being to just echo the code so it's generated as well.

    If it's inline, then it might not even be necessary and can be added normally.
     
    Dan Schulz, Dec 24, 2006 IP
  6. chillinhh

    chillinhh Banned

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm Sorry but you just went over my head.
    Could you give me of an example popup script that would work fine outside of the <?php ?> tags? I have no <head>.
     
    chillinhh, Dec 24, 2006 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Can you copy/paste the PHP file (the source code) you have here so I can take a look at it?
     
    Dan Schulz, Dec 24, 2006 IP
  8. chillinhh

    chillinhh Banned

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <?php
    data here
    ?>
    
    
    <?php
    
    data here
    ?>
    
    <style type="text/css">
    <!--
    a:link {
    	text-decoration: none;
    }
    a:visited {
    	text-decoration: none;
    }
    a:hover {
    	text-decoration: none;
    }
    a:active {
    	text-decoration: none;
    }
    -->
    </style>
    
    
    
    <div align="right"><a href="?action=logout">Log Out</a> </div>
    <br>
    
    <center>
    
    <table width="510" height="35" border="1">
      <tr>
        <th width="115" scope="col">1</th>
        <th width="128" scope="col">2</th>
        <th width="92" scope="col">3</th>
        <th width="46" scope="col">4</th>
        <th width="95" scope="col">5</th>
      </tr>
    </table>
    
    
    <table width="510" border="1">
    <tr border="0"><th width="37" scope = "col"></th><th width="155" scope="col"></th><th width="92" scope="col"></th><th width="45" scope="col"></th><th width="94" scope="col"></th></tr>
    
    <?php
    
    data here
    
    ?>
    
    </table>
    </center>
    Code (markup):
     
    chillinhh, Dec 24, 2006 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ok, you can just add it normally (as you would with a normal HTML file) right after the STYLE element (<style></style> tags).
     
    Dan Schulz, Dec 24, 2006 IP