To put the appropiate photo in the profile session.

Hello Everybody.
I´m managing a session module for the users in my Website, now I need that each one user have your profile picture. For this there a space in where the user may upload your photo.

Until This point all right, The route is upload to a table in a DB. No problem.

I want to show the picture like this:

Here I declare the route in a variable in a controller file.
$data['ruta'] = $_SERVER['DOCUMENT_ROOT'].'/';
$data['rutaimagen'] = $session_data['rutaimagen'];
"The second variable is the called to the table in the database, This is the container of the route from the codeigniter folder"

This is the Code in the HTML file for may to show the picture.
<img src="&lt;?php echo $ruta,$rutaimagen; ?&gt;">

When I to call the php variable show it good, but when I intrduce in the src="" of the img tag don´t show nothing..

To join strings or "vars" need to use .

<img src="&lt;?php echo $ruta . $rutaimagen ;?&gt;">
<img src="&lt;?=$ruta . $rutaimagen ?&gt;">

Hello, Thanks by your reponse.

The "," in the join string put it bad but already I fix it.

I tested the due ways that you tell me and nothing works, you see my route "C:/Program Files (x86)/PostgreSQL/EnterpriseDB-ApachePHP/apache/www/V1/profileFolder/tibby.jpg" ..

I don´t know why not show the picture with this variables in the src...

You can't use $_SERVER['DOCUMENT_ROOT'] you must use "relative path"

If absolute path is “C:/Program Files (x86)/PostgreSQL/EnterpriseDB-ApachePHP/apache/www/V1/profileFolder/tibby.jpg” (if root of web is in www ---
you must use "/V1/profileFolder/" for $data['ruta']

My friend don´t works,I Put this but neither works.. I don´t know why..

if you go to:




you see the pic??

When I put the route "http://localhost:8080/V1/profilefolder/tibby.jpg" I see the photo..

$data['rutaimagen'] = $session_data['rutaimagen'];
is the filename of the pic...

$path = "/V1/profileFolder/";
<img src="&lt;?=$path . $data['rutaimagen']?&gt;">

If not work put the code or the url where I can see it ...

But I have a question, I should to name all the route..
So with "C:/Program Files (x86)/PostgreSQL/EnterpriseDB-ApachePHP/apache/" or only I should to name next of the folder www of my localhost..

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.