Jump to content

NArc0t1c

Members
  • Posts

    299
  • Joined

  • Last visited

    Never

Posts posted by NArc0t1c

  1. Hello.

    I'm frustrated with something i am busy with.

     

    I have a menu, that is in a table and it must stay at the top, and not move, even when the page's length increases.

    Currently it is just moving to the middle(down).

     

     

    Hope can I lock it so it stays at the top?

    the rough code is almost like this:

    <table>
    <tr><td>
    <table>
    <tr><td>Link</th></tr>
    <tr><td>Link</th></tr>
    <tr><td>Link</th></tr>
    </table>
    </td></tr>
    <tr><td>
    <table>
    <tr><td>Contents</td></tr>
    </table>
    </td></tr>
    </table>

     

    Anyone know how I can do this, I have seen this before.

  2. try:

    <?
    include("db.php");
    ?>
    <?php
    // Turn off all error reporting
    error_reporting(0);  ?>
    <!-- Created on: 4/23/2007 -->
    <html>
    <body>
    Special Promotions<br>
    <br>
    <a href="display1.php?type=hotel">Hotel</a> | <a href="display1.php?type=conference">Conference</a> | <a href="display1.php?type=restaurant">Restaurant</a>
    <hr>
    </body>
    </html>	
    <?php
    $type = mysql_real_escape_string($_GET['type']);
    
      if (isset($_GET["type"])) {
    
    $result = mysql_query("SELECT * FROM specialoffer WHERE type='$type'") or die('Error: ' . mysql_error());
          if (mysql_num_rows($result) >= 1) {
            while($row = mysql_fetch_array($result)) {
              extract($row);
              echo '<br><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><strong>$title</strong></td>
    <td width="26%">Special type: <strong>$type</strong></td>
      </tr>
      <tr>
        <td><strong>Validity:</strong> Available from <strong>$fromz</strong> until 
          <strong>$toz</strong></td>
      </tr>
      <tr>
        <td>$description</td>
      </tr>
      <tr>
        <td>Contact <strong>$contactname</strong> on <strong>$contacttel</strong> or email us at <strong>$contactemail</strong></td>
      </tr>
    </table>
    ';
            }
          }
          else {
    	echo 'Watch this space for up and coming offers!';
    }
    
      } else {
        echo "Select one of the above options to see the relevant specials!";
      }
    
    ?>
    </body>
    </html>
    

  3. Any cookies set on the page before the if statement?

    and use post with the caps, easier to read..

            if($_POST['text1'] == '' || $_POST['func'] == '')
       {
          header("Location: generic_form.htm");
          exit;
       }

  4. Make a cookie on first visit, Because the client won't have teh cookie when they visit for the first time.

    The second time they come, they will have the cookie, thus they have been there before.

  5. Use post, and a form.

    <?php
    
    // The url.
    $url = 'http://www.something.com/something.php';
    
    //Posting data..
    if (isset($_POST['submit'])){
    if (empty($_POST['cid'])){
    $cid = ''; }
    else {
    $cid = '?id=' . $_POST['cid'];
    }
    // Get file's contents.
    $file = file_get_contents($url . $cid);
    echo $file;
    exit;
    }
    
    // The form.
    echo '
    <form action="something.php" method="post">
    <input type="text" name="cid">
    <input type="submit" name="submit" value="go">';
    ?>
    

  6. To connect to a database.

    mysql_connect('host','user','password') or die("Error: Connection Problem.");
    mysql_select_db('database');
    

     

    PHPMyAdmin in a pice of software developed in php that work's with mysql.

    Scripting is totally PHP.

    How it stores data has to do with MySQL.

    (come to think of it, I really do not know how PHPmyadmin stores the actual data.. Google..)

     

    I suggest getting WAMP., it has Apache, PHP, MySQL, SQL Lite, PHPMyAdmin.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.