PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jason
Site Admin
Posts: 1767 Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:
Post
by jason » Thu Sep 26, 2002 3:18 pm
image.php
Code: Select all
<img src="dale/image<?=$_GETї'img']?>.jpg" />
Of course, that doesn't include things like checking the input, making sure the file exists, etc, but should get you stared.
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Thu Sep 26, 2002 3:34 pm
ok my picture thing works but also if i add a
.TXT file into the same directory as the image and name the image
image01.jpg and the text file
image01.txt can i include:
Inside a include tag?
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Thu Sep 26, 2002 3:54 pm
I've tried this:
Code: Select all
<img src= "./dale/image<?=$_GETї'img']?>.jpg"><br><br>
<?PHP
include("image<?=$_GETї'img']?>.txt");
?>
But that dont work
I get this:
Code: Select all
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/etc/httpd/dale.unrealism.com/gallery/index.php on line 10
Any ideas?
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Thu Sep 26, 2002 4:06 pm
Try this to include the text file:-
Code: Select all
<img src= "./dale/image<?=$_GETї'img']?>.jpg"><br><br>
<?php
include("image{$_GETї'img']}.txt");
?>
If you want to print the content of the txt file use:-
Code: Select all
<img src= "./dale/image<?=$_GETї'img']?>.jpg"><br><br>
<?php
$fh = fopen("image{$_GETї'img']}.txt","r");
$content = fread($fh,filesize("image{$_GETї'img']}.txt"));
echo $content;
fclose($fh);
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Thu Sep 26, 2002 4:21 pm
Takuma if i had the transport to goto Derby... i would kiss you (NOTE: Im not gay) because you've fixed another one of my problems...
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Thu Sep 26, 2002 4:24 pm
Whatever you do just don't kiss me
Just hug me
Dale
Forum Contributor
Posts: 466 Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks
Post
by Dale » Thu Sep 26, 2002 4:26 pm