Jump to content

mheinjr

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mheinjr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK guys, thanks a bunch I think I fixed it how I want it I added [b]Options +Multiviews[/b] into the .htaccess file! Now I can use it as a directory. Thanks, Mark
  2. [b]GUYS, you are awesome.. thanks a bunch for your help.[/b][!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--] I got it working though there is 1 more thing I would like to do with this.[!--colorc--][/span][!--/colorc--] [u]mainewoods[/u], You explained to me how to make the .php be looked at as a .jpg [!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]How do I make it look at the .php file as a directory?[!--colorc--][/span][!--/colorc--] [b]EG: magick.php/picture.jpg would now be used as: magick/picture.jpg[/b] and with the code inside of magick.php I can redirect with the ['PATH_INFO'] "so there is problem with this" I know I have to edit something in the .htaccess but I don't know what. Thanks, Mark
  3. Well I am now able to send a image file when using a .php.... now I just have to incorporate this into my other code [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <?php header("Content-type: image/jpeg"); readfile("picture.jpg"); ?> [/quote] I am very tired right now, and going to sleep. I will be working on this tomorrow. What do you guys think about using this way? Is there anything I should add anywhere? I need to test this some more because [b]when I add this to the end of my .php file it doesn't work "it is blank"[/b], but when it is alone like that it works.... also I had a header problem when I tried to add the header part to the top of the .php file. [b]EDIT:[/b] I think I got it.. now I know why it was giving a blank screen when I added it.. Maybe I should take out the exit; :)
  4. mainewoods, I am not sure "exactly what your saying", I understand making the .jpg file act like a .php file, but I am not quite getting how I would get the picture out of the .jpg file if it is now reading like a .php [b]What I did was:[/b][color=#3366FF] 1. added: header("Content-type: image/jpeg"); to my magick.php 2. added: AddType application/x-httpd-php .jpg to .htaccess... 3. renamed magick.php to magick.jpg I went to [a href=\"http://www.myserver.com/magick.jpg\" target=\"_blank\"]http://www.myserver.com/magick.jpg[/a] and it [b]echo'd[/b] the address in the address bar I used <img src="http://www.myserver.com/magick.jpg"> and it returned a broken image "of course" This did work, and I do like it because now I won't see the .php file ;) however I do want it to display a image while acting as a php file.
  5. OK this is what I tried "making it simple" I don't want a big thing here :) I just want something simple. SO whenever anyone visits my test.php it will return that file I have logging code in test.php and I want to display a image along with it. EG: <img src="test.php/image.jpg"> I want it to LOG the people who VIEW IT "which it DOES" and I ALSO want it to display a image... right now I am using height="0" and width="0" because it doesn';t show anything. to the code I tried.......... I created a file test.html with this in it:[b] <img src="http://www.myserver.com/images/[!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]test2.php[!--colorc--][/span][!--/colorc--]/tattoo-scar.jpg>[/b] This will display the image I have in the test2.php file despite what I have in that code above... but it doesn't work [b]INSIDE test2.php[/b] is this coding "simple coding... this is so whatever jpg I put it will always return the same one!": [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <?php header("Content-type: image/jpeg"); imagejpeg("public_html/images/tattoo-scar.jpg"); ?> [/quote] still shows broken image! I have tried Various things... I added this to it: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] [b]$file = "public_html/images/tattoo-scar.jpg";[/b] imagejpeg($file); echo $file; [/quote] and when I do that [b]http://www.myserver.com/images/test2.php/mypicture.jpg[/b] I get a broken image + a echo that says: [a href=\"http://www.myserver.com/images/test2.php/mypicture.jpg\" target=\"_blank\"]http://www.myserver.com/images/test2.php/mypicture.jpg[/a]. shouldn't it be echoing: [b]public_html/images/tattoo-scar.jpg[/b] as I tell it to? How come that is renaming $file to the Request_URL?
  6. THank you, I am at work right now and cannot test any codes. Now that I am briefly looking into this wouldn't I just be able to use Imagejpeg(picture.jpg) to have it send a image when i use: <img src="http://<my server>/test3.php/picture.jpg">
  7. I put that code into a php named test3.php [b]When I enter this into the address bar http://<my sevrer>/test3.php/picture.jpg I get:[/b] [!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]The full URL is: http://<my server>/test3.php/picture.jpg The image name is: picture.jpg[!--colorc--][/span][!--/colorc--] [b]but when I make a html file with this in it: <img src="http://<my server>/test3.php/picture.jpg"> I get: [/b] [!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]all I get is a broken image.[!--colorc--][/span][!--/colorc--] Did I do this correctly? Thanks for your help, Mark
  8. [b]1st thing:[/b] OK what I have here is a file called magick.php! I am using this file to get php code but disguise it with a .jpg [b]EG:[/b] magick.php/picture.jpg now when I go to that link what it really does is opens magick.php and does whatever I have the code says to do in it. Right now the code works fine for what I am doing with it. I want to add to it though. I want it to be able to actually return A image no matter what I specify when I do a <img src="magick.php/picture.jpg"> but I do not know how to do this. [!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]I cannot use Header because that will ask if you want to download the file[!--colorc--][/span][!--/colorc--] [b]2nd thing:[/b] I want to make the .php LOOK like a directory and not a .php file [b]Don't WANT:[/b] magick.php/picture.jpg [b]I WANT:[/b] magick/picture.jpg I read this somewhere but do not know how to do it: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] if you want to remove the ugly .php part of your URL, but you don't want to redefine the default type for every document affected by that .htaccess file, you can do so by removing the AddType directive and replacing it with Option Multiviews. This is a generally preferable method, since it applies to every kind of file, and doesn't require you to sacrifice informative file extensions on your server. [/quote] Can someone help me out please? I am new to php, and have been doing alot of reading, and putting together some code.
×
×
  • 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.