Jump to content

oracle259

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Posts posted by oracle259

  1. ok try this

    [code]
    $result = @mysql_query("SELECT * FROM t_50 ORDER BY name ASC");
      $adcount = 0;
    while ($row = mysql_fetch_assoc($result)) {
      $letter = strtoupper(substr($row['name'],0,1));
         
    if ($letter != $header) {
          print "<p/><b><u>";  echo  "<a href=#>$letter</a>"; print "</u></b></p>";
        }

    if ($adcount <4) {
        echo "<br/><a href=index.php?movie=".$row['id'].">".$row['name']."</a>";
      $adcount= $adcount+1;
    } else {
        echo "<br/><a href=index.php?movie=".$row['id'].">".$row['name']."</a>";
          echo "Display ad";
        $adcount = 0;
      }

      $header = $letter;

    }

    [/code]
  2. try this

    [code]
    $result = @mysql_query("SELECT * FROM t_50 ORDER BY name ASC");
      $adcount = 0;
    while ($row = mysql_fetch_assoc($result)) {
        if($letter != substr($row['name'],0,1)) {
          $letter= substr($row['name'],0,1);
    print "<p/><b>";  echo  "<a href=#>$letter</a>"; print "</b>";
        }
    else {

    if ($adcount >=4) {
        echo "<br/><a href=index.php?movie=".$row['id'].">".$row['name']."</a>";
          echo "Display ad";
        $adcount = 0;
    } else {
        echo "<br/><a href=index.php?movie=".$row['id'].">".$row['name']."</a>";
      $adcount= $adcount+1;
      }
    }
    }
    [/code]
  3. try this

    [code]
    <?php
    $ipaddy = $_SERVER['REMOTE_ADDR'];
    $ipaddy = str_replace(".","",$ipaddy);
    $query = "SELECT DISTINCT(ip) FROM ipbase WHERE ip=$ipaddy";
    $result = mysql_query($query) or die("mysql error: " . mysql_error());
    while ($line = mysql_fetch_assoc($result)) {
    $ipad = $line['ip'];
    if ( $ipad == $ipaddy ){
    echo "Welcome ".$ipaddy;
                } else {
                          echo "Welcome Guest";
    $query = "INSERT INTO `ipbase` (`ip`) VALUES('$ipaddy')";
    $result = mysql_query($query) or die(mysql_error());
    }
                         
    }
    mysql_free_result($result);
    ?>


    [/code]
  4. Without seeing more of ur code I think u should do the calculation outside of the link and echo the result in the link like this

    [code]

    $plus = $rec_Recordset1['id'] + 1;
    $minus = $rec_Recordset1['id'] - 1;




    <div align="center">

      <div id="image_navigation"> <a href="gallery.php?id=<?php echo        $minus; ?>"><img src="../images/previous.jpg" border="0" />[/url]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="gallery.php?id=<?php echo $plus; ?>"><img src="../images/next.jpg" border="0" />[/url]

      </div>

    </div>

    [/code]
  5. I think mjdamato has it right its much safer to store the user and password variables in a separate file eg. source.ini.php then upload this file outside of web browser path. When u need them just include the file. But i guess u can also combine what ur doing with this approach but i dont see what extra security values it provides...well maybe to someone who might not know what their looking at. Doubt it but stranger things have happened  ;)
  6. i think the last post should work but i would make the following modification

    [code]
    SELECT itemName,itemId,itemPrice,itemSmall
    FROM `products`
    WHERE itemDesc like "%$descvalue%"
    OR (itemName like "%$descvalue%"
    OR itemId like "%$descvalue%")

    [/code]
  7. This link [url=http://www.php.net/manual/en/reserved.variables.php]http://www.php.net/manual/en/reserved.variables.php[/url] can explain better i think. But basically it allows you to retrieve the variable $id whether using Post in the case of a form or Get in the case of a url like your doing
  8. if im right try this code

    [code]
    <?
    include 'config.php';
    include 'opendb.php';
    ?>
        <?

        $trackid= trim($_REQUEST(['id']);
          $trackid = mysql_real_escape_string($trackid);

    $query  = "SELECT title, category, salary, location FROM joborder WHERE number='$trackid'";
    $result = mysql_query($query);
    while(list($id,$title,$category,$salary,$location)= mysql_fetch_row($result))
    {
    echo "<a href="example.com?id='$id'"><b>$title</b></a>" . " - $category" . " , $location" . ", $salary";
    }
    ?>

    [/code]
  9. Im not certain if i understand exactly what ur tryin to do but here goes

    Basically u want the rows generated by the mysql result to be clickable by headers (title, id, description, salary, location, etc) and all these headers must point to the single id whatever that is

    Am i on the right track
×
×
  • 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.