Php code doesn't know where it's wrong.

63 4

The original code is like this:

<?php
list($width, $height, $type, $attr) =
 getimagesize("http://".Asaph_Config::$domain.$p['image']);
?>
<a href="<?php echo $p['source'];?>" title="查看原图">
 <img src="https://www.segmentfault.com/phpthumb/phpThumb.php?src=<?php echo $p['image'];?>&w=192" <?php echo $attr;?> alt="<?php echo $p['title'];?>"/>
</a>

Now you need to change the path of the getimagesize object image, and use the phpthumb path instead.

<?php
list($width, $height, $type, $attr) =
 getimagesize("http://".Asaph_Config::$domain.$p['image']);
?><

Inside.

"http://".Asaph_Config::$domain.$p['image']

Change to

/phpthumb/phpThumb.php?src=<?php echo $p['image'];?>&w=192

But when I changed, the program prompts.

Parse error: syntax error, unexpected t_string in/home/bigwar/domains/blog. fengyiyi. com/public_html/u/templates/huaban/posts. Html. Php on line 87.
2 Answers

64 0

There's no one. It should be.

<?php list($width, $height, $type, $attr) = getimagesize("/phpthumb/phpThumb.php?src=".$p['image']."&w=192");?>

At the same time, note that phpthumb specifies the phpthumb folder of the root directory.
It should be written in <?php and ?>, and the <?php?> tag will be written in.

144 2
...