Jump to content

brenda

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by brenda

  1. phpSensei, The variable I am passing to the like statement is a column name - even so I tried that and it didn't work. Did I misunderstand what you were saying? Thanks again.
  2. Thanks PhpSensei, I have been offline for a while 'cos my computer crashed so have just got back to this issue. I didn't know about mysql_real_escape_string so will try that. Brenda
  3. I presume you are suggesting that I change the code to something like the following (apologies if I have misunderstood what you are saying): $sql='SELECT * FROM member_details WHERE Surname LIKE "%'%"'; Again, this works if I use LIKE "%a%" but not when I substitue the apostrophe for 'a'. In fact I get the following error message: Parse error: syntax error, unexpected T_STRING in /home/... and this message points to my $result=... line. Did I misunderstand you?
  4. I have the following code to search my database (obviously some of the surrounding code is not provided) but I hope this provides enough for me to be clear about my problem) : $sql="SELECT * FROM member_details WHERE state='$state' AND location='$locn' ORDER BY Surname, Given_name"; $result=mysqli_query($conn, $sql) or die("Error in selection -".mysqli_error($conn)); $numrows=mysqli_num_rows($result); if($numrows==0) { echo "There are no members listed in this State/Territory/location."; } else { while($row=mysqli_fetch_array($result)) { $surname=$row['Surname']; if (strstr($surname, "'")) echo "yes"; else echo "no"; } } This works fine if I am searching for a surname that contains a letter such as ''a". However when I search on the apostrophe, even though I know I have several surnames in the database which contain the apostrophe, I get a 'no' response for all of them. Thank you. Can anyone see what I am doing wrong here please or suggest a different approach?
  5. Hi markjoe, I have now saved the file but when reopened the user can no longer write text to it. It seems that I am gong to have to try to use a while loop so that the user can keep on adding text as they wish. But at least I have got that far. Thanks for your help
  6. Hi Gizmola, Thanks for the clarification re PHP Freaks. I won't use it again and I trust others like me will take note as well. I know it doesn't matter and you don't know me from Adam (or Eve) but I want to tell you that in fact I did that coding and so do understand it. I have only been studying web design for a while and am doing my best to learn as much as I can and as quickly as I can. In this particular case I had an idea for a site that I am helping out with and got so far with the coding but couldn't work out the next step. After spending hours and hours trying to work it out I finally decided that I needed help and decided somebody who reads PHP Freaks might be able to help. As it turns out one of your readers has given me some advice which I think will be very helpful, but as mentioned above I will not be using this forum again.
  7. markjoe, You are very generous with your time. Thank you. I am at work now but will work with this over the weekend. I will be SO happy when I get this working as I have spent hours and hours on it. Best wishes
  8. Thank you markjoe. Do you mind if I ask you how to do that?
  9. thanks to Nightslyr Maq and Requinix for your helpful and clear responses. I will see if I can bump my question and include the relevant code in the message. I will also take note for future posts. Brenda
  10. Crayon Violet, What do you mean by "you didn't even bother to post a link to your question in this thread" please? What am I supposed to be linking to? I attached two codes but presumably that is not what you are referring to, as at least a couple of people have downloaded them. I wasn't aware I could bump my thread. Will check that out if I post another question sometime. I don't think I can explain the question anymore clearly. And no I don't for a moment suggest anyone is obligated. I was simply trying I guess in your terminology to bump the question so it didn't disappear.
  11. PLEASE can anyone help? My question is now on page 3 so I despair of any responses unless I ask for help again. It is called How can I allow a user to write text on an image more than once? I have looked everywhere for an answer without a result. There must be somebody who knows how to do this! Thank you.
  12. Hi, I have code (see 2 docs attached) which allows a user to write text on an image - I am using an image map so that the person can click on part of the image and input their text. My problem is that it only allows text to be written on the image once (even though I will have multiple places on the image map that they can click on) and I need the user to be able to write on it at different places and also at different times. Currently when the text has been written once the user is given a choice whether to open or save the image with the text written on it. How can I offer the user another chance to write text on the image before giving them the choice to open or save it or even afterwards if they want to go back and have another go ? Thanks [attachment deleted by admin]
  13. Thanks very much Socratesone. You are a legend! Can I ask you a follow on question please (it is a follow on in my mind at least). If the script that I want to be shown as an image is input by the user, as in the following script, should the whole process work the same as it now does, thanks to your help (and that of Requinix) with the script that I sent you earlier? I can get the form to work and create an image containing the input text in the browser, but if I then put the name of that file into my html script (as provided in my initial post) as <img src="imagestring.php"/>all I get is the placedholder for an image. I would be so grateful if you could resolve this for me as this would be the end of my long search for an answer. <?php if (!$_POST) { //show form echo " <html> <head> <title>Image Creation Form</title> </head> <body> <h1>Create an Image</h1> <form method=\"POST\" action=\"".$_SERVER["PHP_SELF"]."\"> <p><strong>Image Size:</strong><br/> W: <input type=\"text\" name=\"w\" size=5 maxlength=5> H: <input type=\"text\" name=\"h\" size=5 maxlength=5> <p><strong>Background Color:</strong><br/> R: <input type=\"text\" name=\"b_r\" size=3 maxlength=3> G: <input type=\"text\" name=\"b_g\" size=3 maxlength=3> B: <input type=\"text\" name=\"b_b\" size=3 maxlength=3> <p><strong>Text Color:</strong><br/> R: <input type=\"text\" name=\"t_r\" size=3 maxlength=3> G: <input type=\"text\" name=\"t_g\" size=3 maxlength=3> B: <input type=\"text\" name=\"t_b\" size=3 maxlength=3> <p><strong>Text String:</strong><br/> <input type=\"text\" name=\"string\" size=35> <p><strong>Font Size:</strong><br/> <select name=\"font_size\"> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> </select> <p><strong>Text Starting Position:</strong><br/> X: <input type=\"text\" name=\"x\" size=3 maxlength=3> Y: <input type=\"text\" name=\"y\" size=3 maxlength=3> <p><input type=\"submit\" name=\"submit\" value=\"create image\"> </form> </body> </html>"; } else { //create image //create the canvas $myImage = ImageCreate($_POST["w"], $_POST["h"]); //set up some colors $background = ImageColorAllocate ($myImage, $_POST["b_r"], $_POST["b_g"], $_POST["b_b"]); $text = ImageColorAllocate ($myImage, $_POST["t_r"], $_POST["t_g"], $_POST["t_b"]); // write the string at the top left ImageString($myImage, $_POST["font_size"], $_POST["x"], $_POST["y"], $_POST["string"], $text); //output the image to the browser header ("Content-type: image/png"); ImagePNG($myImage); //clean up after yourself ImageDestroy($myImage); } ?>
  14. Sorry, but what do you mean by "you need arial.ttf in that folder"? please. And thanks so much for your assistance.
  15. Looking at those error messages: line 24: is this something to do with what you said about needing arial.ttf in the same folder? I don't understand what that means. line 33: don't understand that either. the remaining lines- i don't know what it is saying needs to be within the (). Your further advice is much appreciated. Brenda
  16. I get the following: Warning: imagettfbbox() [function.imagettfbbox]: Invalid font filename in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 24 Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 33 Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 36 Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 38 Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 41 Warning: imagettftext() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 48 Warning: imagepng() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 53 Warning: imagedestroy() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PHPbook\Examples\14\myscript.php on line 56
  17. Here it is. Thanks [attachment deleted by admin]
  18. I need to be able to create an image from user input. I have found a couple of samples that purport to do that but when I copy the code I can't get it to work. I would appreciate advice as to what I am doing wrong please. One example I tried is from a tutorial on this site: http://www.phpfreaks.com/tutorial/php-add-text-to-image Now perhaps there is something I am doing wrong when I call on the image that is supposed to display but given that I have tried the same code with other images and it works I can't see what I am doing wrong, unless there is something in the nature of scripts that requires some extra steps. Here is my code to see the image (note that 'myscript.php' in my code is in the same folder as the code I am calling: <html> <head> <title>Using Images Created by Scripts</title> </head> <body> <h1>Generated Image Below ...</h1> <img src="myscript.php"/> </body> </html> Can anyone help? Thank you
  19. PLEASE PLEASE can anyone help?
  20. So far I can: 1. click on the image map and get a document to open so that the user can write their comments. This is done via the 'trial tree interactive.php' doc I have already uploaded; and 2. create a php document containing an image within a php document of those comments - see attachment for that bit of code. My problem now is how do I get the image within the php document to replace the image map when the image within the php document is not a jpeg, png or gif file? I would bwe SO grateful for help as I feel I am so close to the solution but just can't make that leap. Thanks [attachment deleted by admin]
  21. Thanks to both of you. Will do some (a lot more) more work on this and let you know the results.
  22. Sorry I didn't answer your other question - yes both sql and php are supported by my server. thank you.
  23. Here is the image and the coding I have done so far. If I can work out how to do it then I can create more image maps. So far I have only the one. [attachment deleted by admin]
  24. What I was thinking of was replacing the area of the image map within the image with the document that the user has written on. So he clicks on the image map, a document opens up for him to write into and then I wanted what he as written to replace the image map. The image is a tree and the idea is that various parts of the tree will become image maps. The person can write a word or two that explains what that part of the tree represents to them. At the end of the process there would be the image of the tree with a number of words written on it where the image maps had been.
  25. Its not creating the image map that is the problem. What I would like to do, if possible, is to allow the person clicking on the image map to open a document that they can write to which will then replace the image map. Is that possible and if so how? Thanks
×
×
  • 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.