Jump to content

brenda

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

brenda's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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
×
×
  • 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.