Re: Prepared Statement Insert Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi i wanna ask  a question. I am trying to create an image on fly, please do
help me , following is the code.

*File Name : Font.php
Code: *

<html>
<head>
<title>Image Creation</title>

<script language="javascript">
var xmlhttp;

function showPic()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

var text = document.getElementById("textfield").value;

var url="image.php";
url=url+"?text="text;
alert(url);
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
if(xmlhttp.responseText == 1)
{
document.getElementById("pic").style.display="block";
}
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
</script>
</head>
<body>
<form name="form1" method="post" action="" onSubmit=" return false;">
  <table width="304" border="1">
    <tr>
      <td colspan="2"><div align="center">Text</div></td>
    </tr>
    <tr>
      <td>Text</td>
      <td><label>
        <input type="text" name="textfield" id="textfield">
      </label></td>
    </tr>
    <tr>
      <td colspan="2"><label>
        <div align="center">
          <input type="submit" name="button" id="button" value="Update"
onClick="showPic()">
          </div>
      </label></td>
    </tr>
    <tr>
      <td colspan="2"><div id="pic" style="display:none"><img src="pic.jpg"
/></div></td>
    </tr>
  </table>
</form>
</body>
</html>

*File Name : image.php
Code:*

[php]

$name = $_GET['text'];

 $pic = imagecreatetruecolor(100, 100);
 $text_color = imagecolorallocate($pic, 255, 255, 255);
 imagestring($pic, 10, 15, 15,  $name, $text_color);
 $pi = Imagejpeg($pic,"pic.jpg");
 echo $pi;
 ImageDestroy($pic);

[/php]

*Problem: *

What this code is doing is that, it creates a new image with the text (that
user enters) on it, but loads the image that was created previously, I want
that it should display the text on the picture which users enter on the fly.
( e.g. If user enter TEXT as text it should display TEXT on the picture
displayed).Hope you got the problem.

Thanks

For me, it shoould work like this: User enters text intext filed (in
font.html) , when pressed button, image.php should create an im
On Tue, Jul 21, 2009 at 10:46 PM, Christopher Jones <
christopher.jones@xxxxxxxxxx> wrote:

>
>
> kesavan trichy rengarajan wrote:
>
> > could be rewritten as:
> > mysqli_stmt_bind_param($submitadmin, "isss", $numrows, $admin,
> > sha1($password), $email);
>
> Turning on E_STRICT in PHP 5.3 will show
>
>  PHP Strict Standards:  Only variables should be passed by reference
>
> This is also true in earlier versions although the warning isn't
> displayed.
>
> For compliance, try:
>
>  $s = sha1($password);
>  mysqli_stmt_bind_param($submitadmin, "isss", $numrows, $admin, $s,
> $email);
>
> Chris
>
> --
> Blog: http://blogs.oracle.com/opal
> Twitter:  http://twitter.com/ghrd
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux