Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by HuggieBear

  1. Ideally the code you're using to generate the breadcrumb.  Then we can point you in the right direction. Rich
  2. Anything's possible  ;) It sounds as though you could stick the if statement in there without much trouble.  Obviously it depends on how you're generating the breadcrumb in the first place, but yeah, should be easy enough. Rich
  3. Bad news is I've tried this code and it works fine, as expected. So maybe your problem is with the PHP/Sendmail setup somewhere.  Do you know enough about sendmail to send yourself a test using sendmail to check that it's working? Rich
  4. I can't show you as I'm not certain what you're trying to achieve, but I do know that putting two pieces of data in the same column, just concatenated, is a bad idea. Rich
  5. The mail() function within PHP relies on the PHP install knowing where sendmail is on your system at compile time. If you use phpinfo() to get information about your install and then look for the values [b]sendmail_from[/b] and [b]sendmail_path[/b] under the 'PHP Core' information. If these values are propgated then you're off to a good start. Regards Rich
  6. Your website_hits_id column is a bad idea, having two pieces of data in one field... Why not just add an additional column, to make the relationships between the tables better? That's just my opinion anyway. As it is, you'll have to manipulate the data in that column, whether it be in the select statement, or in PHP once you have your recordset. Regards Rich
  7. Rather that try and stick sql code into a javascript function you're probably better getting the onBlur() event to just submit the form at the early stage and use the php code that it's calling to verify the data/query the database. It's likely to be easier that way around. Regards Rich
  8. [quote] I guess you need some JavaScript [/quote] I you could use onBlur() to sumbit the form.  Here's an example of onBlur() in action: [url=http://www.webreference.com/js/tips/000804.html]http://www.webreference.com/js/tips/000804.html[/url] Regards Rich
  9. If you have PHP with installed, you'l need to make sure you have the "short_open_tag" set to on as I notice you're using [color=red]<?[/color] as an opening tag as opposed to [color=red]<?php[/color]. Assuming this is all ok then try: [code]http://localhost/mysite/images/<? echo "$image_name"; ?>[/code] # Note the 'echo' Regards Rich
  10. You haven't posted any of your PHP code here.  Help us to help you  ;) Regards Rich
  11. Don't forget to check the case.  The link to the font file will be CaSe SeNsitiVe. Sometimes this gets overlooked, so your code is looking for times.ttf and the file is called Times.ttf or Times.TTF Regards Rich
  12. [quote] And we are there! Great thanks everybody! [/quote] Glad to have been of some help. Regards Rich
  13. Either the database isn't identical or the code isn't, as the Press Releases aren't the same on both sites, but this maybe because the data in the Databases isn't the same. Just figured if you'd missed that detail, you may have failed to mention something else. Regards Rich
  14. It's possible. Echo your SQL statement to the screen before trying to insert it and see how it looks.  Then copy and paste that statement to insert into your DB.  If that doesn't work you know it's as a result of the form.  Possibly some invalid characters in one of the fields. Regards Rich
  15. I can't understand why you're even using 'on'.  You're converting it for insert into the database anyway, so you may as well just use '[color=red]true[/color]' as the value You'd be better off with this surely: [code][code=php:0] <input type="checkbox" name="test1" value="true" <?php if($test1 == "true"){echo "checked=\"checked\"";}?> /> [/code][/code] And then change your code on the results page to: [code] $first_name=$_POST['first_name']; $last_name=$_POST['last_name']; if (isset($_POST['test1']) != "true"){     $test1 = "null"; } [/code] Regards Rich
  16. [quote] you're missing a variable for 'title' [/quote] And depending on how your database is setup, you probably aren't allowed to insert 'null' into the ID field. This looks as though it's a sql/database error as opposed to PHP.  It's best to try the query in your database first, make sure it works, then code the PHP around it. Rich
  17. For a start you're trying to insert 17 values into 18 fields. Rich
  18. It is possible to use a .php page as the source of an image as in your example. Most people use the GD Image functions for dynamic images.  [url=http://www.php.net]http://www.php.net[/url] provides details of these in their 'documentation'. Regards Rich
  19. [quote] Yeah I know but I just like standards [/quote] Someone after my own heart  8)
  20. [quote author=ToonMariner link=topic=105042.msg419336#msg419336 date=1156157482] swap echo " CHECKED" for echo " checked=\"checked\""; [/quote] I can see what genista's done here.  HTML will allow an input type of 'checkbox' to be checked with just CHECKED in the tag, it doesn't require a descriptor of checked="checked" but it certainly would help here. Rich
  21. I'm assuming this code was taken from somewhere else. Are you able to post the full code of the two pages so I can get a better look? Rich
  22. For a start there's no closing tag on the <Input> tag... Try this: [code]<p>Beautician:</td><td><input type="checkbox" name="beautician" value="<?php if($test1 == "on"){echo" CHECKED";}?>"> </p>[/code] Also although you've only posted a snippet of your code here, it looks as though your HTML tags are nested incorrectly.  The first tag in a paragraph tag should not be a closing table tag as in your example "<p></td>". Maybe try this: [code]<p>   Beautician:   <td>     <input type="checkbox" name="beautician" value="<?php if($test1 == "on"){echo" CHECKED";}?>">   </td> </p>[/code] Regards Rich
  23. Is it something like this that you want? [url=http://www.dizzie.co.uk/php/test.php]http://www.dizzie.co.uk/php/test.php[/url] This page (test.php) check's to see if a form value (in this instance 'name') is set.  If it's set then it calls image.php and displays the result on test.php, if not it displays the form on test.php. Here's the code for the two pages, with correct content header types. test.php [code] <?php header("Content-Type: text/html"); if (!isset($_POST['name'])){ ?> <h4>Enter your firstname</h4> <form action="test.php" method="post"> <input type="text" name="name"> <input type="submit" name="submit" value="Create Image"> <?php } else { ?> <img src="image.php?name=<?php echo $_POST['name'] ?>"> <br><br><a href="test.php">Try again</a> <?php } ?> [/code] Here's the code for image.php [code] <?php   header("Content-type: image/png");   $string = $_GET['name'];   $im = imagecreatefrompng("../logos/pubutton.png");   $height = imagesy($im);   $halfheight = $height / 2;   $width = imagesx($im);   $halfwidth = $width / 2;   $fontsize = 48;   $angle = 0;   $font = "../logos/smartie.ttf";   $bg = imagecolorallocate($im, 255,255,255);   $white = imagecolorallocate($im,255,255,255);   $black = imagecolorallocate($im,0,0,0);   $array  = imagettfbbox($fontsize,$angle,$font,$string);   $textwidth = abs($array[2] - $array[0]);   $halftextwidth = $textwidth / 2;   $textheight = abs($array[5] - $array[3]);   $halftextheight = $textheight / 2;   $xpos = $halfwidth - $halftextwidth;   $ypos = $halfheight + $halftextheight;   imagettftext($im, $fontsize, $angle, $xpos, $ypos, $black, $font, $string);   imagepng($im);   imagedestroy($im); ?> [/code] Obviously your image.php file would probably look a lot different from mine. Regards Rich
  • 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.