Jump to content

chrisprse

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by chrisprse

  1. Hi, nl2br() should help you. For example, if you have a text area, when the form is submitted you will have something like: $_POST['textarea']; Simply use: echo nl2br($_POST['textarea']); This will change all new lines in the text area to line breaks: [CODE]<br />[/CODE] hth
  2. Hi, You can use stripslashes(). [URL=http://uk.php.net/stripslashes]http://uk.php.net/stripslashes[/URL] hth
  3. Check the image paths first of all... What does the source say?
  4. My first thought would be to delete what you have posted and try: [code=php:0] while($row = mysql_fetch_array($res)) { if($row['topic_title'] != $title) { echo $test_date; mysql_query("insert into `End_Review` (`id`,`topic_title`,`date`) values ('','$title','$test_date')"); } } [/code]
  5. [code=php:0] <?php $imageArr = array(); $imageArr[] = "pics/fish.jpg"; $imageArr[] = "pics/robo.jpg"; $randomImage = array_rand($imageArr); echo '<img alt="" src="'.$imageArr[$randomImage].'">'; ?> [/code] hth
  6. How about looking into mod rewrite... Example: [CODE] RewriteEngine On RewriteRule ^buying/cat/([0-9])$ buying.php?cat=$1 [/CODE] You will just need to change your links. For example, where you have: buying.php?cat=12, change this to: buying/cat/12 Place the above code in your .htaccess file When someone, or Google visits: http://www.domain.com/buying/cat/12, it will read the content as if it was buying.php?cat=12, however the URL stays as /buying/cat/12 which makes it more friendly to all
  7. On a side note, if you enter the following underneath the "$birthday_" variables: [code=php:0] if(($birthday_day == 29) && ($birthday_month == 2)) { $birthday_day = 28; } [/code] This will change their birthday day to 28th Feb as you will find many people born on 29th Feb will celebrate their birthday on 28th Feb... hth
  8. Edited to show next birthdays... It should work for leap years also, although I haven't tried. Let me know if it doesn't and I will have another look for you
  9. [code=php:0] <?php $birthday_day = 30; $birthday_month = 3; $birthday_year = 1983; $today_day = date("j"); $today_month = date("n"); $today_year = date("Y"); $next_year = date("Y") + 1; $age = $today_year - $birthday_year; if($today_month <= $birthday_month) { if($today_month == $birthday_month) { if($birthday_day > $today_day) { $age--; echo "Your next birthday is on ".$birthday_day." ".$birthday_month." ".$today_year.""; } else { echo "Your next birthday is on ".$birthday_day." ".$birthday_month." ".$next_year.""; } } else { echo "Your next birthday is on ".$birthday_day." ".$birthday_month." ".$today_year.""; } } else { echo "Your next birthday is on ".$birthday_day." ".$birthday_month." ".$next_year.""; } $age++; echo "You will be ".$age." on your next birthday..."; ?> [/code]
  10. Hi, I have a question, stupid really, but i read that you can change PHP, can you change it so the $header : FROM in the mail function cannot be used? Regards, Chris.
  11. Hi, I have brought a macromedia suite, which has flash MX, dreamweaver MX, fireworks MX. I notice all have MX on the end of the name. What is the difference between normal FLASH and FLASH MX? Is dreamweaver any better then Frontpage? Regards, Chris.
×
×
  • 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.