Results 1 to 5 of 5

Thread: IMAGE - PHP & HTML/PHP

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    266

    IMAGE - PHP & HTML/PHP

    Please study the following code - image accessing problem.

    Run block 2 line 2 only - no problem.
    Run block 2 both lines - problem.
    Run block 1 and HTML block together - problem.

    I need a remedy from this. Please make some R&D withe these code, take your time (24 hours) and try to give me a solution.

    <?php

    echo "Hello World <br>";

    ?>

    <?php

    //echo "hello <br>";
    //echo file_get_contents(getcwd()."/zodiac/Gemini.jpg")."<br>";

    ?>

    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form name="f" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
    <img src="<?php echo file_get_contents(getcwd().'/zodiac/Cancer.jpg').'<br>'; ?>" width="100" height="50">
    </form>
    </body>
    </html>

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: IMAGE - PHP & HTML/PHP

    I cannot fathom why on earth you would want to get the contents of an image file and put it into an src attribute. What's stopping you just displaying it the normal way?

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: IMAGE - PHP & HTML/PHP

    Quote Originally Posted by systech44
    Please study the following code - image accessing problem.

    Run block 2 line 2 only - no problem.
    Run block 2 both lines - problem.
    Run block 1 and HTML block together - problem.

    I need a remedy from this. Please make some R&D withe these code, take your time (24 hours) and try to give me a solution.
    What if we don't? Are you going to sack us?

    This is a double post: http://www.vbforums.com/showthread.php?t=422359

    I suggest you learn HTML, like I stated in the other thread
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: IMAGE - PHP & HTML/PHP

    Or why not use MIME to put the image in the same file as the webpage. That would be sensible.
    I don't live here any more.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: IMAGE - PHP & HTML/PHP

    Sensible is relative.

    Most posters, though, learn to use code tags by their third post ...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width