Closed Thread
Results 1 to 11 of 11

Thread: PHP Email Image

  1. #1
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,125

    PHP Email Image

    PHP Code:
    # email.php
    // EMAIL IMAGE
    define("F_SIZE"10);
    define("F_ANGLE"0);
    define("F_FONT""verdana_0.ttf");

    $text "email@domain.com";

    $Leading=0;
    $W=0;
    $H=0;
    $X=0;
    $Y=0;
    $_bx imagettfbbox(F_SIZEF_ANGLEF_FONT$text);
    $s split("[\n]+"$text);  // Array of lines
    $nL count($s);  // Number of lines

    $W = ($W==0)?abs($_bx[2]-$_bx[0]):$W;
    $H = ($H==0)?abs($_bx[5]-$_bx[3])+2+($nL>1?($nL*$Leading):0):$H;

    $img = @imagecreate($W$H) or die("Cannot Initialize new GD image stream");

    $white imagecolorallocate($img255,255,255);
    $txtColor imagecolorallocate($img55,103,122);

    $alpha range("a""z");
    $alpha $alpha.strtoupper($alpha).range(09);

    // Use the string to determine the height of a line
    $_b imageTTFBbox(F_SIZEF_ANGLEF_FONT$alpha);
    $_H abs($_b[5]-$_b[3]);
    $__H 0;

    // Use the string to determine the width of a line
    $_b imagettfbbox(F_SIZEF_ANGLEF_FONT$text);
    $_W abs($_b[2]-$_b[0]);

    // Final width and height
    $_X abs($W/2)-abs($_W/2);
    $__H += $_H;

    imagettftext($imgF_SIZEF_ANGLE$_X$__H$txtColorF_FONT$text);

    header("Content-Type: image/png");
    imagepng($img);
    imagedestroy($img);

    // END EMAIL IMAGE 
    then use a simple image tag to call the image on a normal php page like so...

    HTML Code:
    <img src="email.php" />
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  2. #2
    Sup, Recoil here. themoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond repute themoose's Avatar
    Join Date
    Jun 2005
    Location
    Uzbekistan
    Posts
    8,805
    Took me a minute to figure out what you meant but yeah that looks cool Would +rep you but can't

  3. #3
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,125
    if it is confusing at all, go here to see an example...
    http://www.azbizfilings.com/includes/email.php
    Last edited by iBrightDev; November 29th, 2007 at 17:55.
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  4. #4
    Sup, Recoil here. themoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond repute themoose's Avatar
    Join Date
    Jun 2005
    Location
    Uzbekistan
    Posts
    8,805
    ie this bit:
    http://www.azbizfilings.com/includes/email.php
    Narrow it down more Justin

  5. #5
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,125
    Quote Originally Posted by Colin View Post
    ie this bit:
    http://www.azbizfilings.com/includes/email.php
    Narrow it down more Justin
    it was narrowed down to less to begin with, but, since the size of the image is set automatically depending on the font size, font type and the characters, it required a little extra code to do that.
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  6. #6
    Sup, Recoil here. themoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond repute themoose's Avatar
    Join Date
    Jun 2005
    Location
    Uzbekistan
    Posts
    8,805
    No.. I meant narrow down the example.. as in link to the image rather than a page with lots of different things on it.

    The script size itself is perfectly fine

  7. #7
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,125
    oh, lol, didnt realize you meant that. haha. done
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  8. #8
    Junior Member hm3cs is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    17
    Quote Originally Posted by methodcomptech View Post
    oh, lol, didnt realize you meant that. haha. done
    Thank you verry much

  9. #9
    Junior Member Doolvehek can only hope to improve
    Join Date
    Dec 2009
    Location
    Bulgaria
    Posts
    12

    PHP Email Image

    I think it would be better if _SERVERPHP_SELF was used instead of _SERVERREQUEST_URI

    _SERVERREQUEST_URI wont identify the page if there is a query string in the URL example index.php?action=something

    PHP Code:
    <?php

    if _SERVERPHP_SELF == /about.php

    // if page = about.php show this image
    echo <img src=pathofimg />;

    else if _SERVERPHP_SELF == /contact.php

    // if page = contact.php show this image
    echo <img src=pathofimg />;

    else

    // for all other pages show this image
    echo <img src=pathofimg />;



    ?>
    Not tested, but should work.

  10. #10
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,125
    Quote Originally Posted by Doolvehek View Post
    I think it would be better if _SERVERPHP_SELF was used instead of _SERVERREQUEST_URI

    _SERVERREQUEST_URI wont identify the page if there is a query string in the URL example index.php?action=something

    PHP Code:
    <?php

    if _SERVERPHP_SELF == /about.php

    // if page = about.php show this image
    echo <img src=pathofimg />;

    else if _SERVERPHP_SELF == /contact.php

    // if page = contact.php show this image
    echo <img src=pathofimg />;

    else

    // for all other pages show this image
    echo <img src=pathofimg />;



    ?>
    Not tested, but should work.
    wtf are you talking about? _SERVERREQUEST_URI was never used. i also never said anything about needing to determine the page you are on.
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  11. #11
    Junior Member zeemar is an unknown quantity at this point
    Join Date
    Sep 2010
    Posts
    1

    Re:free php mail script

    hi guys,
    friends you have a facing problem problem php mail just tryguruscript.com this is provided alltype of php script free open source try this.
    thanks
    ---------------------------
    start web script by guruscript.com

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

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