Jump to content

miocene

Members
  • Content Count

    81
  • Joined

  • Last visited

Community Reputation

0 Neutral

About miocene

  • Rank
    Newbie
  1. miocene

    Problem With Header

    Great, everything works now, thanks
  2. miocene

    Problem With Header

    But could you still answer this please:
  3. miocene

    Problem With Header

    Arrgh, sorry - a simple error I made earlier, corrected and it now works
  4. miocene

    Problem With Header

    Thanks ok I tried that but the image does not load...The code in my first post is captcha.php and here is part of my form in register.php:<tr><td>Please enter the following code into the box: <img src="captcha/captcha.php" alt="captcha"/></td><td><input name="code" type="text" /></td></tr> <tr><td colspan="2"><input name="Submit" type="submit" value="submit" /></td></tr> Also, does captcha.php place the $string in SESSION?
  5. miocene

    Problem With Header

    I'm trying to make a simple captcha for a registration form using php. I have seen many tutorials and have assembled some code to generate the image.Tutorials say I must use this code: header("Content-type: image/png"); However, I have a session_start(); at the top of the page and I get a php error saying headers already sent.Here is my captcha code so far: <?php$img = imagecreatetruecolor(80,30);$white = imagecolorallocate($img, 255, 255, 255);$black = imagecolorallocate($img, 0, 0, 0);$grey = imagecolorallocate($img,150,150,150);$red = imagecolorallocate($img, 255, 0, 0);$pink = imagecolorallocate($img, 200, 0, 150);function randomString($length){ $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $str = ""; $i = 0; while($i <= $length){ $num = rand() % 33; $tmp = substr($chars, $num, 1); $str = $str . $tmp; $i++; } return $str;}for($i=1;$i<=rand(1,5);$i++){ $color = (rand(1,2) == 1) ? $pink : $red; imageline($img,rand(5,70),rand(5,20), rand(5,70)+5,rand(5,20)+5, $color);}imagefill($img, 0, 0, $white);$string = randomString(rand(7,10));$_SESSION['code'] = $string;imagettftext($img, 11, 0, 10, 20, $black, "captcha/Corbel.ttf", $string);header("Content-type: image/png");imagepng($img);imagedestroy($img);?> How do I get the image to display on this page?
  6. One more little problem:for months, e.g Jan will return 1 not 01. How do I get it in form 01?
  7. OK so this keeps it so you can select a word for the month using the form, but $_POST['monthdropdown'] will be a number?
  8. I am using a dropdown date picker I obtained from here which uses javascript to generate the simple dropdown form.I would now like to insert the date chosen into my mysql database in the correct php date format.The month in the form is "jan, feb, mar" etc and obviously I need it in number form to work "01, 02, 03" etc.Then I guess I need it in the format 2010-06-28?How do I do this?Cheers for any replies
  9. I applied it to the whole <p> (which contained the image) but it didn't work...
  10. Sorry, moments after posting I think I figured it....I just put the pic and text in a tableStill... any suggestions on a better way
  11. Please see my site at cforcfoundation.org.In the footer, at the bottom-right, there is a link for the rss feed. Is there a way to get the text vertically aligned centrally with the rss icon?I have tried vertical-align: middle and various paddings etc but I can't get it to align.The image is an inline image rather than a css-called background image.any help appreciated
  12. OK I think what you said is true.I have an image fading script called simplegallery on all the pages. It uses jQuery. The slimbox script uses mootools.Whichever is loaded last in the page header works. I.E. if the simplegallery scripts are loaded before the slimbox scripts, only slimbox will work and not simplegallery. And vice versa.so is it because mootools and jquery cant be used on the same page?? Is there a way to get around this.Alternatively, I think the original lightbox 2 uses jquery so maybe that will work.
  13. yey, somehow I got it working... Just unistalled the plugin, deleted it and reinstalled it. Must have been corrupted or something the first time
×
×
  • Create New...