To put the appropiate photo in the profile session. |
[eluser]masentinel900[/eluser]
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. Code: $data['ruta'] = $_SERVER['DOCUMENT_ROOT'].'/'; This is the Code in the HTML file for may to show the picture. Code: <img src="<?php echo $ruta,$rutaimagen; ?>"> 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..
[eluser]j0se[/eluser]
To join strings or "vars" need to use . Example: Code: <img src="<?php echo $ruta . $rutaimagen ;?>"> Code: <img src="<?=$ruta . $rutaimagen ?>">
[eluser]masentinel900[/eluser]
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...
[eluser]j0se[/eluser]
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 --- http://yourserver.com/V1/profileFolder/) you must use "/V1/profileFolder/" for $data['ruta']
[eluser]masentinel900[/eluser]
My friend don´t works,I Put this but neither works.. I don´t know why..
[eluser]j0se[/eluser]
if you go to: http://server/V1/profileFolder/tibby.jpg or http://server/profileFolder/tibby.jpg you see the pic??
[eluser]masentinel900[/eluser]
When I put the route "http://localhost:8080/V1/profilefolder/tibby.jpg" I see the photo..
[eluser]j0se[/eluser]
If Code: $data['rutaimagen'] = $session_data['rutaimagen']; Code: $path = "/V1/profileFolder/"; If not work put the code or the url where I can see it ...
[eluser]masentinel900[/eluser]
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.. |
Welcome Guest, Not a member yet? Register Sign In |