Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. <?php ini_set('display_errors', 1); error_reporting(E_ALL); $query = "SELECT * FROM `news` WHERE newstitle = '$newstitle'"; $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 foreach($mquery as $data){ //this will loop through your row data returned from the db 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>
  2. You would put the $bolded_ids=array(23,434,24); just ABOVE your very first if statement <?php $bolded_ids=array(23,434,24); if(count($brands)>0) // ... then replace the line you provided with this: <?php //line to remove $page['content'] .= "<li><a href=\"brand.php?bID=$bId\">$bName</a></li>\n"; //replace with $bold_value = in_array($bId, $bolded_ids) ? "<strong>$bName</strong>" : $bName; $page['content'] .= "<li><a href=\"brand.php?bID=$bId\">$bold_value</a></li>\n";
  3. Well, if this information is coming from a database, I would add and extra field called bold or something and set it to 0 or 1 for fields that need to be bolded. That would be the best way. If not, you could do something like: <?php $bolded_ids=array(95, 23, 102); //your ids.... //then in your loop where you want it to be bolded if(in_array($id, $bolded_ids)) { $link="<strong>" . $text . "</strong>"; } else { $link = $text; } I didn't use your variable names, but I think you can see whats going on.
  4. How do you know which IDs need to be bolded? Is there a way to figure that out programatically or is it just something that YOU know?
  5. First you said links, now you say fields. Which is it and if its fields, define what that means please. <strong>my text</strong> will be bolded.
  6. Someone might have a better answer, but to get it to load a php page I think you might just have to include it and not use a link. <?php include("/css/style.php"); Then at the top of your style.php you would have to insert the <style type="text/css"> ... </style> The problem with this is that your css will never get cached by the browser and it will need to be loaded every time. Side note: You actually test using IE5? I don't even test for IE6 anymore unless the client demands it, then I charge a little extra for it due to the extra crap that needs to be added because its an 'outdated' browser.
  7. You can either add a class to the anchor and then use css to style that class, or use <strong></strong> tags instead of the <h3> tags.
  8. Are we supposed to just guess or are you going to post some code to look at?
  9. Yes, it was a televised debate between the two presidential candidates. The blind leading the blind...
  10. One of the best (and hardest) things to do with seo is to have other high ranking sites have a link back to your site.
  11. Of course sessions can be used without a login. As far as my serialize comment, I wasn't suggesting you store the data permanently that way. Just from form page to form page and then on your final page, retrieve the data, unserialize it, sanitize it, do error checking and store the final results in your database however you would like.
  12. I agree, its too thin...not many people use 640x480 resolution anymore In your 'a bit about me' section, the first 3 sentences contain the word 'interest'. You might consider synonyms there. In the very last sentence on the page, practices is misspelled. Other than those simple things, I like the minimalistic approach you are taking and the colors are good and complement each other well.
  13. You could always serialize($_POST), store it in the database and on your final page retrieve it and unserialize() it. This would be so much easier if you could use sessions....whats your clients problem with sessions?
  14. CroNiX

    Wordwrap help

    Since I see you are using some php in there... http://uk.php.net/wordwrap
  15. I believe that you can disable a lot of those options in the editors that you mentioned.
  16. thorp gets an "A" for doing your homework for you LOL. Be sure to credit PHPFreaks when you turn that in...wouldn't want to be plagiarizing now would we?
  17. My settings for a vhost: <VirtualHost *> DocumentRoot /Apache/htdocs/CI163/ ErrorLog /Apache/htdocs/CI163/error_log ServerName ci.localhost ServerAlias ci ServerAdmin blah@myblah.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> </VirtualHost> this lets me access (my codeignitor site) using "ci.localhost". Not sure if you need VirtualDocumentRoot.... I just use DocumentRoot as you can see.
  18. I should have looked more closely.... This line: <?php $contacts=array("name"=>"john","name"=>"sam","email"=>"john@lucky.co.uk","email"=>"sam@lucky.com"); is wrong. You have 2 keys with the same index name, 'name' and 'email'. If you are wanting that to be 2 different people you should do something like: <?php $contacts=array(); $contacts[0]=array("name"=>"John", "email"=>"john@lucky.co.uk"); $contacts[1]=array("name"=>"Sam", "email"=>"sam@lucky.com"); It should work with your original code, my first correction and this one. then $contacts[1]["name"] will be "Sam" and so on
  19. You just mixed up your arrays.... instead of: $contacts['name'][$i] it should be: $contacts[$i]['name'] for all of the array elements.
  20. Ah, can even make it shorter then.... <?php echo date("l F Y h:i:s A") . "<br />"; $d=strtolower(date("l")); //make day of week all lower case $h=date("h"); $m=date("i"); $a=date("A"); if($h<="10" && $m<="00" && $a=="PM") include($d . "-inc.php"); }
  21. I usually do: <?php $cat = isset($_GET['cat']) ? $_GET['cat'] : ""; It looks strange, but it says, if $_GET['cat'] is set, then $cat = $_GET['cat'], if not $cat = "" if you want $cat to have a default value, then change "" to your default value. As far as your query, $sql = "SELECT * FROM `contents` where `cat`='$cat' ORDER BY `id` DESC"; should be fine. I would use the error handling as posted by Bendude as well. It will show you what is wrong, if anything, in your query.
  22. I forgot a { after $d=="Friday")
  23. Not dealing with your issue, but a way to shorten your code a bit.... You also forgot to use == in your $a="PM" <?php echo date("l F Y h:i:s A") . "<br />"; $d=date("l"); //changed this to use full weekday name $h=date("h"); $m=date("i"); $a=date("A"); if($d != 'Thursday' && $d !='Friday') { echo "Have a nice $d!"; } elseif($h<="10" && $m<="00" && $a=="PM" && $d=="Thursday") { include('thursday-inc.php'); } elseif ($h<="10" && $m<="00" && $a=="PM" && $d=="Friday") include('friday-inc.php'); }
  24. I suppose if you have really skinny lady thumbs it would work ok The Tilt was $200 less than the (initial) iphone and had about 2x as many features. Like real keypad, built in gps, voice commands and the most important one (to me)...being able to hook an external device to it to access the net. Tilt runs windows mobile and is touch screen too. And AT&T doesn't know whats on my phone at any given time like Apple does. Oh, and the millions of hacked roms are cool too
×
×
  • 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.