Jake
Jake

Reputation: 31

How to automaticly place file name for a link in php

I am wanting to pull a name from a database using php and place it in a link. For example:

echo" -td- -a href ='**$EmployeeID**.jpg'>View Form /a-";   

$EmployeeID being the name of the file i am wanting to place in the link. My issues is adding the file extension (.jpg) on the end of it. Is this possible?

Upvotes: 2

Views: 30

Answers (1)

Vico
Vico

Reputation: 1256

If $EmployeeID is the name of the file, you can add .jpg at the end of it thanks to this line:

$EmployeeId = $EmployeeID.'.jpg';

So after your edit, your echo will be:

echo ' -td- -a href ="'.$EmployeeID.'.jpg">View Form /a-';

Upvotes: 1

Related Questions