...

View Full Version : I cant get this to work..



Pandabeer
03-07-2009, 11:06 AM
hey, ill post my whole page, can you help me fix it because i only get errors i just want to create a signature thats updates everything thats updated in the database but its not working only getting errors..


Parse error: syntax error, unexpected T_STRING in /public_html/stats.php on line 70


stats.php *click* (http://pandabeer1337.pastebin.com/f4c3da671)

abduraooft
03-07-2009, 11:11 AM
Parse error: syntax error, unexpected T_STRING in /public_html/stats.php on line 70 Post some code around that line.

Pandabeer
03-07-2009, 11:12 AM
Post some code around that line.

just click on stats.php, it'll show pastebin..

Pandabeer
03-07-2009, 11:36 AM
$sig = "./sig".$info['name'] . ".jpg";
imagejpeg ($sig);
$sigdir = "<img src="/".$sig . ">";
Print $sigdir;
}
?>
</div>
</div>
line 70 => <div class="post">
<div class="entry"></div>
</div>
</div>
<!-- end content -->

abduraooft
03-07-2009, 11:52 AM
$sigdir = "<img src="/".$sig . ">"; should be something like

$sigdir = '<img src="/'.$sig.'">';

Pandabeer
03-07-2009, 01:27 PM
Warning: Cannot modify header information - headers already sent by (output started at /public_html/stats.php:7) in /public_html/stats.php on line 8

Warning: imagejpeg(): supplied argument is not a valid Image resource in public_html/stats.php on line 63

wuts this?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
Line => 7 <?php header ("Content-type: image/pjpeg"); ?>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 13px}
-->
</style>
</head>



$string = "Name:".$info['name'] . "<br>Level:".$info['level'] . "<br>Exp:".$info['exp'] . "";
$font = 4;
$width = ImageFontWidth($font)* strlen($string) ;
$height = ImageFontHeight($font) ;

$im = ImageCreateFromjpeg("./sig.jpg");
$x=imagesx($im)-$width ;
$y=imagesy($im)-$height;
$background_color = imagecolorallocate ($im, 255, 255, 255); //white background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, $x, $y, $string, $text_color);

$sig = "./sig".$info['name'] . ".jpg";
Line 63 ==> imagejpeg ($sig);
$sigdir = '<img src="/'.$sig.'">';
Print "<p>Now a signature for ".$info['name'] . " Generated!";
Print $sigdir;
}
?>
</div>

abduraooft
03-07-2009, 01:30 PM
Yes, that echo is not required there before $sigdir

Pandabeer
03-07-2009, 01:59 PM
Yes, that echo is not required there before $sigdir

hm, there is no picture popping up now :X can you fix that please?

sea4me
03-08-2009, 06:11 AM
Change:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php header ("Content-type: image/pjpeg"); ?>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 13px}
-->
</style>
</head>


To:



<?php header ("Content-type: image/pjpeg"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 13px}
-->
</style>
</head>


Header needs to be before any output

Pandabeer
03-08-2009, 01:06 PM
Change:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<?php header ("Content-type: image/pjpeg"); ?>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 13px}
-->
</style>
</head>


To:



<?php header ("Content-type: image/pjpeg"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 13px}
-->
</style>
</head>


Header needs to be before any output

if i do that, i only see the site like this:

http://mysite.eu/index.php not any content in the site.. try it yourself,

click here and fill in Pandabeer (http://www.roleplayandstunt.eu/statsindex.php) > works now but no signature

sea4me
03-09-2009, 01:57 AM
Hummm....

This is a quote from php.net:

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

http://us2.php.net/header



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum