Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    header error while inputting php in html

    hi everyone, i have a problem where i want to show some php script in a html file but everytime i do it it comes up with this error.

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /home/www/gamesigs.co.uk/_sig_created.php:6) in /home/www/gamesigs.co.uk/_sig_created.php on line 225
    This is diplayed where i want it to be on the html page but no image is created as it should do.

    This is line 225

    PHP Code:
    header("Content-type: image/jpeg"); 
    This is the code for all of my page

    Code:
    <html>
    <head>
    <title>Game Sigs</title>
    <META name="description" content="Create your own unique signature from a range of images for use in forums, emails, blogs and websites!">
    <META name="keywords" content="signature, game, games, create, create a signature, draw a signature, make a signature, generate a sig, make a sig, create a sig.">
    <style type="text/css">
    </style>
    </head>
    
    <body bgcolor="#666666" text="#000000" link="#0000FF" vlink="#000000" alink="#000000">
    <table width="975" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">
      <!--DWLayoutTable-->
      <tr> 
        <td width="113" height="10"></td>
        <td width="9" rowspan="33" valign="top" bgcolor="#F4F4F4"><img src="left_side.gif" width="9" height="1177"></td>
        <td colspan="11" valign="top" bgcolor="#F4F4F4"><img src="bar.gif" width="720" height="10"></td>
        <td width="9" rowspan="33" valign="top" bgcolor="#F4F4F4"><img src="right_side.gif" width="9" height="1177"></td>
        <td width="124"></td>
      </tr>
      <tr> 
        <td height="125">&nbsp;</td>
        <td colspan="11" valign="middle" bgcolor="#FFFFFF"><div align="center"><font size="7" face="Comic Sans MS">Gamesigs.co.uk</font></div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="19">&nbsp;</td>
        <td colspan="7" valign="middle" bgcolor="#FFFFFF"> <a href="http://gamesigs.awardspace.com/invite.php"><img src="msn.jpeg" alt="Invite a Friend" height="19" border="0"></a> 
          <img src="star.jpeg" onClick="window.external.AddFavorite(location.href, document.title);" alt="Add to Favoutites" width="18" height="18"> 
          <img src="homepage.gif" alt="Make Homepage" width="19" height="19" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://gamesigs.awardspace.com');" a href="#"></td>
        <td colspan="4" valign="top" bgcolor="#FFFFFF"><div align="right"> 
            <!-- #BeginDate format:fcAm1a -->Wednesday, June 21, 2006 3:47 PM<!-- #EndDate -->
          </div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="11" valign="top" bgcolor="#F4F4F4"><div align="center"><img src="bar.gif" width="720" height="10"> 
          </div></td>
        <td></td>
      </tr>
      <tr> 
        <td height="5"></td>
        <td colspan="5" rowspan="3" align="center" valign="middle" bgcolor="#FFFFFF"> 
          <div align="center"><a href="http://gamesigs.awardspace.com" style="text-decoration:none; color:black".><strong><font color="#000000" face="Comic Sans MS">Home</font></strong></a><font color="#000000" face="Comic Sans MS"> 
            <strong><a href="http://gamesigs.co.uk/choosegame.php" style="text-decoration:none; color:black".>Create</a> 
            <a href="http://gamesigs.awardspace.com/demo.php"style="text-decoration:none; color:black". >Demo</a> 
            <a href="http://gamesigs.co.uk/phpBB2"style="text-decoration:none; color:black". >Forum</a> 
            <a href="http://gamesigs.co.uk/phpBB2/viewforum.php?f=12"style="text-decoration:none; color:black". >Request</a> 
            <a href="http://gamesigs.co.uk/phpBB2/viewforum.php?f=11"style="text-decoration:none; color:black". >Upload</a> 
            <a href="http://gamesigs.awardspace.com/contact.php"style="text-decoration:none; color:black". >Contact</a></strong></font> 
          </div></td>
        <td colspan="6" valign="top"><img src="marqueefill.jpg" width="322" height="5"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="28"></td>
        <td width="28" valign="top"><p><font color="#FFFFFF"><img src="leftmarquee%20copy.jpg" width="28" height="28"></font></p></td>
        <td colspan="4" align="center" valign="middle" bgcolor="#000000"> <marquee>
          <font color="#FFFFFF" size="2">Gamesigs.co.uk - Beat the best, Destroy the 
          rest</font><font color="#FFFFFF" size="2" face="Comic Sans MS"> </font> 
          </marquee></td>
        <td width="28" valign="top"><img src="rightmarquee.jpg" width="28" height="28"></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="5"></td>
        <td colspan="6" valign="top"><img src="marqueefill.jpg" width="322" height="5"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="11" valign="top"><img src="bar.gif" width="720" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="49"></td>
        <td width="120" rowspan="7" valign="top" bgcolor="#FFFFFF"> <script type="text/javascript"><!--
    google_ad_client = "pub-2256213448175782";
    google_ad_width = 120;
    google_ad_height = 240;
    google_ad_format = "120x240_as";
    google_ad_type = "text";
    google_ad_channel ="";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000000";
    google_color_text = "666666";
    google_color_url = "666666";
    //--></script> <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script> </td>
        <td width="22" rowspan="23" valign="top" bgcolor="#CCCCCC"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td colspan="9" valign="top" bgcolor="#FFFFFF"> <form method="get" action="http://www.google.com/custom" target="_top">
            <table border="0" bgcolor="#ffffff">
              <!--DWLayoutTable-->
              <tr> 
                <td width="572" height="45" align="left" valign="top" nowrap="nowrap" bgcolor="#CCCCCC"> 
                  <div align="center"><font size="2">Page loaded in</font> 
                    <?php
    $load = microtime();
    print (number_format($load,2));
    ?>             <font size="1"> <font size="2">seconds</font></font><font size="2">.</font> 
                    <!-- SiteSearch Google -->
                    <input type="hidden" name="domains" value="gamesigs.co.uk">
                    <input type="hidden" name="client" value="pub-2256213448175782">
                    <input type="hidden" name="forid" value="1">
                    <input type="hidden" name="ie" value="ISO-8859-1">
                    <!-- SiteSearch Google -->
                    <input type="radio" name="sitesearch" value="" checked="checked">
                    <font color="black" size="-1" face="Comic Sans MS">Web</font><font size="-1" color="black"> 
                    <input type="radio" name="sitesearch" value="gamesigs.co.uk">
                    <font face="Comic Sans MS">Gamesigs</font> </font> 
                    <input type="text" name="q" size="25" maxlength="255" value="">
                    <input type="submit" name="sa" value="Search">
                    <input type="hidden" name="oe" value="ISO-8859-1">
                    <input type="hidden" name="hl" value="en">
                    <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;">
                  </div></td>
              </tr>
            </table>
          </form></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="25">&nbsp;</td>
        <td width="54" rowspan="22" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="10" rowspan="2" valign="top" bgcolor="#CCCCCC"><img src="left_side.gif" width="10" height="145"></td>
        <td colspan="4" align="center" valign="middle" bgcolor="#CCCCCC"> <div align="center"><strong></strong></div></td>
        <td width="10" rowspan="2" valign="top" bgcolor="#CCCCCC"><img src="right_side.gif" width="10" height="145"></td>
        <td colspan="2" rowspan="22" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="120">&nbsp;</td>
        <td colspan="4" valign="top" bgcolor="#F4F4F4"><div align="center">
    
    
    //////////////////////////////////////////////////////////////////
    /////////This is the important part ////////////////////////////
    ////////////////////////////////////////////////////////////////////
    <?
    $name = stripslashes($_GET['name']);
    $size = stripslashes($_GET['size']);
    $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';
    $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED
    $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN
    $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE
    $shadow = stripslashes($_GET['shadow']);
    $lines = stripslashes($_GET['lines']);
    function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
    ///
    }
    switch ($_GET['color']) {
    case '1':
     $bgpic = 'images/sig_maker/1.jpeg';
     break;
    case '2':
     $bgpic = 'images/sig_maker/2.jpeg';
     break;
    case '3':
     $bgpic = 'images/sig_maker/3.jpeg';
     break;
    case '4':
     $bgpic = 'images/sig_maker/4.jpeg';
     break;
    case '5':
     $bgpic = 'images/sig_maker/5.jpeg';
     break;
    case '6':
     $bgpic = 'images/sig_maker/6.gif';
     break;
    case '7':
     $bgpic = 'images/sig_maker/7.gif';
     break;
    case '8':
     $bgpic = 'images/sig_maker/8.gif';
     break;
    case 'random':
     $num = mt_rand(1,5);
     if($num == 1){ $bgpic = 'images/sig_maker/1.jpeg'; }
     elseif($num == 2){ $bgpic = 'images/sig_maker/2.jpeg'; }
     elseif($num == 3){ $bgpic = 'images/sig_maker/3.jpeg'; }
     elseif($num == 4){ $bgpic = 'images/sig_maker/4.jpeg'; }
     elseif($num == 5){ $bgpic = 'images/sig_maker/5.jpeg'; }
     break;
    default:
     $num = mt_rand(1,5);
     if($num == 1){ $bgpic = 'images/sig_maker/1.jpeg'; }
     elseif($num == 2){ $bgpic = 'images/sig_maker/2.jpeg'; }
     elseif($num == 3){ $bgpic = 'images/sig_maker/3.jpeg'; }
     elseif($num == 4){ $bgpic = 'images/sig_maker/4.jpeg'; }
     elseif($num == 5){ $bgpic = 'images/sig_maker/5.jpeg'; }
    }
    
    
    $im = imagecreatefromjpeg($bgpic);
    //Calculate, the centre:
    for(;;){
    list($image_width, $image_height) = getimagesize($bgpic);
    list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
    $text_width = $right_x - $left_x;
    if($image_width > $text_width+5){
    break;
    }
    $size = $size - .5;
    if($size == 1){
    die('Script not responding to decreasing font size, in other words: try using less letters.');
    }
    }
    $padding = ($image_width - $text_width)/2;
    
    $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
    
    $grey = imagecolorallocate($im, 128, 128, 128);
    
    if($shadow == 'y'){
    imagettftext($im, $size, 0, $padding+1, 77, $grey, $font, $name);
    }
    if($lines == 'y'){
    
    //imagettftext($im, $size, 0, $padding+1, 77, $grey, $font, $name);
    
    }
    
    imagettftext($im, $size, 0, $padding, 75, $textcolor, $font, $name);
    if($_GET['dl']){
    header('Content-Disposition: attachment; filename="sig.jpeg"');
    }
    header("Content-type: image/jpeg");
    imagegif($im);
    ?>
    
    
    //////////////////////////////////////////////////////////
    
    
    
          </div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="6" valign="top" bgcolor="#CCCCCC"><img src="bar.gif" width="470" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="19"></td>
        <td colspan="6" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"></td>
        <td rowspan="3" valign="top" bgcolor="#CCCCCC"><img src="left_side.gif" width="10" height="145"></td>
        <td colspan="4" valign="middle" bgcolor="CCCCCC"> <div align="center"><strong></strong></div></td>
        <td rowspan="3" valign="top" bgcolor="#CCCCCC"><img src="right_side.gif" width="10" height="145"></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="84"></td>
        <td colspan="4" rowspan="2" valign="middle" bgcolor="#F4F4F4"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="36"></td>
        <td rowspan="15" valign="top" bgcolor="#FFFFFF"><script type="text/javascript"><!--
    google_ad_client = "pub-2256213448175782";
    google_ad_width = 120;
    google_ad_height = 600;
    google_ad_format = "120x600_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000000";
    google_color_text = "666666";
    google_color_url = "666666";
    //--></script> <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="6" valign="top" bgcolor="#CCCCCC"><img src="bar.gif" width="470" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="19"></td>
        <td colspan="6" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"></td>
        <td rowspan="2" valign="top"><img src="left_side.gif" width="10" height="145"></td>
        <td colspan="4" valign="middle" bgcolor="#CCCCCC"> <div align="center"><strong></strong></div></td>
        <td rowspan="2" valign="top"><img src="right_side.gif" width="10" height="145"></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="120"></td>
        <td colspan="4" valign="top" bgcolor="#F4F4F4"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="6" valign="top"><img src="bar.gif" width="470" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="19"></td>
        <td colspan="6" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"></td>
        <td rowspan="2" valign="top"><img src="left_side.gif" width="10" height="145"></td>
        <td colspan="4" valign="middle" bgcolor="#CCCCCC"> <div align="center"><font face="Comic Sans MS"></font></div></td>
        <td rowspan="2" valign="top"><img src="right_side.gif" width="10" height="145"></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="120"></td>
        <td colspan="4" valign="top" bgcolor="#F4F4F4"><div align="center"> 
            <p>&nbsp;</p>
            </div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="6" valign="top"><img src="bar.gif" width="470" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="19"></td>
        <td colspan="6" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"></td>
        <td rowspan="2" valign="top"><img src="left_side.gif" width="10" height="159"></td>
        <td colspan="4" valign="middle" bgcolor="#CCCCCC"> <div align="center"><strong></strong></div></td>
        <td rowspan="2" valign="top"><img src="right_side.gif" width="9" height="159"></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="134"></td>
        <td colspan="4" valign="top" bgcolor="#F4F4F4"> <div align="center"></div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="6" valign="top"><img src="bar.gif" width="470" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="18"></td>
        <td colspan="6" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="center"><strong>You 
            are visitor no. 
            <!-- Start of StatCounter Code -->
            <script type="text/javascript" language="javascript">
    <!-- 
    var sc_project=1647783; 
    var sc_invisible=0; 
    var sc_partition=15; 
    var sc_security="057bec6d"; 
    var sc_text=2; 
    //-->
    </script>
            <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script>
            </strong> </div></td>
        <td></td>
    
      </tr>
      <tr> 
        <td height="1"></td>
        <td></td>
        <td></td>
      </tr>
      <tr> 
        <td height="22"></td>
        <td colspan="2" valign="top" bgcolor="#CCCCCC"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td colspan="9" valign="top" bgcolor="#CCCCCC"> <div align="center"> <font color="#000000"> 
            <script type="text/javascript"><!--
    google_ad_client = "pub-2256213448175782";
    google_ad_output = "textlink";
    google_ad_format = "ref_text";
    google_cpa_choice = "CAAQ0KGL_QEaCAfnoShtwaohKPzWtIQB";
    //--></script>
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
            </font></div></td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td height="10"></td>
        <td colspan="11" valign="top"><img src="bar.gif" width="720" height="10"></td>
        <td></td>
      </tr>
      <tr> 
        <td height="1"></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td width="192"></td>
        <td></td>
        <td width="49"></td>
        <td width="181"></td>
        <td></td>
        <td width="26"></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </table>
    </body>
    </html>


    PLease help me. thanks

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Please don't post an entire script. post only the relevant error or a relevant piece of code.

    The error means you have output some information to the screen prior to calling your header on line 225. You may not have any output sent before setting the headers.

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    where is this on the code?

  • #4
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *bump*

  • #5
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    I don't think you can use header() after you've outputted some info..

  • #6
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so how can i solve this problem.

  • #7
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *bump* please help

  • #8
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    As guelphdad and Mwnciau say, you cannot write to HTTP headers after outputting HTML. This script was not made for embedding within HTML. It outputs the raw GIF image.
    PHP Code:
    header("Content-type: image/jpeg");
    imagegif($im); 
    Do you absolutely need to embed the image in a table? I'm quite sure the script would work if you place it in a file by itself.
    Probably I'm just telling you what you know already...

  • #9
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have it so the image comes up by itself on a new page. I want there to be information on this page as well as the image. So i would like it in a similar layout to the main page but with a photobucket upload image box there as well. I want this because people create there sig then dont know what to do with it. Some try hotlinking but my host doesnt allow it. I cant think of how to do it but every other site that lets users create images has it working so i know it can be done? PLease help

  • #10
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Alright I see. With the risk of giving bad advice, here is what I suggest.

    1. Create a new file only containing the script exactly as it is, and call it e.g. sign.gif.php (The last .php extension ensures that the file is parsed by the php engine). It will look like
    PHP Code:
    <?php
    $name 
    stripslashes($_GET['name']);
    $size stripslashes($_GET['size']);
    ...
    header("Content-type: image/jpeg");
    imagegif($im);
    ?>
    2. Keep your original file as it is, but remove the script within the table cell, and instead put in an image tag linking to the script above that generates your raw gif appending the appropirate GET variables necessary to create the image. You will have something like
    Code:
    ...
    <td>
    <img src="sign.gif.php?name=something&amp;size=100&amp;font=arial" />
    </td>
    ...
    Hope this will bring you on the right track.

  • #11
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry but this didnt work. It came up with the same errors i was getting before. Any more ideas how to show a php generated image on a html page without getting header errors?

  • #12
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,020
    Thanks
    2
    Thanked 313 Times in 305 Posts
    The method that koyama has posted is how to make this work. A web page must have a valid <img src="a_url_that_results_in_an_image_being_output"... HTML tag where you want the image to appear.

    If you are still getting the same error, the header(....) statement is probably still appearing in the code for your web page. Post your current code for the web page.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #13
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    ok right I think i get you know. I have taught myself php so im not great so please explain things in detail and try not to laugh.

    Ok heres what ive done (i probably done something really stupid)

    I put this img src tag in
    Code:
    <img src="creation.php"?color=$textcolor&amp;name=$name&amp;centre=$centre&amp;x=$x&amp;y=$y&amp;angle=$angle&amp;font=$font&amp;size=$size&amp;select=255%2C255%2C255&amp;color_r=$fontcolor['r']&amp;color_g=$fontcolor['g']&amp;color_b=$fontcolor['b']&amp;submit=Create+My+Sig%21/>
    The variables are the same as i have on the creation page, which looks like:

    Code:
    <?php
    header("Content-type: image/jpeg");
    
    $name = stripslashes($_GET['name']);
    
    $size = stripslashes($_GET['size']);
    
    $centre = stripslashes($_GET['centre']);
    
    $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';
    
    $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED
    
    $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN
    
    $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE
    
    $lines = stripslashes($_GET['lines']);
    
    function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
    ///
    
    }
    
    if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '47')
    {
        $bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg';
    }
    
    
    $im = imagecreatefromjpeg($bgpic);
    
    //Calculate, the centre:
    
    for(;;){
    
    list($image_width, $image_height) = getimagesize($bgpic);
    list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
    $text_width = $right_x - $left_x;
    if($image_width > $text_width+5){
    
    break;
    
    }
    
    $size = $size - .5;
    if($size == 1){
    die('Script not responding to decreasing font size, in other words: try using less letters.');
    }
    
    }
    $hpadding = ($image_width - $text_width)/2;
    $vpadding = ($image_height/2);
    
    $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
    if($centre== 'y'){
    
    imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);
    
    }else{
    
    imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);
    
    }
    
    imagegif($im);
    imagedestroy($im);
    ?>
    and this is the important part of the form that sends them:
    Code:
    <form method="get" action="http://gamesigs.co.uk/creation.php" name="form" onsubmit="return checkit(this);">
    When i change this form to go to the psge i have with the img src link on it it come up with a broken image. Where am i going wrong?

  • #14
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    I think there is a misplaced double quote in the <img> tag which should enclose the whole string. You should have something like this in your file:
    PHP Code:
    <div>
    <?php
    echo '<img src="creation.php?color='.$textcolor.'&amp;name='.$name.'&amp;centre='.$centre'.&amp;x='.$x.'&amp;y='.$y.'&amp;angle='.$angle.'&amp;font='.$font.'&amp;size='.$size.'&amp;select=255%2C255%2C255&amp;color_r='.$fontcolor['r'].'&amp;color_g='.$fontcolor['g'].'&amp;color_b='.$fontcolor['b'].'&amp;submit=Create+My+Sig%21" />';
    ?>
    </div>
    To be sure that you have done it correctly you could in your browser say View > Source. If your code is processed correctly by php your image tag should then look something like:
    Code:
    <img src="creation.php?color=blue&amp;name=john&amp;..." />
    Last edited by koyama; 01-04-2007 at 04:45 PM. Reason: forgot semicolon;

  • #15
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that makes it come up with an error saying


    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/www/gamesigs.co.uk/userbars.php on line 100

    and when i check in the source it hasnt processed them at all it still says $color etc instead of blue
    Last edited by digi duck; 01-04-2007 at 04:58 PM. Reason: cant spell


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •