Jump to content

jacer17

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jacer17's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a transparency color set up with my GD script. It makes the image semi transparent with an ugly border. Any tips or Hints? Page: http://www.zeldadungeon.net/Justin/miniheros/test.php <? $bg = imagecreatefrompng('http://i241.photobucket.com/albums/ff279/tiger_leo/reddraft.png'); $color = imagecolorallocate($bg, 168, 97, 97); $font = './BOOKOS.TTF'; $insert = imagecreatefrompng('http://i241.photobucket.com/albums/ff279/tiger_leo/heartdraft.png'); imagealphablending($insert, true); imagesavealpha($insert, true); $xOffset = 20; $yOffset = 20; imagecolortransparent($insert, $color); $insert_x = imagesx($insert); $insert_y = imagesy($insert); header('Content-Type: image/png'); imagecopymerge($bg,$insert,$xOffset,$yOffset,0,0,$insert_x,$insert_y,100); imagepng($bg); imagedestroy($bg); ?>
  2. The php tag is the first line, except the pasted code. There is no spaces before it and it is top line.
  3. I tryed modifying the script. [code] <? if(!$_POST['submit']) {         $uname = $_POST['uname'];         $password = $_POST['password'];                            if( (!$uname) or (!$password) )             {                 header(" Location: login.php "); exit();             }                      $conn = mysql_connect('localhost', 'connect', 'connect')         or die('wrong connection info');              mysql_select_db('fcp_fcodes')         or die('No database named that');              $sql="select * from fcdatabase where uname='$uname' and password = password('$password')";              $results = mysql_query($sql)         or die("could not execute query");              $row = mysql_fetch_object($results);         $id = $row->id;         $firstname = $row->fname;         $num = mysql_numrows($results);              if($num !=0 )             {                 setcookie("id", $id, time()+36000);                 setcookie("firstname", $firstname, time()+36000);                 header( " Location: settings.php?id=$id ");                 exit();                  }                   else             {             header( " Location: login.php " );             exit();             } } else { ?> <html> <head> </head> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <table> <tr> <td><b>Username:</b></td> <td><input type="text" name="uname" size="25" /></td> </tr> <tr> <td><b>Password:</b></td> <td><input type="password" name="password" size="25" /></td> </tr> <tr> <td><input type="submit" name="submit" value="Log In" /></td> </tr> </table> </form> </body> </html> <? } ?> [/code] This time I get only a blank page
  4. The orginal script [code] <?     $uname = $_POST['uname'];     $password = $_POST['password'];     if( (!$uname) or (!$password) )     { header("Location:login.php"); exit(); }     $conn = mysql_connect('localhost', 'username', 'password')     or die('wrong connection info');     mysql_select_db('fcp_fcodes')     or die('No database named that');     $sql="select * from fcdatabase where uname='$uname' and password = password('$password')";     $rs = mysql_query($sql)     or die("could not execute query");     $row = mysql_fetch_object($rs);     $id = $row->id;     $firstname = $row->fname;     $num = mysql_numrows($rs);     if($num !=0 )     {         setcookie("id", $id, time()+36000);         setcookie("firstname", $firstname, time()+36000);         header( "Location:settings.php?id=$id");         exit();     }     else     {     header( "Location:login.php" );     exit();     } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form action="auth.php" method="post"> <table> <tr> <td><b>Username:</b></td> <td><input type="text" name="uname" size="25" /></td> </tr> <tr> <td><b>Password:</b></td> <td><input type="password" name="password" size="25" /></td> </tr> <tr> <td><input type="submit" name="submit" value="Log In" /></td> </tr> </table> </form> </body> </html> [/code] The error [code] Warning: Cannot modify header information - headers already sent by (output started at /home/fcp/public_html/friendcode/login.php:2) in /home/fcp/public_html/friendcode/login.php on line 8 [/code] I would like to know why it is doing this and what are some ways to correct the script.
×
×
  • 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.