Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. ok, i tried this <?php $i = 0; while (mysql_num_rows($result) > 0) { if ($i == 4) { $i = 0; // reset variable echo "<BR>"; // break the line } echo "<b>".$row['img_time']."</b>"; ?> - <a href="?image_id=<?php echo $row['image_id']; ?>"><?php echo $row['image_name']; ?></a><br><?php echo nl2br(stripslashes($cont));; ?><br><br> <?php $i++; // increase $i each time through the loop } ?> and this doesn't show my results, and also keeps loading, i have had to stop the script twice as it crashed my browser. this is the code surrounding it <?php $query = "SELECT image_id, image_name, image_link, folder_name,img_time FROM `darkflame_gallery`"; $result = mysql_query($query) or die("Error:" . mysql_error()); $i = 0; while (mysql_num_rows($result) > 0) { if ($i == 4) { $i = 0; // reset variable echo "<BR>"; // break the line } echo "<b>".$row['img_time']."</b>"; ?> - <a href="?image_id=<?php echo $row['image_id']; ?>"><?php echo $row['image_name']; ?></a><br><?php echo nl2br(stripslashes($cont));; ?><br><br> <?php $i++; // increase $i each time through the loop } ?>
  2. ok, slightly lost on how to do it, but if i do that how will it know when to start a new line? someone gave me this code, but i can't get it to work properly now <?php $query = "SELECT image_id, image_name, image_link, folder_name,img_time FROM `darkflame_gallery`"; $result = mysql_query($query) or die("Error:" . mysql_error()); if (mysql_num_rows($result) > 0) { ?> <table border="1"> <?php $loop = 4; $loop1 = 4; while($row=mysql_fetch_array($result)){ // Start looping table row if ($loop == 4) { echo "<tr>"; } $toecho1 .= '<td><a href="?image_id='.$row['image_id'].'">Details</a></td><td> </td>'; $toecho .= '<td><a href="'.$row['image_link'].'" rel="lightbox [main]" title="'.$row['image_caption']. '" ><img src="'.$row['image_link'].'"width="150px" /></a></td><td> </td>'; if ($loop == 4) { echo "</tr>"; $loop=0; } } if (substr($toecho, -5) != "</tr>") { $toecho .= "</tr>"; } echo $toecho; echo $toecho1; } ?> </table> <?php if (mysql_num_rows($result) < 1) { echo "No Images To Display"; } ?>
  3. How can i put a < br > after every 4 amount of entry's What i need is to start a new line every after four entry's are echoed, this is my code <?php $query = "SELECT image_id, image_name, image_link, folder_name,img_time FROM `darkflame_gallery`"; $result = mysql_query($query) or die("Error:" . mysql_error()); if (mysql_num_rows($result) > 0) { echo "<table class='news'><tr><th>Image Gallery</th></tr><tr><td id='new'><br><br />"; while ($row = mysql_fetch_assoc($result)) { echo "<b>".$row['img_time']."</b>"; ?> - <a href="?image_id=<?php echo $row['image_id']; ?>"><?php echo $row['image_name']; ?></a><br><?php echo nl2br(stripslashes($cont));; ?><br><br> <?php } } ?>
  4. yep., here u go <?php $catOption=$object->allowed_user_category($_SESSION["my_adminid"]); if($catOption==0){ $rs=mysql_query("select * FROM tbl_category "); while($row=mysql_fetch_array($rs)){ if($row["cat_ID"]==$rowListing["cat_ID"]) { echo $row["cat_descp"]; } } } else{ } ?>
  5. this works for me, although i only have the first line with stuff in
  6. sorry missed a bit <?php $catOption=$object->allowed_user_category($_SESSION["my_adminid"]); if($catOption==0){ $rs=mysql_query("select * FROM tbl_category "); while($row=mysql_fetch_array($rs)){ echo $row["cat_ID"]; if($row["cat_ID"]==$rowListing["cat_ID"]) { echo "selected"; echo $row["cat_descp"]; } } } else{ ?> <?php } ?>
  7. i think this is what you want Change some parts of it for your needs <?php $loop = 3; $loop1 = 3; while($row=mysql_fetch_array($result)){ // Start looping table row if ($loop == 3) { echo "<tr>"; } $toecho1 .= '<td><a href="?image_id='.$row['image_id'].'">Details</a></td><td> </td>'; $toecho .= '<td><a href="'.$row['image_link'].'" rel="lightbox [main]" title="'.$row['image_caption']. '" ><img src="'.$row['image_link'].'"width="150px" /></a></td><td> </td>'; if ($loop == 3) { echo "</tr>"; $loop=0; } } if (substr($toecho, -5) != "</tr>") { $toecho .= "</tr>"; } echo $toecho; echo $toecho1; } ?>
  8. header's have to be sent before any HTML, and if it is a 404 error, then the filename you are looking for is either wrong or not there. Check whether it is in the same folder.
  9. ok, thanks guys, u solved it
  10. if i am right it should be this to do it <?php $catOption=$object->allowed_user_category($_SESSION["my_adminid"]); if($catOption==0){ ?> <select id="catID" name="catID"> <option value="" SELECTED>Please Choose............</option> <?php $rs=mysql_query("select * FROM tbl_category "); while($row=mysql_fetch_array($rs)){ ?> <?php echo $row["cat_ID"]; if($row["cat_ID"]==$rowListing["cat_ID"]) { echo "selected"; echo $row["cat_descp"]; } } } else{ ?> <?php } ?>
  11. why does this work <?php if(isset($_GET['image_catergory'])== "add") { ?> the link for it is http://darkflame.awardspace.com/admin_area.php?image_catergory=add but it shows when i have http://darkflame.awardspace.com/admin_area.php?image_catergory BTW there is more code than that , but i just thought that you only need to see this bit. Thanks, Blade
  12. if all the data in ure table is PHP then no, as it will be blank
  13. i don't think anyone will write it for you, but they may give advice. You might want to search google, or ask in the freelance forum
  14. <?php echo $cohyp; ?>
  15. if they have id's just ORDER BY that
  16. as i said use a auto_increment field in a table, then just insert a blank entry into the database when the script is run
  17. session_start(); this needs to be on the first line of the script on every page
  18. auto_increment in the mysql table
  19. we won't write it for you , but my advice would be to store it in the database, and then retrieve it, or if it's just for the page, for the time there on, i would just store it in a variable like $textarea = $_POST['textarea_name'];
  20. you need to post a vairable like $_POST['$posting']; $posting = "hello"; if that doesn't do it , use a hidden form
  21. why not just check for a session(); on the page, and then the back button won't matter?
  22. we help with codes here, PHP codes, the form you are looking for is JS
  23. no you can't decode once encoded, you can just use md5(); or search google, for free php encoder
  24. none of this is in <?php tags ?></div></td></tr><?php echo "<tr><td><strong>Last name:</strong></td> <td>" . $row['LastName'] . "</td> <td><input name='LastName' type='text' id='LastName'/></td></tr>"; echo "<tr><td><strong>Company name:</strong></td> <td>" . $row['CompanyName'] . "</td> <td><input name='CompanyName' type='text' id='CompanyName'/></td></tr>"; echo "<tr><td><strong>Contact Title:</strong></td> <td>" . $row['ContactTitle'] . "</td> <td><input name='ContactTitle' type='text' id='ContactTitle'/></td></tr>"; echo "<tr><td><strong>Address:</strong></td> <td>" . $row['Address'] . "</td> <td><input name='Address' type='text' id='Address'/></td></tr>"; echo "<tr><td><strong>City:</strong></td> <td>" . $row['City'] . "</td> <td><input name='City' type='text' id='City'/></td></tr>"; echo "<tr><td><strong>State:</strong></td> <td>" . $row['State'] . "</td> <td><input name='State' type='text' id='State'/></td></tr>"; echo "<tr><td><strong>Zip code:</strong></td> <td>" . $row['ZipCode'] . "</td> <td><input name='ZipCode' type='text' id='ZipCode'/></td></tr>"; echo "<tr><td><strong>Home phone:</strong></td> <td>" . $row['HomePhone'] . "</td> <td><input name='HomePhone' type='text' id='HomePhone'/></td></tr>"; echo "<tr><td><strong>Work phone:</strong></td> <td>" . $row['WorkPhone'] . "</td> <td><input name='WorkPhone' type='text' id='WorkPhone'/></td></tr>"; echo "<tr><td><strong>Extension:</strong></td> <td>" . $row['WorkPhoneExtension'] . "</td> <td><input name='WorkPhoneExtension' type='text' id='WorkPhoneExtension'/></td></tr>"; echo "<tr><td><strong>Fax phone:</strong></td> <td>" . $row['FaxPhone'] . "</td> <td><input name='FaxPhone' type='text' id='FaxPhone'/></td></tr>"; echo "<tr><td><strong>Email:</strong></td> <td>" . $row['Email'] . "</td> <td><input name='Email' type='text' id='Email'/></td></tr>"; echo "<tr><td colspan='4'><div align='center'><input name='editclient' type='submit' id='editclient' value='Store new client data' /></div></td></tr>"; } echo "</table></form>"; include 'closedb.php'; ?> </body> </html>
×
×
  • 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.