Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. That wouldn't be true unless you were running the code thats in the head with a onload event attached to the body. It IS completely loaded when the head is read, and that loads before your page. So you don't want to execute it until the body is loaded.
  2. I see you are using short tags (<?). Try turning them into real php tags (<?php). Maybe your new host doesn't accept short tags. Always code with real tags
  3. Should this: $this->ratings[$rrow['rating']] be this: $this->ratings($rrow['rating']) ??
  4. OK, Im on my way out for a meeting with a client. Ill try to look later if you haven't figured it out.
  5. well, your original $bolded_ids array does not contain 122, 123, 124 or 125, so they would not get affected...
  6. Immediately after this line: <?php $category = $catalog->getCategoryInfo($core->pageVar('catID', siteCore::VARTYPE_INT)); Add: <?php echo "<pre>"; print_r($category); echo "</pre>"; what does it show?
  7. Your bumping 5 mins after your original post?
  8. That is really vague. Please expand on what you are trying to do...
  9. Hello again, I recognize that code Font tags should not be used because they have been deprecated a long time ago. See http://www.w3.org/TR/html401/present/graphics.html section 15.2.2. Try using a span with a class name and use css. Its best to put the stylesheet in its own file. Also, it is a good idea to avoid color names like 'red'. Actually define them, #FF0000. Different browsers interpret color names differently. <head> <style ="text/css"> .redFont { color:#FF0000; } </style> </head> ... <span class="redFont">$subcatName</span>
  10. You can use my above example to accomplish what you need.
  11. Maybe this is closer to what you want...I removed a bunch of formatting as it was getting in my way, you can add it back as you need. In your while loop you started and ended your table, so there were many tables created. Then you had a table within a table. I removed one of them. Now you have 3 columns. 1) $row['Image'] 2) $row['Description'] 3) If there is a link print it, if not print a space (td's don't like to be empty, so put a space in there) oh, and always use full php tags, not <? short tags. <?php //select the table $result = mysql_query("select * from properties where Sale like '%yes%'"); echo '<table width="200" align="center" class="sample">'; //grab all the content while($row=mysql_fetch_assoc($result)) { ?> <tr> <td><img src="<?php echo $row['Image']; ?>" /><br><span><?php echo $row['hi_lite']; ?></span></td> <td><span><?php echo $row['Description']; ?></span></td> <td width="200" align="center" valign="middle" class="style3"> <?php if( $row['Web'] != "") { echo '<a href="'.$row['Web'].'" target="_self">click here</a>'; } else { echo " "; } ?> </td> </tr> <?php } // End While statement echo '</table>'; // Close database connection. //mysql_close(); ?>
  12. extra semicolon echo '<script language="javascript">confirm("Must be numbers only!")</script>;'; }
  13. Don't know if this has anything to do with it, but you have 2 anchor tags that you don't close.
  14. Did you restart Apache after altering the httpd.conf? No you don't need both, you should just use php5.
  15. Maybe submit a sitemap through googles webmaster tools? I have the opposite problem. I run a site that is a forum and google/msn/yahoo are on there 24/7, most of the time there is more than one bot on at a time from the same company. I receive over 1000 unique visitors/day. I'm sure phpfreaks has a similar problem. They sure take a lot of bandwidth...
  16. No problem and good luck. Its not that hard once you get some concepts down.
  17. while($data = mysql_fetch_assoc($mquery){ should be while($data = mysql_fetch_assoc($mquery)){
  18. My bad, I made an error... <?php ini_set('display_errors', 1); error_reporting(E_ALL); $query ="SELECT * FROM `news` ORDER BY `date` DESC LIMIT 5"; $mquery = mysql_query($query) or die(mysql_error()); //added this to see if problem with query $num = mysql_num_rows($mquery) or die(mysql_error()); //this tells you how many rows from your database were returned, not the actual data ?> <table width="10" border="1" cellspacing="0" cellpadding="0"> <tr> <th scope="row">Author Name</th> </tr> <tr> <th scope="row">Date</th> </tr> <tr> <th scope="row">Topic</th> </tr> <tr> <th scope="row">Articale</th> </tr> <?php if($num>0){ while($data = mysql_fetch_assoc($mquery){ //this was changed echo "<tr bgcolor=#EEEEEE>\n"; echo "<td>{$data["authorname"]}</td>\n"; echo "<td>{$data["date"]}</td>\n"; echo "<td>{$data["newstitle"]}</td>\n"; echo "<td>{$data["news"]}</td>\n"; echo "</tr>\n"; } } ?> </table>
  19. change: $query = "SELECT * FROM `news` WHERE newstitle = '$newstitle'"; to: $query ="SELECT * FROM `news` ORDER BY `date` DESC LIMIT 5";
  20. @holics: foreach($mquery as $data){ topflight: do you have a date or timestamp column in your database so you can tell which the last 5 added were?
  21. So you want to list all articles from the database and not one with a specific title?
  22. How do I know what you are looking for? How are you using this? Is there a form or something where you select the newstitle that you are searching for?
  23. its because of this line: $query = "SELECT * FROM `news` WHERE newstitle = '$newstitle'"; You use a variable called $newstitle, but it is not defined in the code that you posted.
×
×
  • 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.